github示例如下

k8s-images

#阿里云或者dockerhub海外镜像下载配置 解决被墙问题

这个只是提供一个思路,假如有被墙得镜像可以通过这种方式去下载

阿里云配置如下

k8s-images k8s-images k8s-images

dockerhub配置如下

k8s-images

#当然安装k8s也可以直接用阿里云的镜像仓库

vim /etc/yum.repos.d/docker-ce.repo 
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
#docker环境本地下载
yum install --downloadonly  --downloaddir=. docker
#kubeadm环境下载
vim /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
yum install --downloadonly  --downloaddir=. kubeadm
#获取k8s镜像的命令
kubeadm --kubernetes-version=v1.16.3 config images list
#所有k8s依赖包导出
docker save $(docker images | grep -v REPOSITORY | awk 'BEGIN{OFS=":";ORS=" "}{print $1,$2}') -o k8s-images-1.16.3.tar