Skip to content
|By Muhammad Wilayat Shah|6 views • 6 unique IPs

Fix Kubernetes ImagePullBackOff and ErrImagePull

Fix ImagePullBackOff by reading the exact pull error: wrong tag, missing or stale imagePullSecret, wrong architecture, untrusted CA, DNS, proxy or Docker Hub limits.

ShareLinkedInX
Fix Kubernetes ImagePullBackOff and ErrImagePull

Last reviewed: 2 December 2026

The deploy that taught me to read pull errors properly was a boring one. We shipped a small change to an orders API on a Friday afternoon, the pipeline went green, and kubectl rollout status just sat there. The old pods were still serving traffic, so nobody outside the team noticed. The new pod said ImagePullBackOff. Someone had rotated the password for our private registry that morning, updated it in CI, and forgotten the Kubernetes Secret. CI could push. The cluster could not pull.

The fix took one command. Finding it took longer than it should have, because ImagePullBackOff is not an error. It is a waiting state. Kubernetes tried to pull the image, failed, and is now waiting before trying again. The real error is one line in the pod events, and that line tells you exactly which layer broke: the image name, the credentials, the registry's certificate, the network, or the image's CPU architecture.

This guide goes through each of those layers separately. For every cause you get the exact error text, the command that confirms it, and the fix. I reproduced almost all of them on a throwaway kind v0.30 cluster running Kubernetes v1.34.0 with containerd 2.1.3, a private registry with a password, a second registry with a self-signed certificate, and an image built only for arm64. The outputs below are copied from that lab. Where something could not be reproduced on a laptop (cloud registries, Docker Hub's 429 limit, corporate proxies), I say so and the section is based on the vendor documentation.

ErrImagePull vs ImagePullBackOff: what you are looking at

When the kubelet on a node needs a container image, it asks the container runtime (containerd or CRI-O) to pull it. The runtime resolves the registry host, opens an HTTPS connection, authenticates, asks for the manifest of the tag, picks the right platform, then downloads and unpacks the layers. If any step fails, the pod's container goes to ErrImagePull. The kubelet then waits and tries again, and while it waits the status shows ImagePullBackOff. The wait grows with each failure. According to the Kubernetes documentation the delay increases up to a cap of five minutes.

So the two statuses are the same problem at different moments. You will see the pod flip between them:

Code
$ kubectl get pods -n shop
NAME                 READY   STATUS              RESTARTS   AGE
api-dns              0/1     ImagePullBackOff    0          60s
api-never            0/1     ErrImageNeverPull   0          60s
orders-tls           0/1     ErrImagePull        0          60s
orders-tls443        0/1     ErrImagePull        0          60s
report-worker        0/1     CrashLoopBackOff    3 (16s ago) 60s
web-badtag           0/1     ErrImagePull        0          60s

Note RESTARTS 0. The container never started, so this is not a crash. If you see restarts climbing, the image pulled fine and you have a different problem; my CrashLoopBackOff guide covers that side. One row above is a trap I will come back to: report-worker pulled an image for the wrong CPU and crashes instead of failing to pull.

Animated diagram of a Kubernetes image pull: kubelet asks containerd to pull, the request passes DNS and TLS, reaches the registry for auth and the manifest, fails at a different layer in each scene, goes into ImagePullBackOff, and finally pulls and runs
The pull passes through four layers. The error message tells you which one failed.

A two-minute diagnosis

1. Get the exact error text from the events

Everything starts here. Do not guess from the status column.

Code
$ kubectl describe pod web-badtag -n shop
...
Events:
  Type     Reason     Age                   From      Message
  ----     ------     ----                  ----      -------
  Normal   Pulling    26s (x5 over 3m33s)   kubelet   spec.containers{web}: Pulling image "nginx:1.27.99-alpine"
  Warning  Failed     25s (x5 over 3m33s)   kubelet   spec.containers{web}: Failed to pull image "nginx:1.27.99-alpine": rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/nginx:1.27.99-alpine": failed to resolve reference "docker.io/library/nginx:1.27.99-alpine": docker.io/library/nginx:1.27.99-alpine: not found
  Warning  Failed     25s (x5 over 3m33s)   kubelet   spec.containers{web}: Error: ErrImagePull
  Normal   BackOff    11s (x12 over 3m32s)  kubelet   spec.containers{web}: Back-off pulling image "nginx:1.27.99-alpine"
  Warning  Failed     11s (x12 over 3m32s)  kubelet   spec.containers{web}: Error: ImagePullBackOff

The only line that matters is the long Failed to pull image one. The Error: ErrImagePull and Error: ImagePullBackOff lines carry no information. If the events have aged out (they expire after about an hour by default), the same text is kept in the container status:

Code
$ kubectl get pod web-badtag -n shop -o jsonpath='{.status.containerStatuses[0].state}'
{"waiting":{"message":"rpc error: code = NotFound desc = failed to pull and unpack image \"docker.io/library/nginx:1.27.99-alpine\": ... not found","reason":"ErrImagePull"}}

For a Deployment with many pods, list only the pull failures across the namespace:

Code
kubectl get events -n shop --field-selector reason=Failed \
  -o custom-columns=POD:.involvedObject.name,MSG:.message | grep -i pull

2. Read the last words of the message

The message is a chain of wrappers. Read it from the end. These are the endings I got in the lab, and what each one points to:

  • : not found (with code = NotFound) - the registry answered, and that tag or repository does not exist there. Name or tag problem.
  • pull access denied, repository does not exist or may require authorization - either the repository name is wrong or you sent no credentials. Docker Hub deliberately gives the same answer for both.
  • 401 Unauthorized - you sent credentials and the registry rejected them. Stale password or expired token.
  • no match for platform in manifest - the image exists, but not for this node's CPU architecture.
  • x509: certificate signed by unknown authority - TLS. The node does not trust the registry's certificate.
  • lookup ... server misbehaving or no such host - DNS on the node.
  • dial tcp ...: i/o timeout - network path, firewall, or proxy.
  • ErrImageNeverPull or InvalidImageName - not a registry problem at all. Pull policy or a malformed image string.

3. Reproduce the pull without Kubernetes

Once you suspect credentials or the registry, take Kubernetes out of the picture. On the node itself (for kind: docker exec -it <node> bash; on a VM: SSH), run the same pull through the runtime with explicit credentials:

Code
$ crictl pull --creds 'deploy:S3cure-Pass' reg-private:5000/team/orders-api:1.4.2
Image is up to date for sha256:b116e155074440ffd9e449559433feb4cd2341eb3554b1da1c638c976e56451d

$ crictl pull --creds 'deploy:Old-Pass-2025' reg-private:5000/team/orders-api:1.4.2
FATA pulling image: failed to pull and unpack image "reg-private:5000/team/orders-api:1.4.2": failed to resolve reference "reg-private:5000/team/orders-api:1.4.2": unexpected status from HEAD request to http://reg-private:5000/v2/team/orders-api/manifests/1.4.2: 401 Unauthorized

If crictl works with the right password and fails with the old one, the registry and the network are fine and only the Kubernetes Secret is wrong. If crictl fails too, the problem is on the node: DNS, CA trust, proxy, or the registry itself. That one test splits the search space in half.

Animated terminal session: kubectl get pods shows ImagePullBackOff, describe shows a 401 Unauthorized pull error, crictl pull with the current password succeeds, the image pull Secret is recreated and the pod becomes Running
The real diagnosis session from the lab, condensed: events, then an out-of-band pull, then the fix.

Fixes, by cause

1. The tag does not exist

The most common cause in my experience is a tag that was never pushed: a CI job failed halfway, someone typed 1.4.3 before the build finished, or a Helm value points at a tag from another branch.

Code
Failed to pull image "nginx:1.27.99-alpine": rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/nginx:1.27.99-alpine": failed to resolve reference "docker.io/library/nginx:1.27.99-alpine": docker.io/library/nginx:1.27.99-alpine: not found

Confirm: list the tags the registry actually has. For a private registry that speaks the standard v2 API:

Code
$ curl -s -u deploy:*** http://reg-private:5000/v2/team/orders-api/tags/list
{"name":"team/orders-api","tags":["1.4.2"]}

For Docker Hub, docker manifest inspect nginx:1.27-alpine from any machine tells you whether a tag exists without pulling it. In cloud registries, the console or CLI (aws ecr describe-images, gcloud artifacts docker tags list, az acr repository show-tags) does the same.

Fix: point the workload at a tag that exists, or push the missing one. In the lab I also did what you should do in production when a release goes wrong: let the Deployment protect you, then roll back.

Code
$ kubectl set image deploy/orders-api orders-api=reg-private:5000/team/orders-api:1.4.3
deployment.apps/orders-api image updated
$ kubectl rollout status deploy/orders-api --timeout=40s
Waiting for deployment "orders-api" rollout to finish: 1 out of 2 new replicas have been updated...
error: timed out waiting for the condition
$ kubectl get pods -l app=orders-api
NAME                          READY   STATUS             RESTARTS   AGE
orders-api-5c997f45b8-m8mqt   1/1     Running            0          41s
orders-api-5c997f45b8-nxmz5   1/1     Running            0          41s
orders-api-765bb6ffbc-txp8v   0/1     ImagePullBackOff   0          40s
$ kubectl rollout undo deploy/orders-api
deployment.apps/orders-api rolled back

The two old pods kept running the whole time. A rolling update only removes old pods once new ones are ready, so a bad tag stalls the rollout instead of taking the service down. That is also why this failure is easy to miss: nothing is on fire, the rollout just never finishes. Put kubectl rollout status --timeout in your pipeline so the job fails loudly.

2. The image name is wrong (or the repository is private)

A typo in the repository name looks different from a wrong tag. I ran this one directly against Docker Hub with containerd on the lab host, because the answer comes from Docker Hub itself:

Code
$ ctr images pull docker.io/library/ngnix:1.27-alpine
ctr: failed to resolve reference "docker.io/library/ngnix:1.27-alpine": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

A private repository that exists but needs a login gives exactly the same message. Docker Hub does not tell anonymous users which repositories exist. So "pull access denied" means: check the spelling first (ngnix, a missing organisation prefix, myorg/api vs my-org/api), and if the spelling is right, it is a credentials problem and you need the next section.

Two more name problems I hit in the lab:

  • No registry host in the name. I wrote reg-tls/team/orders-api:1.4.2 for an image on my own registry. Without a dot or a port in the first part, the runtime treats it as a Docker Hub namespace: failed to resolve reference "docker.io/reg-tls/team/orders-api:1.4.2": ... not found. Any private registry host must contain a dot, a port, or be localhost. Writing reg-tls:443/team/orders-api:1.4.2 fixed it.
  • Uppercase letters. Repository names must be lowercase. This fails before any pull with status InvalidImageName and the event couldn't parse image name "reg-private:5000/team/Orders-API:1.4.2": invalid reference format: repository name (team/Orders-API) must be lowercase. Tags may contain uppercase; repository paths may not.

3. Private registry, no credentials sent

Code
Failed to pull image "reg-private:5000/team/orders-api:1.4.2": failed to pull and unpack image "reg-private:5000/team/orders-api:1.4.2": failed to resolve reference "reg-private:5000/team/orders-api:1.4.2": pull access denied, repository does not exist or may require authorization: authorization failed: no basic auth credentials

"No basic auth credentials" means the kubelet did not attach any credentials to the request. I got this message from three different mistakes:

  1. No imagePullSecrets at all on the pod or its ServiceAccount.
  2. The Secret name is wrong or the Secret is in another namespace. The kubelet warns about this in a separate event that is easy to miss because it is not called Failed:
    Code
    Warning  FailedToRetrieveImagePullSecret  15s (x9 over 106s)  kubelet  Unable to retrieve some image pull secrets (regcreds); attempting to pull the image may not succeed.
    The pod asked for regcreds; the Secret is called regcred. Image pull Secrets are namespaced. A Secret in default does nothing for a pod in shop.
  3. The Secret is for a different registry host. I created a Secret with --docker-server=registry.example.com and used it for an image on reg-private:5000. The kubelet only sends credentials whose server matches the image host, so it sent nothing. Decode the Secret to see which host it is for:
    Code
    $ kubectl get secret regcred-wronghost -n shop -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d | python3 -c 'import sys,json;print(list(json.load(sys.stdin)["auths"]))'
    ['registry.example.com']

Fix: create the Secret in the pod's namespace with the exact host from the image name, including the port:

Code
kubectl -n shop create secret docker-registry regcred \
  --docker-server=reg-private:5000 \
  --docker-username=deploy \
  --docker-password='...'

Then reference it from the pod spec, or, better, attach it to the ServiceAccount so every pod in the namespace gets it without anyone remembering:

Code
$ kubectl patch serviceaccount default -n shop -p '{"imagePullSecrets":[{"name":"regcred"}]}'
serviceaccount/default patched
$ kubectl get pod orders-nosecret -n shop -o jsonpath='{.spec.imagePullSecrets}'
[{"name":"regcred"}]
$ kubectl get pod orders-nosecret -n shop
NAME              READY   STATUS    RESTARTS   AGE
orders-nosecret   1/1     Running   0          31s

The ServiceAccount's secrets are copied into the pod when it is created. Existing pods are not changed, so delete the failing pod (or kubectl rollout restart the Deployment) after patching.

4. Credentials sent, but wrong or expired

Code
Failed to pull image "reg-private:5000/team/orders-api:1.4.2": failed to pull and unpack image "reg-private:5000/team/orders-api:1.4.2": failed to resolve reference "reg-private:5000/team/orders-api:1.4.2": unexpected status from HEAD request to http://reg-private:5000/v2/team/orders-api/manifests/1.4.2: 401 Unauthorized

This is my Friday deploy. The Secret existed and matched the host, but held the old password. Some registries answer 403 Forbidden instead when the credentials are valid but lack pull permission on that repository, for example a token scoped to one project used for another. Treat 401 as "who are you?" and 403 as "you can't have this one".

Confirm with crictl pull --creds on the node, as shown above, or with curl from anywhere:

Code
$ curl -s -o /dev/null -w "%{http_code}\n" -u deploy:Old-Pass-2025 http://reg-private:5000/v2/
401

Fix: update the Secret in place, then recreate the pods. The --dry-run=client -o yaml | kubectl apply pattern updates an existing Secret instead of failing with "already exists":

Code
$ kubectl -n shop create secret docker-registry regcred-old \
    --docker-server=reg-private:5000 --docker-username=deploy \
    --docker-password='S3cure-Pass' --dry-run=client -o yaml | kubectl apply -f -
secret/regcred-old configured
$ kubectl delete pod orders-oldpass -n shop && kubectl apply -f run4.yaml
$ kubectl get pod orders-oldpass -n shop
NAME             READY   STATUS    RESTARTS   AGE
orders-oldpass   1/1     Running   0          32s

Use a dedicated read-only robot account or deploy token for the cluster, not a person's password. When that person changes their password or leaves, the cluster should not stop deploying.

5. It works on one node and not another: the cached image trap

This one surprised me in the lab, and it explains a lot of "it was working yesterday" reports. After one pod had pulled orders-api:1.4.2 successfully, I started pods with no Secret, a wrong Secret name and a stale password. All of them went straight to Running:

Code
Normal  Pulled  ...  Container image "reg-private:5000/team/orders-api:1.4.2" already present on machine

With the default imagePullPolicy: IfNotPresent, a node that already has the image does not contact the registry, so credentials are never checked. The broken Secret only shows up when a pod lands on a fresh node, after the image is garbage-collected, or when the cluster autoscaler adds a node at 3 a.m. To test pull credentials honestly, force a pull with imagePullPolicy: Always or remove the image from the node first (crictl rmi <image>). That is how I reproduced cases 3 and 4.

From the Kubernetes documentation (not tested here): if this is a security concern for you, because a pod in one namespace can run an image another namespace pulled with its own credentials, the AlwaysPullImages admission plugin forces every pull to be authenticated. Newer releases are also adding a kubelet option to re-check credentials for cached images; check the image documentation for your version.

6. Wrong CPU architecture

Apple Silicon laptops build arm64 images by default. Most cloud nodes are amd64. If someone builds on their laptop and pushes, you get one of two different failures depending on how the image was pushed. I reproduced both.

If the tag is a multi-platform manifest list without an amd64 entry, the pull fails:

Code
Failed to pull image "reg-private:5000/team/report-worker:2.1": rpc error: code = NotFound desc = failed to pull and unpack image "reg-private:5000/team/report-worker:2.1": no match for platform in manifest: not found

If the tag is a plain single-architecture image, the runtime pulls it without complaint, and the container dies on start. This is the report-worker pod in CrashLoopBackOff from the first listing:

Code
$ kubectl logs report-worker -n shop --previous
exec /bin/sleep: exec format error
$ kubectl describe pod report-worker -n shop | grep -A3 'Last State'
    Last State:     Terminated
      Reason:       Error
      Exit Code:    255

Confirm which platforms a tag has:

Code
$ docker manifest inspect --insecure reg-private:5000/team/report-worker:2.1 | grep -A3 platform
         "platform": {
            "architecture": "arm64",
            "os": "linux",
            "variant": "v8"

Compare with the node: kubectl get nodes -L kubernetes.io/arch.

Fix: build for the platforms your nodes run, in CI rather than on laptops: docker buildx build --platform linux/amd64,linux/arm64 -t ... --push .. If you run mixed node pools on purpose, add a nodeSelector on kubernetes.io/arch so arm64-only images land on arm64 nodes. If the build itself fails, my Docker build failed guide covers the usual reasons.

7. TLS: the node does not trust the registry certificate

Code
Failed to pull image "reg-tls:443/team/orders-api:1.4.2": failed to pull and unpack image "reg-tls:443/team/orders-api:1.4.2": failed to resolve reference "reg-tls:443/team/orders-api:1.4.2": failed to do request: Head "https://reg-tls:443/v2/team/orders-api/manifests/1.4.2": tls: failed to verify certificate: x509: certificate signed by unknown authority

Internal registries (Harbor, Nexus, GitLab self-managed) often use a company CA. Your laptop trusts it because IT installed the CA there. The Kubernetes nodes are separate machines and usually do not.

Fix (tested, containerd 2.x): give containerd the CA for that registry host. On each node, create a directory named after the host and port, put the CA in it, and add a hosts.toml:

Code
$ cat /etc/containerd/certs.d/reg-tls:443/hosts.toml
server = "https://reg-tls:443"
[host."https://reg-tls:443"]
  capabilities = ["pull", "resolve"]
  ca = "/etc/containerd/certs.d/reg-tls:443/ca.crt"

This requires containerd's registry config_path to be set to /etc/containerd/certs.d, which I set in the kind cluster config and which many distributions set by default. containerd reads these files on each pull, so I did not need a restart. After deleting the pod:

Code
Normal  Pulled   Successfully pulled image "reg-tls:443/team/orders-api:1.4.2" in 10ms (10ms including waiting). Image size: 2276498 bytes.
Normal  Started  Started container api

Alternatives: add the CA to the node operating system's trust store and restart containerd, or put a publicly trusted certificate on the registry. Avoid skip_verify = true outside a lab; it turns off the check that stops someone serving you a different image. Plain-HTTP registries need the same hosts.toml file with an http:// server, as my lab registry on port 5000 did.

On managed clusters you cannot always edit node files. EKS, GKE and AKS each document a supported way to add a CA, usually a node bootstrap script or a DaemonSet; use that instead of SSHing into nodes that will be replaced.

8. DNS: the node cannot resolve the registry

Code
Failed to pull image "registry.internal.example:5000/team/orders-api:1.4.2": ... failed to do request: Head "https://registry.internal.example:5000/v2/team/orders-api/manifests/1.4.2": dial tcp: lookup registry.internal.example on 172.18.0.1:53: server misbehaving

The lookup is done by the node, using the node's /etc/resolv.conf, not by CoreDNS. That is a common misunderstanding: fixing cluster DNS does nothing for image pulls, because pulls happen before any pod network exists. server misbehaving means the resolver failed to answer; on a normal corporate network a name that does not exist gives no such host instead.

Confirm on the node: getent hosts registry.internal.example and cat /etc/resolv.conf. If it resolves on your laptop over VPN but not on the node, the node needs the internal DNS server or a split-DNS forwarder. In the lab, my registry names only resolved on the node after I added them to the node's own /etc/hosts; Kubernetes objects never came into it.

9. Network, firewall or proxy: i/o timeout

Code
Failed to pull image "10.255.255.1:5000/team/orders-api:1.4.2": rpc error: code = DeadlineExceeded desc = failed to pull and unpack image "10.255.255.1:5000/team/orders-api:1.4.2": failed to resolve reference "10.255.255.1:5000/team/orders-api:1.4.2": failed to do request: Head "https://10.255.255.1:5000/v2/team/orders-api/manifests/1.4.2": dial tcp 10.255.255.1:5000: i/o timeout

Name resolution worked (or there was nothing to resolve), but no TCP connection could be made. Causes: a security group or firewall without outbound 443 to the registry, a private cluster with no NAT gateway, or a corporate network where all traffic must go through an HTTP proxy.

A side effect I hit while testing: the kubelet pulls one image at a time by default (serializeImagePulls: true). While this pod was stuck waiting for its timeout, other pods on the same node sat in ContainerCreating with no events, including pods whose images were perfectly fine. If a whole node looks stuck on ContainerCreating, look for one pull that is timing out.

Confirm from the node: curl -sv https://<registry>/v2/. Any HTTP answer, even 401, means the network is fine. A hang means it is not.

Proxy fix (from the containerd and Kubernetes documentation, not tested here): the runtime does not read your shell's proxy variables. On systemd nodes, add a drop-in such as /etc/systemd/system/containerd.service.d/http-proxy.conf with Environment="HTTPS_PROXY=http://proxy:3128" and a NO_PROXY that includes the cluster's service and pod CIDRs and internal registry hosts, then systemctl daemon-reload && systemctl restart containerd. Forgetting NO_PROXY is how people break the internal registry while fixing the public one.

10. Docker Hub rate limits

I could not trigger the limit on purpose without abusing a shared service, so the error text here comes from Docker's documentation. When the limit is hit, the pull fails with HTTP 429 and a message beginning toomanyrequests: You have reached your pull rate limit (the exact wording has changed over the years; search the event for toomanyrequests).

What I could check is the limit itself. Docker Hub returns it in response headers. From the lab machine, anonymously, on 2 December 2026:

Code
$ TOKEN=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
$ curl -s --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep -i ratelimit
ratelimit-limit: 100;w=3600
ratelimit-remaining: 100;w=3600

w=3600 is the window in seconds. Anonymous limits are counted per source IP, and a whole cluster behind one NAT gateway shares one IP. That is why this tends to bite during a node scale-up or a big rollout, not on a single deploy.

Fix: authenticate pulls with a Docker Hub account through an image pull Secret for https://index.docker.io/v1/, run a pull-through cache (Harbor, a registry mirror, or your cloud's pull-through cache), or copy the base images you depend on into your own registry. In my lab the nodes had no direct internet access at all, so they pulled Docker Hub images through a local pull-through mirror; it is a two-line containerd config and also protects you from Docker Hub outages.

11. Cloud registries: ECR, Artifact Registry, ACR

I did not reproduce these; this section is based on the AWS, Google Cloud and Microsoft documentation. The errors look like cases 3 and 4 above (no basic auth credentials, 401, 403), but the fix is almost never a static Secret.

  • Amazon ECR. On EKS, nodes pull with their IAM role; the role needs ECR read permissions (the managed policy AmazonEC2ContainerRegistryReadOnly is the usual one). An image pull Secret built from aws ecr get-login-password works, but the token expires after 12 hours, which produces exactly the "worked this morning, 401 tonight" pattern. Outside EKS, use the kubelet ECR credential provider instead of a static token. Pulling across accounts also needs a repository policy in the account that owns the images.
  • Google Artifact Registry / GCR. GKE nodes pull with the node service account. A 403 usually means that account lacks the Artifact Registry Reader role on the repository's project. Pulling from a different project is the common case.
  • Azure Container Registry. Attach the registry to the cluster (az aks update --attach-acr) so the kubelet identity gets pull rights. az aks check-acr runs a connectivity and auth check from inside the cluster.

12. Pull policy pitfalls

ErrImageNeverPull. With imagePullPolicy: Never the kubelet only uses images already on the node:

Code
Warning  ErrImageNeverPull  Container image "busybox:1.37" is not present with pull policy of Never

This is right for kind or minikube when you load images by hand (kind load docker-image), and wrong everywhere else.

The :latest default. If you do not set a policy, Kubernetes chooses one from the tag. I checked with a server-side dry run:

Code
$ kubectl run latest-demo --image=nginx:latest --dry-run=server -o jsonpath='{.spec.containers[0].imagePullPolicy}'
Always
$ kubectl run tag-demo --image=nginx:1.27-alpine --dry-run=server -o jsonpath='{.spec.containers[0].imagePullPolicy}'
IfNotPresent

So :latest (or no tag) contacts the registry on every pod start and fails if the registry is down or rate-limited, while a fixed tag that is cached keeps working. Combine that with case 5 and you get clusters where some pods start and others do not, with the same Secret. Use immutable version tags or digests, and set the policy explicitly.

13. The node is out of disk

From the Kubernetes documentation and earlier incidents, not reproduced in this lab: if the pull fails during unpacking with no space left on device, the node's image filesystem is full. The kubelet garbage-collects unused images above a disk threshold, but large images and many tags can outrun it. Check df -h on the node and crictl images; my guide to Docker no space left on device covers clearing image and build cache safely.

Animated walkthrough of ImagePullBackOff fixes: scenes for tag not found, no credentials sent, 401 stale password, arm64 image on amd64 node, x509 private CA, and the final successful pull with the pod Running
Each error ending maps to one fix. All six scenes were reproduced in the lab.

A step-by-step decision flow

  1. Run kubectl describe pod <pod> and copy the full Failed to pull image message. If restarts are above 0, stop: the image pulled, and you are debugging a crash.
  2. Status is InvalidImageName or ErrImageNeverPull? Fix the image string or the pull policy. No registry involved.
  3. Message ends in not found? List the registry's tags. Wrong tag, missing push, or a private registry host without a dot or port being sent to Docker Hub.
  4. Message says pull access denied or no basic auth credentials? Check spelling, then check that an image pull Secret exists in the pod's namespace, is referenced by the pod or ServiceAccount, and has the same server as the image host. Look for a FailedToRetrieveImagePullSecret event.
  5. Message says 401 or 403? Test the credentials with crictl pull --creds or curl. Rotate the Secret or fix the token's scope. On cloud registries, check the node's IAM role or identity.
  6. Message says toomanyrequests or 429? Authenticate to Docker Hub or use a mirror.
  7. Message says no match for platform, or the pod pulls and dies with exec format error? Rebuild for the node's architecture.
  8. Message says x509? Give containerd the registry's CA on every node.
  9. Message says lookup or no such host? Fix DNS on the node, not in CoreDNS.
  10. Message says i/o timeout or connection refused? Check firewall, NAT and proxy from the node with curl.
  11. Pods in ContainerCreating with no events while another pod is pulling? Fix the stuck pull first; the kubelet pulls one image at a time.
  12. After the fix, recreate the pod or run kubectl rollout restart, then confirm with kubectl rollout status.

Prevention checklist

  • Deploy immutable version tags or digests, never :latest in production.
  • Have CI fail if the tag it deploys does not exist in the registry, and run kubectl rollout status --timeout after every deploy.
  • Attach image pull Secrets to the namespace's ServiceAccount, created by the same tooling that creates the namespace.
  • Use a robot account or deploy token for pulls, with read-only scope, and put its rotation date in the team calendar.
  • On cloud clusters, use node IAM roles or workload identity instead of static registry tokens.
  • Build multi-architecture images in CI with buildx; do not push from laptops.
  • Bake internal CA certificates and hosts.toml files into the node image or bootstrap, not into hand-edited nodes.
  • Run a pull-through cache for Docker Hub and other public registries.
  • After changing credentials, test with imagePullPolicy: Always or on a fresh node, so a cached image does not hide the problem.
  • Alert on pods stuck in ImagePullBackOff for more than a few minutes; many monitoring stacks expose the waiting reason as a metric.

Common mistakes I still catch in review

  • Deleting the pod and waiting. The new pod hits the same error, unless it lands on a node that has the image cached, which makes the problem look random.
  • Creating the image pull Secret in default and the workload in another namespace.
  • Setting --docker-server=docker.io or https://reg-private without the port, so the host does not match the image and nothing is sent.
  • Using a generic Secret with a .dockerconfigjson key instead of type kubernetes.io/dockerconfigjson created with kubectl create secret docker-registry.
  • Patching the ServiceAccount and expecting existing pods to pick it up. They do not; restart them.
  • Fixing CoreDNS for an image pull DNS error. Pulls use the node's resolver.
  • Pasting the CA certificate into the pod or a ConfigMap. The runtime on the node verifies TLS, not the container.
  • Assuming exec format error is an application bug. It is the wrong architecture.
  • Committing registry passwords in the manifest that creates the Secret. Use a secrets manager or sealed secrets.

Questions I get asked

How long does Kubernetes keep retrying an image pull?

Forever, as long as the pod exists. The wait between attempts grows with each failure and, per the Kubernetes documentation, is capped at five minutes. In the lab, describe showed 5 pull attempts and 12 back-off events in the first three and a half minutes. Fixing the cause is usually followed by a successful pull on the next attempt; delete the pod if you do not want to wait.

Why does the same image work on one node and fail on another?

Almost always the cached image. With IfNotPresent, a node that already has the image never asks the registry, so wrong credentials, a missing Secret, or a registry outage only affect nodes that do not have it yet. Mixed node architectures are the other common reason.

Do I need to restart pods after fixing the Secret?

The kubelet reads the Secret on each pull attempt, so a pod that is still in back-off will usually succeed on its next try. But if you added the Secret to a ServiceAccount, existing pods do not have it in their spec, and you must recreate them.

Can I use one image pull Secret for several registries?

Yes. A kubernetes.io/dockerconfigjson Secret can hold several entries under auths. You can also list several Secrets in imagePullSecrets. The kubelet picks the credentials whose server matches the image host.

What is the difference between ErrImagePull and ImagePullBackOff?

ErrImagePull is the status right after a pull attempt fails. ImagePullBackOff is the status while the kubelet waits before the next attempt. Same cause, different moment. The fix is the same.

How do I see which credentials a Secret contains without exposing them in logs?

Decode only the host list, as in case 3: kubectl get secret <name> -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d and print the keys of auths. Avoid pasting the full decoded JSON into tickets; it contains the password.

Why are my pods stuck in ContainerCreating with no error?

If another pod on the same node is in a slow or timing-out pull, the kubelet may be waiting for it, because image pulls are serialized by default. Fix or delete the stuck pull and the rest start. If nothing is pulling, look at volume mount or network plugin events instead.

Can I pull from a registry that only speaks HTTP?

Yes, but you must tell containerd on every node, with a hosts.toml that uses an http:// server, like the lab registry here. It is fine in a lab. In production, put TLS in front of it.


About the author. Muhammad Wilayat Shah is a senior full-stack engineer and team lead based in Islamabad, with 13+ years shipping ERP and SaaS products with Laravel, Node.js, React and Next.js on Linux, Docker and Kubernetes. He wrote this after one rotated registry password stalled a Friday release, and rebuilt every failure here on a test cluster before writing it down. More at wilayats.com/about.

Last reviewed: 2 December 2026

ShareLinkedInX
Back to blog

Keep reading

Fix Nginx 413 Request Entity Too Large Error

11/25/2026

Fix Nginx 413 Request Entity Too Large Error

Nginx 413 Request Entity Too Large means a body size limit was hit. Find which layer sent it, then fix client_max_body_size, PHP upload limits, Express and Kubernetes ingress.

Newsletter

Occasional notes on Laravel, React, and shipping production systems — no spam.

Comments

Join the discussion. Replies load on demand, up to 5 levels.

0 threads

Loading editor…
Reviewed before publishing

No comments yet

Be the first to start the conversation.