ErrImagePull is the first failure, ImagePullBackOff the wait until the next attempt. The cause is not in the status but in the message behind it – and that message differs clearly from one fault to the next.
Symptom
kubectl -n tag04 get pods NAME READY STATUS RESTARTS AGE privat-6b74c95474-p5shr 0/1 ImagePullBackOff 0 40s tippfehler-7c975b5497-5cc46 0/1 ErrImagePull 0 40s unerreichbar-699cd56b54-lmwrx 0/1 ErrImagePull 0 40s
Three Pods, two statuses – but three different causes. The status alone doesn't tell them apart.
Diagnosis
The message is in state.waiting.message (or in describe under Events).
for a in tippfehler unerreichbar privat; do
kubectl -n tag04 get pod -l app=$a \
-o jsonpath='{.items[0].status.containerStatuses[0].state.waiting.message}{"\n"}'
done
rpc error: code = NotFound desc = failed to pull and unpack image
"docker.io/nginxinc/nginx-unprivileged:1.29-alpne": ...
docker.io/nginxinc/nginx-unprivileged:1.29-alpne: not found
failed to pull and unpack image "registry.tag04.invalid/web:1.0": ... failed to do
request: Head "https://registry.tag04.invalid/v2/web/manifests/1.0": dial tcp:
lookup registry.tag04.invalid on 127.0.0.53:53: no such host
Back-off pulling image "docker.io/dbglabor/privat-app:1.0": ErrImagePull: ... pull
access denied, repository does not exist or may require authorization: server
message: insufficient_scope: authorization failed
Causes
not foundThe tag doesn't exist
The registry answers but doesn't know the tag – usually a typo, here "alpne" instead of "alpine".
no such hostThe node can't find the registry
The node – not the Pod – cannot resolve the registry name. The address 127.0.0.53 is the host's systemd-resolved.
pull access deniedPrivate or doesn't exist
The repository doesn't exist or it is private; Docker Hub deliberately doesn't tell the two apart. With your own registry and no imagePullSecret, the rest of the message says more.
Back-off pulling image "172.16.0.126:30500/privat/whoami:1.0": ErrImagePull: ... pull access denied, repository does not exist or may require authorization: authorization failed: no basic auth credentials
HTTPS clientThe registry only speaks HTTP
containerd talks to every registry over HTTPS unless registries.yaml says otherwise. In RKE2 that file is /etc/rancher/rke2/registries.yaml on every node.
Back-off pulling image "172.16.0.126:30500/privat/whoami:1.0": ErrImagePull: ... failed to do request: Head "https://172.16.0.126:30500/v2/privat/whoami/manifests/1.0": http: server gave HTTP response to HTTPS client
Fix
kubectl -n tag04 create secret docker-registry intern-pull \
--docker-server=172.16.0.126:30500 \
--docker-username=labor --docker-password=labor-pw-123
kubectl -n tag04 patch deploy intern --type=merge \
-p '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"intern-pull"}]}}}}'
kubectl -n tag04 rollout status deploy/intern
Don't: Debugging DNS inside the Pod on "no such host". The node pulls the image – check there with crictl pull.
Debugging Kubernetes, day 4: pull errors, a private registry, missing ConfigMaps and exec format error, with a drill to reproduce each one.
Go to day 4 →
FAQ
What is the difference between ErrImagePull and ImagePullBackOff?
ErrImagePull is the first failure, ImagePullBackOff the wait until the next attempt. The cause is the same.
How do I test the pull directly on the node?
With sudo -i crictl pull <image> on the node, without the kubelet. That separates "the node can't reach the registry" from "the Pod spec is wrong".
Do I have to put the imagePullSecret into every manifest?
No. Added to the default ServiceAccount of the namespace, it applies to every Pod there; alternatively node-wide in registries.yaml.