我是拉的阿里云镜像然后打官方镜像的 tag, 一步到位.
sudo apt update && sudo apt install -y apt-transport-https curl
curl -s
https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb
https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt update && sudo apt install -y kubelet kubectl kubeadm
KUBE_VER=$(kubeadm version -o short)
IMAGE_MIRROR="
registry.cn-hangzhou.aliyuncs.com/google_containers"
kubeadm config images list >/tmp/ki
images=$(tail -n7 /tmp/ki | tr "\/" "\n" | awk '!(NR%2)')
for imageName in ${images[@]}; do
docker pull ${IMAGE_MIRROR}/${imageName}
docker tag ${IMAGE_MIRROR}/${imageName}
k8s.gcr.io/${imageName}
docker rmi ${IMAGE_MIRROR}/${imageName}
done