360SDN.COM

K8S 报 ErrImagePull k8s.gcr.io国内无法连接解决方法

来源:  2019-04-26 11:23:07    评论:0点击:

k8s.gcr.io连接不上之后,会报如下的错误:

[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.12.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.12.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.12.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.12.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.1: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.2.24: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns:1.2.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1

解决方法:

1、做科学上网,这里不做解释

2、通过docker.io下载,然后改tag标签:

这里的版本号请跟自己的版本号对应

下载:

 
    

docker pull mirrorgooglecontainers/kube-apiserver-amd64:v1.12.2

docker pull mirrorgooglecontainers/kube-controller-amd64:v1.12.2

docker pull mirrorgooglecontainers/kube-controller-manager-amd64:v1.12.2

docker pull mirrorgooglecontainers/kube-scheduler-amd64:v1.12.2

docker pull mirrorgooglecontainers/kube-proxy-amd64:v1.12.2

docker pull mirrorgooglecontainers/pause:3.1

docker pull mirrorgooglecontainers/etcd-amd64:3.2.24

docker pull mirrorgooglecontainers/coredns:1.2.2

docker pull mirrorgooglecontainers/coredns-amd64:1.2.2

docker pull coredns/coredns:1.2.2

 
 

docker tag mirrorgooglecontainers/kube-proxy-amd64:v1.12.2 k8s.gcr.io/kube-proxy:v1.12.2

docker tag mirrorgooglecontainers/kube-apiserver-amd64:v1.12.2 k8s.gcr.io/kube-apiserver:v1.12.2

docker tag mirrorgooglecontainers/kube-controller-manager-amd64:v1.12.2 k8s.gcr.io/kube-controller-manager:v1.12.2

docker tag mirrorgooglecontainers/kube-scheduler-amd64:v1.12.2 k8s.gcr.io/kube-scheduler:v1.12.2

docker tag mirrorgooglecontainers/etcd-amd64:3.2.24 k8s.gcr.io/etcd:3.2.24

docker tag coredns/coredns:1.2.2 k8s.gcr.io/coredns:1.2.2

docker tag mirrorgooglecontainers/pause:3.1 k8s.gcr.io/pause:3.1

 

ImagePullBackOff 一般都是因为镜像拉不下来,很大可能是因为镜像被墙。可以试试修改 xxxx.yaml 中指定的  镜像,找一个国内或者 dockerhub 上面的同个版本的镜像试试。

这个办法看起来比较简单 但是谁知道国内有什么k8s的镜像源吗

参考:http://www.360sdn.com/Kubernetes/2019/0425/17609.html


原文:https://blog.csdn.net/h952520296/article/details/86981343
为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权