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

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标签:

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

下载:

 

1

2

3

4

5

6

7

8

9

10

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

 

3

4

5

6

7

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的镜像源吗?

 

你可能感兴趣的:(K8S)