https://github.com/NVIDIA/deepops/blob/master/docs/dgx-pod.md

在使用k8s的过程中,经常遇到k8s.gcr.io的镜像无法下载的问题,无意间得知可以通过这种方法下载,赶紧记下来;

下载速度还很快,解决我一大难题~
假如需要的镜像为k8s.gcr.io/pause:3.1,可以执行下面的操作

docker pull anjia0532/pause:3.1
docker tag anjia0532/pause:3.1 k8s.gcr.io/pause:3.1
docker rmi anjia0532/pause:3.1

注:pause:3.1可以替换为任何k8s.gcr.io的镜像

例如:

docker pull anjia0532/cluster-proportional-autoscaler-amd64:1.3.0
docker tag anjia0532/cluster-proportional-autoscaler-amd64:1.3.0 gcr.io/google-containers/cluster-proportional-autoscaler-amd64:1.3.0
docker rmi anjia0532/cluster-proportional-autoscaler-amd64:1.3.0

对于gcr.io/kubernetes-helm/tiller:v2.11.0

使用:docker pull anjia0532/kubernetes-helm.tiller:v2.11.0

更好的方法参考:
https://github.com/anjia0532/gcr.io_mirror?tdsourcetag=s_pcqq_aiomsg

gcr.io/namespace/image_name:image_tag 
#eq
gcr.azk8s.cn/namespace/image_name:image_tag 

# special
k8s.gcr.io/{image}/{tag} <==> gcr.io/google-containers/{image}/{tag} <==> gcr.azk8s.cn/namespace/image_name:image_tag 

 

====================

sed -i 's#k8s.gcr.io#gcr.azk8s.cn/google-containers#g' ./kubespray/roles/container-engine/cri-o/templates/crio.conf.j2

sed -i 's#k8s.gcr.io#gcr.azk8s.cn/google-containers#g' ./kubespray/roles/download/defaults/main.yml

sed -i 's#k8s.gcr.io#gcr.azk8s.cn/google-containers#g' ./kubespray/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/templates/k8s-device-plugin-nvidia-daemonset.yml.j2

sed -i 's#k8s.gcr.io#gcr.azk8s.cn/google-containers#g' ./services/logging/es-statefulset.yaml

sed -i 's#k8s.gcr.io#gcr.azk8s.cn/google-containers#g' ./services/logging/fluentd-es-ds.yaml



sed -i 's#gcr.io#gcr.azk8s.cn#g' ./kubespray/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/vars/ubuntu-16.yml

sed -i 's#gcr.io#gcr.azk8s.cn#g' ./kubespray/inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml

sed -i 's#gcr.io#gcr.azk8s.cn#g' ./kubespray/roles/download/defaults/main.yml

sed -i 's#gcr.io#gcr.azk8s.cn#g' ./kubespray/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/templates/nvidia-driver-install-daemonset.yml.j2

sed -i 's#gcr.io#gcr.azk8s.cn#g' ./kubespray/roles/kubernetes-apps/container_engine_accelerator/nvidia_gpu/vars/ubuntu-18.yml

sed -i 's#gcr.io#gcr.azk8s.cn#g' ./kubespray/roles/kubernetes-apps/registry/README.md

sed -i 's#gcr.io#gcr.azk8s.cn#g' ./services/ingress-controller.yml

sed -i 's#gcr.io#gcr.azk8s.cn#g' ./services/nfs-server.yml

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐