一直在学习python小兵

导航

K8S应用FLANNEL失败解决INIT:IMAGEPULLBACKOFF

K8S应用FLANNEL失败解决INIT:IMAGEPULLBACKOFF 

按照搭建Kubernetes时官网给的命令

 kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
  • 1

部署完成时查看

[root@k8s-master01 flannel]# kubectl get pod -n kube-system
NAME                                   READY   STATUS                  RESTARTS   AGE
coredns-5c98db65d4-cr9lq               0/1     Pending                 0          74m
coredns-5c98db65d4-h4h8f               0/1     Pending                 0          74m
etcd-k8s-master01                      1/1     Running                 0          73m
kube-apiserver-k8s-master01            1/1     Running                 0          73m
kube-controller-manager-k8s-master01   1/1     Running                 0          73m
kube-flannel-ds-amd64-cpzh6            0/1     Init:ImagePullBackOff   0          51m
kube-proxy-sb68t                       1/1     Running                 0          74m
kube-scheduler-k8s-master01            1/1     Running                 0          74m

 

 

flannel状态为Init:ImagePullBackOff

原因

查看kube-flannel.yml文件时发现quay.io/coreos/flannel:v0.12.0-amd64

quay.io网站目前国内无法访问

下载flannel:v0.12.0-amd64导入到docker中

可以去https://github.com/coreos/flannel/releases官方仓库下载镜像
在这里插入图片描述


[root@k8s-master01 tmp]# docker load < flanneld-v0.12.0-amd64.docker
256a7af3acb1: Loading layer [==================================================>]  5.844MB/5.844MB
d572e5d9d39b: Loading layer [==================================================>]  10.37MB/10.37MB
57c10be5852f: Loading layer [==================================================>]  2.249MB/2.249MB
7412f8eefb77: Loading layer [==================================================>]  35.26MB/35.26MB
05116c9ff7bf: Loading layer [==================================================>]   5.12kB/5.12kB
Loaded image: quay.io/coreos/flannel:v0.12.0-amd64
[root@k8s-master01 tmp]# docker images
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
quay.io/coreos/flannel               v0.12.0-amd64       4e9f801d2217        4 months ago        52.8MB
k8s.gcr.io/kube-proxy                v1.15.1             89a062da739d        12 months ago       82.4MB
k8s.gcr.io/kube-scheduler            v1.15.1             b0b3c4c404da        12 months ago       81.1MB
k8s.gcr.io/kube-apiserver            v1.15.1             68c3eb07bfc3        12 months ago       207MB
k8s.gcr.io/kube-controller-manager   v1.15.1             d75082f1d121        12 months ago       159MB
k8s.gcr.io/coredns                   1.3.1               eb516548c180        18 months ago       40.3MB
k8s.gcr.io/etcd                      3.3.10              2c4adeb21b4f        20 months ago       258MB
k8s.gcr.io/pause                     3.1                 da86e6ba6ca1        2 years ago         742kB
[root@k8s-master01 tmp]#

[root@k8s-master01 tmp]# kubectl get pod -n kube-system
NAME                                   READY   STATUS    RESTARTS   AGE
coredns-5c98db65d4-cr9lq               1/1     Running   0          104m
coredns-5c98db65d4-h4h8f               1/1     Running   0          104m
etcd-k8s-master01                      1/1     Running   0          103m
kube-apiserver-k8s-master01            1/1     Running   0          103m
kube-controller-manager-k8s-master01   1/1     Running   0          102m
kube-flannel-ds-amd64-cpzh6            1/1     Running   0          80m
kube-proxy-sb68t                       1/1     Running   0          104m
kube-scheduler-k8s-master01            1/1     Running   0          103m
[root@k8s-master01 tmp]#

 转载链接:https://blog.csdn.net/zyl974611232/article/details/107518192

posted on 2021-01-17 12:05  一直在学习python小兵  阅读(5725)  评论(0编辑  收藏  举报