資料內(nèi)容:
#下載k8s初始化需要的鏡像包
mkdir /opt/k8s/k8s-images
cd /opt/k8s/k8s-images
#創(chuàng)建并運(yùn)?下載鏡像的腳本
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
#將下載的鏡像進(jìn)?打包
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