问题:
安装网络组件calico报错Init:ImagePullBackOff
[root@k8s-master 15:33:08~/kubernets]# kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE calico-kube-controllers-cd8566cf-cqvxj 1/1 Running 0 33m calico-node-6f4np 1/1 Running 1 (11m ago) 33m calico-node-bvvhc 0/1 Init:ImagePullBackOff 0 5m37s # [root@k8s-master 15:46:58~/kubernets]# kubectl describe po calico-node-986fm -n kube-system Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 5m11s default-scheduler Successfully assigned kube-system/calico-node-bvvhc to node03 Warning Failed 119s (x2 over 3m29s) kubelet Failed to pull image "calico/cni:v3.25.0": rpc error: code = Unknown desc = context canceled Normal Pulling 92s (x3 over 5m11s) kubelet Pulling image "calico/cni:v3.25.0" Warning Failed 14s (x3 over 3m29s) kubelet Error: ErrImagePull Warning Failed 14s kubelet Failed to pull image "calico/cni:v3.25.0": rpc error: code = Unknown desc = unexpected EOF Normal SandboxChanged 13s kubelet Pod sandbox changed, it will be killed and re-created. Normal BackOff 1s (x5 over 3m28s) kubelet Back-off pulling image "calico/cni:v3.25.0" Warning Failed 1s (x5 over 3m28s) kubelet Error: ImagePullBackOfff
分析:
Pod事件列表中有“实例拉取镜像失败”事件,报错原因如下。这可能是镜像较大导致的情况。
解决:
# 到报错的机器node03上面手动下载镜像,可以参考其它成功机器的镜像 docker pull calico/cni:v3.25.0 # 然后删除Pod里面报错的容器 kubectl get pods -n kube-system | grep calico-node-bvvhc | awk '{print$1}'| xargs kubectl delete -n kube-system pods
查看是否正常,calico开头的容器都是READY
[root@k8s-master 15:44:05~/kubernets]# kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE calico-kube-controllers-cd8566cf-cqvxj 1/1 Running 0 45m calico-node-44kgv 1/1 Running 0 10m calico-node-6f4np 1/1 Running 1 (23m ago) 45m calico-node-lv4sp 1/1 Running 0 45m calico-node-sw8r6 1/1 Running 0 45m coredns-6d8c4cb4d-77n7q 1/1 Running 0 125m coredns-6d8c4cb4d-bzm57 1/1 Running 0 125m etcd-k8s-master 1/1 Running 1 (23m ago) 125m kube-apiserver-k8s-master 1/1 Running 1 (23m ago) 125m kube-controller-manager-k8s-master 1/1 Running 1 (23m ago) 125m kube-proxy-4ft66 1/1 Running 1 (23m ago) 125m kube-proxy-4lmf2 1/1 Running 0 78m kube-proxy-thznw 1/1 Running 0 77m kube-proxy-xnlmm 1/1 Running 1 (12m ago) 78m kube-scheduler-k8s-master 1/1 Running 1 (23m ago) 125m
查看node是否已经Ready状态
NAME STATUS ROLES AGE VERSION k8s-master Ready control-plane,master 127m v1.23.6 node01 Ready <none> 79m v1.23.6 node02 Ready <none> 79m v1.23.6 node03 Ready <none> 80m v1.23.6
补充一点
如果去机器上面也慢的话可以修改一下/etc/docker/daemon.json国内源
vim /etc/docker/daemon.json sudo systemctl daemon-reload systemctl restart docker.service
标签:node,kube,Running,Init,报错,master,k8s,calico From: https://www.cnblogs.com/lucktomato/p/18197930