*https://docs.k0sproject.io/v1.24.2+k0s.0/airgap-install/
#需要先安装k0s的二进制包
#查看需要打包的镜像,并通过docker拉取,可以直接在服务器上操作
k0s airgap list-images | xargs -I docker pull
只有k8s.gcr.io下的镜像拉不到
通过阿里云拉取,重新打标签
k0s airgap list-images | grep k8s.gcr.io
docker pull registry.aliyuncs.com/google_containers/coredns:v1.7.0
docker tag registry.aliyuncs.com/google_containers/coredns:v1.7.0 k8s.gcr.io/coredns/coredns:v1.7.0
docker rmi registry.aliyuncs.com/google_containers/coredns:v1.7.0
docker image save $(k0s airgap list-images | xargs) -o bundle_file
复制文件到其它服务器指定目录下
scp bundle_file 192.168.110.35:/root/
ctr --namespace k8s.io \
--address /run/k0s/containerd.sock \
images export bundle_file $(k0s airgap list-images | xargs)
或者复制到/var/lib/k0s/images,node会算自动导入
# mkdir -p /var/lib/k0s/images
# cp bundle_file /var/lib/k0s/images/bundle_file