Overview and What You Will Learn
ImagePullBackOff means the kubelet on a node could not download a container image and is now waiting before it retries. The first failed attempt shows as ErrImagePull, and the retries show as ImagePullBackOff, with a delay that grows from 10 seconds up to a 5 minute cap. Both statuses share the same root cause, which is written in the pod's Events.
The fix depends entirely on that message. A wrong tag, a missing credential, an expired token, a blocked network, a rate limit, and a CPU architecture mismatch all end in the same status.
By the end of this guide you will be able to:
- Read the pod Events to identify the real cause in under a minute
- Fix wrong image names, tags, and mutable-tag mistakes
- Create and attach an
imagePullSecretfor a private registry - Explain why EKS nodes pull from ECR without any secret, and fix expired ECR credentials elsewhere
- Test registry connectivity from the node, and handle Docker Hub rate limits
- Spot architecture and certificate errors that look like pull failures
Why This Matters in Production
An image pull failure blocks a rollout without taking the service down, which makes it easy to miss. During a rolling update the old pods keep running while the new ones sit in ImagePullBackOff, so traffic keeps flowing and no error-rate alert fires. The release simply never completes.
Typical triggers are an expired registry credential after a rotation, a typo in a tag from a CI pipeline, or a shared NAT address that hits a public registry's rate limit. Teams at companies such as Razorpay or Stripe watch rollout status and pod phase, not just error rates, for exactly this reason.
Core Principles
Always start from the pod Events, then match the message to a cause. The status alone is not enough.
| Message in Events | Likely Cause | Where to Fix |
|---|---|---|
manifest unknown, not found |
Wrong name or tag | Step 2 |
401 Unauthorized, pull access denied |
Missing or wrong pull secret | Step 3 |
401 on ECR, worked before |
Expired token | Step 4 |
i/o timeout, no such host |
Network or DNS | Step 5 |
toomanyrequests |
Registry rate limit | Step 6 |
no match for platform in manifest |
CPU architecture mismatch | Step 7 |
x509: certificate signed by unknown authority |
Registry CA not trusted | Step 7 |
An image reference has the form registry/repository:tag. With no registry prefix, Kubernetes pulls from Docker Hub, and with no tag it assumes latest.
my-app:v2 -> docker.io/library/my-app:v2 (Docker Hub)registry.razorpay.in/my-app -> tag defaults to "latest"registry.razorpay.in/my-app:v2.0.0 -> fails if that tag was never pushedDetailed Step-by-Step Practical Lab
Step 1 - Read the Exact Error From the Pod Events
kubectl describe pod shows the failure reason in its Events section. Do this before changing anything.
kubectl get pods -n production # payments-api-6d8f9b-xkp2q 0/1 ImagePullBackOff 0 kubectl describe pod payments-api-6d8f9b-xkp2q -n productionEvents: Warning Failed kubelet Failed to pull image "registry.razorpay.in/payments-api:v2.1.0": failed to pull and unpack image: unexpected status code 401 Unauthorized Warning Failed kubelet Error: ErrImagePull Normal BackOff kubelet Back-off pulling image "registry.razorpay.in/payments-api:v2.1.0" Warning Failed kubelet Error: ImagePullBackOffYou can also list pull failures for the whole namespace:
kubectl get events -n production --field-selector reason=Failed --sort-by=.lastTimestampStep 2 - Fix a Wrong Image Name or Tag
A manifest unknown or not found error means the registry has no image at that name and tag. Check which tags really exist, then correct the reference.
# AWS ECRaws ecr describe-images \ --repository-name payments-api \ --region ap-south-1 \ --query 'imageDetails[*].imageTags' \ --output table # Registry v2 API (for example Harbor), using a robot account from the environmentcurl -s -u "$REGISTRY_USER:$REGISTRY_PASSWORD" \ https://registry.razorpay.in/v2/payments/payments-api/tags/list# Correct the image and check what the Deployment now referenceskubectl set image deployment/payments-api \ payments-api=registry.razorpay.in/payments/payments-api:v2.1.0 -n production kubectl get deployment payments-api -n production \ -o jsonpath='{.spec.template.spec.containers[0].image}'SecurityAvoid
latestin production. The tag is mutable, so the registry can swap the image underneath you and two nodes can run different code. Pin to a version tag, or better to a digest such as@sha256:....
Step 3 - Create and Attach an imagePullSecret
A 401 Unauthorized or 403 Forbidden from a private registry means the node had no valid credentials. Create a docker-registry Secret in the same namespace as the pod, since Secrets are namespaced.
# Read the password without leaving it in shell historyread -s -p "Registry password: " REGISTRY_PASSWORD; echo kubectl create secret docker-registry razorpay-registry-secret \ --docker-server=registry.razorpay.in \ --docker-username=deploy-bot \ --docker-password="$REGISTRY_PASSWORD" \ --namespace=productionReference the Secret in the pod spec:
apiVersion: apps/v1kind: Deploymentmetadata: name: payments-api namespace: productionspec: selector: matchLabels: app: payments-api template: metadata: labels: app: payments-api spec: imagePullSecrets: - name: razorpay-registry-secret containers: - name: payments-api image: registry.razorpay.in/payments/payments-api:v2.1.0To cover every pod in a namespace at once, attach the Secret to the default ServiceAccount instead:
kubectl patch serviceaccount default -n production \ -p '{"imagePullSecrets": [{"name": "razorpay-registry-secret"}]}'Common MistakeCreating the Secret in the wrong namespace, or copying
~/.docker/config.jsonon a laptop that stores credentials in the OS keychain. In that case the file holds no actual password and the Secret authenticates nothing. Usekubectl create secret docker-registrywith explicit values instead.
Step 4 - Handle ECR Authentication
ECR login tokens last 12 hours, so a Secret built from aws ecr get-login-password stops working the next day. On EKS you usually do not need a Secret at all: the kubelet pulls using the node's IAM role. Attach the AmazonEC2ContainerRegistryReadOnly policy, or an equivalent scoped to your repositories, to the node role. Fargate uses the pod execution role the same way.
# Confirm the node role can read ECRaws iam list-attached-role-policies --role-name mumbai-prod-node-roleIf the repository is in a different AWS account, the repository policy there must also allow the pulling account.
RememberIRSA and EKS Pod Identity give credentials to your application pods, not to the kubelet that pulls images. They do not fix image pulls. Image pulls use the node role.
Outside EKS, the best option is the kubelet image credential provider with the ECR plugin, which fetches fresh tokens automatically. As a stopgap, you can refresh a Secret by hand. This also shows the safe way to replace a Secret in place:
kubectl create secret docker-registry ecr-registry-secret \ --docker-server=123456789012.dkr.ecr.ap-south-1.amazonaws.com \ --docker-username=AWS \ --docker-password="$(aws ecr get-login-password --region ap-south-1)" \ --namespace=production \ --dry-run=client -o yaml | kubectl apply -f -Step 5 - Test Network Access to the Registry
i/o timeout or no such host means the node cannot reach the registry. The kubelet pulls through the node's own network and DNS, not through CoreDNS, so test from the node. A test pod can give a different answer.
# On the node (SSH or SSM): resolve, connect, then pull with the container runtimenslookup registry.razorpay.incurl -v https://registry.razorpay.in/v2/sudo crictl pull registry.razorpay.in/payments/payments-api:v2.1.0HTTP/2 401 <- reachable (an auth error is fine here, the network works)curl: (6) Could not resolve host <- DNS failurecurl: (28) Operation timed out <- network path blockedIf the connection times out, check the node security group for outbound HTTPS, route tables and NAT for private subnets, and any proxy or VPC endpoint the registry requires. For ECR from private subnets, the VPC needs endpoints for ecr.api, ecr.dkr, and an S3 gateway endpoint, since image layers are stored in S3.
Step 6 - Handle Docker Hub Rate Limits
A toomanyrequests error means the registry has throttled your source IP or account. Many nodes behind one NAT gateway share a single public IP, so they exhaust an anonymous limit quickly. Limits change over time, so check Docker's current published numbers.
kubectl run ratelimit-test --image=nicolaka/netshoot --restart=Never -n production \ --command -- sh -c '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' kubectl logs ratelimit-test -n production# ratelimit-limit: 100;w=21600# ratelimit-remaining: 0;w=21600 <- exhaustedkubectl delete pod ratelimit-test -n productionTwo fixes, in order of strength:
- Authenticate pulls: create a pull secret from a Docker Hub access token, which gives a higher per-account limit.
- Mirror images (permanent): copy the images you depend on into your own registry and deploy from there. Use
crane copyorskopeo copyso multi-architecture manifests are preserved. A plaindocker pull,tag,pushcopies only your local platform. ECR pull-through cache can also mirror upstream registries automatically.
kubectl create secret docker-registry dockerhub-secret \ --docker-server=https://index.docker.io/v1/ \ --docker-username=razorpay-devops \ --docker-password="$DOCKERHUB_TOKEN" \ --namespace=production crane copy postgres:15.4 123456789012.dkr.ecr.ap-south-1.amazonaws.com/postgres:15.4Step 7 - Check for Architecture and Certificate Errors
Two causes look like pull failures but need different fixes. no match for platform in manifest means the image has no build for the node's CPU, which is common when arm64 Graviton nodes pull an amd64-only image, or the reverse.
# Which platforms does the image support?docker buildx imagetools inspect registry.razorpay.in/payments/payments-api:v2.1.0 # Which architecture are the nodes?kubectl get nodes -L kubernetes.io/archFix it by building a multi-architecture image, or pin the workload to matching nodes with nodeSelector: kubernetes.io/arch: amd64.
An x509: certificate signed by unknown authority error means the node does not trust the registry's certificate, typically a private CA. Install the CA in the node's trust store or configure the container runtime's registry host settings, rather than disabling verification.
Step 8 - Verify the Pull Succeeded
After the fix, force a new pod and confirm the image pulled. Restarting before the root cause is fixed only repeats the failure.
kubectl rollout restart deployment/payments-api -n productionkubectl get pods -n production -w# payments-api-7f8g9h-mn3lp 0/1 ContainerCreating 0 5s# payments-api-7f8g9h-mn3lp 1/1 Running 0 18s kubectl describe pod payments-api-7f8g9h-mn3lp -n production | grep -A6 Events# Normal Pulling kubelet Pulling image "registry.razorpay.in/payments/payments-api:v2.1.0"# Normal Pulled kubelet Successfully pulled image in 4.821s# Normal Started kubelet Started container payments-api # Record the exact digest that is runningkubectl get pod payments-api-7f8g9h-mn3lp -n production \ -o jsonpath='{.status.containerStatuses[0].imageID}'# registry.razorpay.in/payments/payments-api@sha256:abc123def456...Production Best Practices & Common Pitfalls
- Mirror public images. Docker Hub, Quay, and GHCR have rate limits, outages, and removed images. Production should pull only from your own registry.
- Deploy by digest. In GitOps manifests, reference
@sha256:...so a re-pushed tag cannot change what runs. - Prefer role-based registry access. Use the node role or a credential provider so no long-lived secret exists to expire.
- Automate rotation for static credentials. If you must use a pull secret, rotate it from CI or a controller, never by memory.
- Alert on stuck rollouts. Watch for pods in
ImagePullBackOffand for Deployments whose available replicas lag the desired count, since error rates will not show it. - Test the pull in isolation.
kubectl run pulltest --image=<image> --restart=Never -n <ns>separates a pull problem from the rest of the Deployment spec. - Set
imagePullPolicydeliberately. With a pinned tag,IfNotPresentavoids needless registry traffic and rate-limit exposure.
Common MistakeDeleting pods to force a retry. The new pod fails the same way until the cause is fixed, and you lose the Events that explained it.
Quick Reference & Troubleshooting Commands
| Command | Purpose |
|---|---|
kubectl describe pod <name> -n <ns> |
Read Events for the exact error |
kubectl get events -n <ns> --field-selector reason=Failed |
List pull failures |
kubectl get secret <name> -n <ns> -o yaml |
Inspect a pull secret |
kubectl create secret docker-registry <name> ... |
Create a registry pull secret |
kubectl patch serviceaccount default -n <ns> -p '...' |
Attach a pull secret to all pods |
kubectl set image deployment/<name> <c>=<image> |
Correct an image reference |
kubectl get nodes -L kubernetes.io/arch |
Check node CPU architecture |
sudo crictl pull <image> |
Test a pull directly on a node |
aws ecr get-login-password --region <region> |
Generate an ECR token |
| Symptom | Likely Cause | Fix |
|---|---|---|
manifest unknown |
Tag not pushed | List tags and correct the reference |
401 right after secret creation |
Secret in wrong namespace | Create it where the pod runs |
401 on ECR after a day |
Static token expired | Use node role or a credential provider |
i/o timeout |
Egress or endpoint blocked | Open 443, add VPC endpoints |
toomanyrequests |
Shared IP hit the limit | Authenticate or mirror images |
no match for platform |
Wrong CPU architecture | Build multi-arch or use nodeSelector |