How to fix a ErrImage pod
作者:互联网
The pod 'kubernetes-dashboard-7cd7b859c9-x4v64' is always ImagePullBackOff
[root@k8s-master ~]# kubectl get pods -A NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-6d8c4cb4d-7p9l9 0/1 CrashLoopBackOff 21 (3m13s ago) 30d kube-system coredns-6d8c4cb4d-s6cv2 0/1 CrashLoopBackOff 21 (3m13s ago) 30d kube-system etcd-k8s-master 1/1 Running 1 30d kube-system kube-apiserver-k8s-master 1/1 Running 1 30d kube-system kube-controller-manager-k8s-master 1/1 Running 0 30d kube-system kube-flannel-ds-2t8m9 1/1 Running 0 30d kube-system kube-flannel-ds-2xtw2 1/1 Running 0 30d kube-system kube-flannel-ds-f894z 1/1 Running 0 30d kube-system kube-proxy-5h6zm 1/1 Running 0 30d kube-system kube-proxy-pcvkt 1/1 Running 0 30d kube-system kube-proxy-rv9zg 1/1 Running 0 30d kube-system kube-scheduler-k8s-master 1/1 Running 1 30d kube-system kubernetes-dashboard-7cd7b859c9-x4v64 0/1 ImagePullBackOff 0 45h [root@k8s-master ~]#
I check its status.
It says 'Back-off pulling image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1"'
It means k8s is always tyring to pull image from k8s.gcr.io, but that is not going to happen because google is blocked in China
[root@k8s-master ~]# kubectl describe pods kubernetes-dashboard-7cd7b859c9-x4v64 -n kube-system Name: kubernetes-dashboard-7cd7b859c9-x4v64 Namespace: kube-system Priority: 0 Node: k8s-master/10.26.12.123 Start Time: Sat, 05 Feb 2022 22:47:32 +0800 Labels: k8s-app=kubernetes-dashboard pod-template-hash=7cd7b859c9 Annotations: <none> Status: Pending IP: 10.244.0.25 IPs: IP: 10.244.0.25 Controlled By: ReplicaSet/kubernetes-dashboard-7cd7b859c9 Containers: kubernetes-dashboard: Container ID: Image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1 Image ID: Port: 8443/TCP Host Port: 0/TCP Args: --auto-generate-certificates State: Waiting Reason: ImagePullBackOff Ready: False Restart Count: 0 Liveness: http-get https://:8443/ delay=30s timeout=30s period=10s #success=1 #failure=3 Environment: <none> Mounts: /certs from kubernetes-dashboard-certs (rw) /tmp from tmp-volume (rw) /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-8z6nk (ro) Conditions: Type Status Initialized True Ready False ContainersReady False PodScheduled True Volumes: kubernetes-dashboard-certs: Type: Secret (a volume populated by a Secret) SecretName: kubernetes-dashboard-certs Optional: false tmp-volume: Type: EmptyDir (a temporary directory that shares a pod's lifetime) Medium: SizeLimit: <unset> kube-api-access-8z6nk: Type: Projected (a volume that contains injected data from multiple sources) TokenExpirationSeconds: 3607 ConfigMapName: kube-root-ca.crt ConfigMapOptional: <nil> DownwardAPI: true QoS Class: BestEffort Node-Selectors: <none> Tolerations: node-role.kubernetes.io/master:NoSchedule node.kubernetes.io/not-ready:NoExecute op=Exists for 300s node.kubernetes.io/unreachable:NoExecute op=Exists for 300s Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal BackOff 4m12s (x320 over 81m) kubelet Back-off pulling image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1" [root@k8s-master ~]#
Then I find the image 'kubernetes-dashboard-amd64:v1.10.1' in Docker Hub.
I pull it and give it a new tag.
mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 → k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1
[root@k8s-master ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE rancher/mirrored-flannelcni-flannel v0.16.1 404fc3ab6749 4 weeks ago 69.8MB registry.aliyuncs.com/google_containers/kube-apiserver v1.23.1 b6d7abedde39 7 weeks ago 135MB registry.aliyuncs.com/google_containers/kube-proxy v1.23.1 b46c42588d51 7 weeks ago 112MB registry.aliyuncs.com/google_containers/kube-scheduler v1.23.1 71d575efe628 7 weeks ago 53.5MB registry.aliyuncs.com/google_containers/kube-controller-manager v1.23.1 f51846a4fd28 7 weeks ago 125MB registry.aliyuncs.com/google_containers/etcd 3.5.1-0 25f8c7f3da61 3 months ago 293MB rancher/mirrored-flannelcni-flannel-cni-plugin v1.0.0 cd5235cd7dc2 3 months ago 9.03MB registry.aliyuncs.com/google_containers/coredns v1.8.6 a4ca41631cc7 4 months ago 46.8MB registry.aliyuncs.com/google_containers/pause 3.6 6270bb605e12 5 months ago 683kB [root@k8s-master ~]# docker pull mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 v1.10.1: Pulling from mirrorgooglecontainers/kubernetes-dashboard-amd64 63926ce158a6: Pull complete Digest: sha256:d6b4e5d77c1cdcb54cd5697a9fe164bc08581a7020d6463986fe1366d36060e8 Status: Downloaded newer image for mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 docker.io/mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 [root@k8s-master ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE rancher/mirrored-flannelcni-flannel v0.16.1 404fc3ab6749 4 weeks ago 69.8MB registry.aliyuncs.com/google_containers/kube-apiserver v1.23.1 b6d7abedde39 7 weeks ago 135MB registry.aliyuncs.com/google_containers/kube-proxy v1.23.1 b46c42588d51 7 weeks ago 112MB registry.aliyuncs.com/google_containers/kube-controller-manager v1.23.1 f51846a4fd28 7 weeks ago 125MB registry.aliyuncs.com/google_containers/kube-scheduler v1.23.1 71d575efe628 7 weeks ago 53.5MB registry.aliyuncs.com/google_containers/etcd 3.5.1-0 25f8c7f3da61 3 months ago 293MB rancher/mirrored-flannelcni-flannel-cni-plugin v1.0.0 cd5235cd7dc2 3 months ago 9.03MB registry.aliyuncs.com/google_containers/coredns v1.8.6 a4ca41631cc7 4 months ago 46.8MB registry.aliyuncs.com/google_containers/pause 3.6 6270bb605e12 5 months ago 683kB mirrorgooglecontainers/kubernetes-dashboard-amd64 v1.10.1 f9aed6605b81 3 years ago 122MB [root@k8s-master ~]# docker tag mirrorgooglecontainers/kubernetes-dashboard-amd64:v1.10.1 k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1 [root@k8s-master ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE rancher/mirrored-flannelcni-flannel v0.16.1 404fc3ab6749 4 weeks ago 69.8MB registry.aliyuncs.com/google_containers/kube-apiserver v1.23.1 b6d7abedde39 7 weeks ago 135MB registry.aliyuncs.com/google_containers/kube-proxy v1.23.1 b46c42588d51 7 weeks ago 112MB registry.aliyuncs.com/google_containers/kube-controller-manager v1.23.1 f51846a4fd28 7 weeks ago 125MB registry.aliyuncs.com/google_containers/kube-scheduler v1.23.1 71d575efe628 7 weeks ago 53.5MB registry.aliyuncs.com/google_containers/etcd 3.5.1-0 25f8c7f3da61 3 months ago 293MB rancher/mirrored-flannelcni-flannel-cni-plugin v1.0.0 cd5235cd7dc2 3 months ago 9.03MB registry.aliyuncs.com/google_containers/coredns v1.8.6 a4ca41631cc7 4 months ago 46.8MB registry.aliyuncs.com/google_containers/pause 3.6 6270bb605e12 5 months ago 683kB mirrorgooglecontainers/kubernetes-dashboard-amd64 v1.10.1 f9aed6605b81 3 years ago 122MB k8s.gcr.io/kubernetes-dashboard-amd64 v1.10.1 f9aed6605b81 3 years ago 122MB [root@k8s-master ~]#
Then it is OK
[root@k8s-master ~]# kubectl get pods -A NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-6d8c4cb4d-7p9l9 0/1 CrashLoopBackOff 23 (4m35s ago) 30d kube-system coredns-6d8c4cb4d-s6cv2 0/1 CrashLoopBackOff 23 (4m25s ago) 30d kube-system etcd-k8s-master 1/1 Running 1 30d kube-system kube-apiserver-k8s-master 1/1 Running 1 30d kube-system kube-controller-manager-k8s-master 1/1 Running 0 30d kube-system kube-flannel-ds-2t8m9 1/1 Running 0 30d kube-system kube-flannel-ds-2xtw2 1/1 Running 0 30d kube-system kube-flannel-ds-f894z 1/1 Running 0 30d kube-system kube-proxy-5h6zm 1/1 Running 0 30d kube-system kube-proxy-pcvkt 1/1 Running 0 30d kube-system kube-proxy-rv9zg 1/1 Running 0 30d kube-system kube-scheduler-k8s-master 1/1 Running 1 30d kube-system kubernetes-dashboard-7cd7b859c9-x4v64 1/1 Running 0 46h [root@k8s-master ~]#
标签:ago,k8s,kubernetes,fix,system,How,ErrImage,dashboard,kube 来源: https://www.cnblogs.com/albert-huang1/p/How_to_fix_a_ErrImage_pod.html