资料内容:
#下载k8s初始化需要的镜像包
mkdir /opt/k8s/k8s-images
cd /opt/k8s/k8s-images
#创建并运⾏下载镜像的脚本
sudo tee ./images.sh <<-'EOF'
#!/bin/bash
images=(
kube-apiserver:v1.20.9
kube-proxy:v1.20.9
kube-controller-manager:v1.20.9
kube-scheduler:v1.20.9
coredns:1.7.0
etcd:3.4.13-0
pause:3.2
)
for imageName in ${images[@]} ; do
docker pull registry.cn-hangzhou.aliyuncs.com/lfy_k8s_images/$imageName
done
EOF
chmod +x ./images.sh && ./images.sh
#将下载的镜像进⾏打包
docker save -o kube-apiserver.tar kube-apiserver:v1.20.9
docker save -o kube-proxy.tar kube-proxy:v1.20.9
docker save -o kube-controller-manager.tar kube-controller-manager:v1.20.
9
docker save -o kube-scheduler.tar kube-scheduler:v1.20.9
docker save -o coredns.tar coredns:1.7.0
docker save -o etcd.tar etcd:3.4.13-0
docker save -o pause.tar pause:3.2