欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

解决国内无法访问"k8s.gcr.io"拉取镜像失败问题

程序员文章站 2022-07-13 22:13:15
...

解决思路:
1.在Google Cloud中获取K8s镜像,同步至Hub仓库(该步骤我已经完成,你们只需要从我Hub仓库获取即可);
2.获取Hub仓库中的K8s镜像;
3.使用命令docker tag修改镜像标签;
PS:目前只支持v1.15.0版本,后续版本我将整理放入Hub仓库,敬请关注;

Hub仓库网址

kube-apiserver:v1.15.0
https://hub.docker.com/r/kry1702/kube-apiserver

kube-controller-manager:v1.15.0
https://hub.docker.com/r/kry1702/kube-controller-manager

kube-scheduler:v1.15.0
https://hub.docker.com/r/kry1702/kube-scheduler

kube-proxy:v1.15.0
https://hub.docker.com/r/kry1702/kube-proxy

pause:3.1
https://hub.docker.com/r/kry1702/pause

etcd:3.3.10
https://hub.docker.com/r/kry1702/etcd

coredns:1.3.1
https://hub.docker.com/r/kry1702/coredns

拉取方式

docker pull kry1702/kube-apiserver:v1.15.0
docker pull kry1702/kube-controller-manager:v1.15.0
docker pull kry1702/kube-scheduler:v1.15.0
docker pull kry1702/kube-proxy:v1.15.0
docker pull kry1702/pause:3.1
docker pull kry1702/etcd:3.3.10
docker pull kry1702/coredns:1.3.1

还原操作

docker tag kry1702/kube-apiserver:v1.15.0 k8s.gcr.io/kube-apiserver:v1.15.0
docker tag kry1702/kube-controller-manager:v1.15.0 k8s.gcr.io/kube-controller-manager:v1.15.0  
docker tag kry1702/kube-scheduler:v1.15.0 k8s.gcr.io/kube-scheduler:v1.15.0  
docker tag kry1702/kube-proxy:v1.15.0 k8s.gcr.io/kube-proxy:v1.15.0  
docker tag kry1702/pause:3.1 k8s.gcr.io/pause:3.1 
docker tag kry1702/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10 
docker tag kry1702/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1