Skip to main content

Troubleshooting ImagePullBackOff in Kubernetes

Diagnose ImagePullBackOff and ErrImagePull in Kubernetes: wrong image names, missing pull secrets, expired ECR tokens, network blocks, and rate limits.

52 Terms

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 imagePullSecret for 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.

flowchart TD A["kubectl describe pod"]:::slate B["Read the Failed to pull line"]:::blue C["Fix pull secret or token"]:::orange D["Fix image name or tag"]:::green E["Fix network or DNS"]:::purple F["Fix rate limit"]:::red A --> B B -->|"401 or 403"| C B -->|"manifest unknown"| D B -->|"timeout or DNS"| E B -->|"toomanyrequests"| F classDef slate fill:#475569,color:#ffffff classDef blue fill:#326CE5,color:#ffffff classDef orange fill:#F97316,color:#ffffff classDef green fill:#10B981,color:#ffffff classDef purple fill:#8B5CF6,color:#ffffff classDef red fill:#EF4444,color:#ffffff
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.

Bash
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 pushed

Detailed 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.

Bash
kubectl get pods -n production
# payments-api-6d8f9b-xkp2q 0/1 ImagePullBackOff 0
kubectl describe pod payments-api-6d8f9b-xkp2q -n production
TEXT
Events:
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: ImagePullBackOff

You can also list pull failures for the whole namespace:

Bash
kubectl get events -n production --field-selector reason=Failed --sort-by=.lastTimestamp
Step 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.

Bash
# AWS ECR
aws 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 environment
curl -s -u "$REGISTRY_USER:$REGISTRY_PASSWORD" \
https://registry.razorpay.in/v2/payments/payments-api/tags/list
Bash
# Correct the image and check what the Deployment now references
kubectl 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}'
Security

Avoid latest in 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.

Bash
# Read the password without leaving it in shell history
read -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=production

Reference the Secret in the pod spec:

YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: payments-api
namespace: production
spec:
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.0

To cover every pod in a namespace at once, attach the Secret to the default ServiceAccount instead:

Bash
kubectl patch serviceaccount default -n production \
-p '{"imagePullSecrets": [{"name": "razorpay-registry-secret"}]}'
Common Mistake

Creating the Secret in the wrong namespace, or copying ~/.docker/config.json on a laptop that stores credentials in the OS keychain. In that case the file holds no actual password and the Secret authenticates nothing. Use kubectl create secret docker-registry with 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.

Bash
# Confirm the node role can read ECR
aws iam list-attached-role-policies --role-name mumbai-prod-node-role

If the repository is in a different AWS account, the repository policy there must also allow the pulling account.

Remember

IRSA 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:

Bash
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.

Bash
# On the node (SSH or SSM): resolve, connect, then pull with the container runtime
nslookup registry.razorpay.in
curl -v https://registry.razorpay.in/v2/
sudo crictl pull registry.razorpay.in/payments/payments-api:v2.1.0
Bash
HTTP/2 401 <- reachable (an auth error is fine here, the network works)
curl: (6) Could not resolve host <- DNS failure
curl: (28) Operation timed out <- network path blocked

If 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.

Bash
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 <- exhausted
kubectl delete pod ratelimit-test -n production

Two fixes, in order of strength:

  1. Authenticate pulls: create a pull secret from a Docker Hub access token, which gives a higher per-account limit.
  2. Mirror images (permanent): copy the images you depend on into your own registry and deploy from there. Use crane copy or skopeo copy so multi-architecture manifests are preserved. A plain docker pull, tag, push copies only your local platform. ECR pull-through cache can also mirror upstream registries automatically.
Bash
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.4
Step 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.

Bash
# 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/arch

Fix 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.

Bash
kubectl rollout restart deployment/payments-api -n production
kubectl 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 running
kubectl 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 ImagePullBackOff and 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 imagePullPolicy deliberately. With a pinned tag, IfNotPresent avoids needless registry traffic and rate-limit exposure.
Common Mistake

Deleting 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

Resources

Velero vs etcd Snapshot: Which Do You Need?

Velero vs etcd Snapshot: Which Do You Need?

Velero and etcd snapshots protect different layers of a Kubernetes cluster. See what each backs up, what each misses, and why most DR needs both.

11 min read•Aug 2026
Istio Ambient vs Linkerd in 2026: Which Mesh?

Istio Ambient vs Linkerd in 2026: Which Mesh?

Istio Ambient cuts the sidecar tax at L4, but L7 adds waypoint hops, and Linkerd stable builds now come from Buoyant. Choose with tests.

11 min read•Aug 2026
Nginx Ingress vs Traefik vs Gateway API in 2026

Nginx Ingress vs Traefik vs Gateway API in 2026

Ingress-NGINX is retired. Compare Traefik and Gateway API controllers as replacements, plus a safe migration plan that avoids outages.

10 min read•Aug 2026
OPA Gatekeeper vs Kyverno: Policy Engine in 2026

OPA Gatekeeper vs Kyverno: Policy Engine in 2026

OPA Gatekeeper vs Kyverno compared for 2026: Rego vs YAML, mutation, reporting, and operations, plus how to pick a Kubernetes policy engine.

10 min read•Aug 2026
Helm vs Kustomize in 2026: Templating vs Patching

Helm vs Kustomize in 2026: Templating vs Patching

Helm vs Kustomize compared for 2026 - templating vs patching, Helm 4's new features, and why most production teams end up running both.

5 min read•Aug 2026
Prometheus vs Datadog vs New Relic: Real Costs

Prometheus vs Datadog vs New Relic: Real Costs

Prometheus, Datadog, and New Relic compared for 2026 - real pricing at scale, hidden cost drivers, and which fits a Kubernetes-heavy stack.

5 min read•Aug 2026
Cluster Autoscaler vs Karpenter for EKS in 2026

Cluster Autoscaler vs Karpenter for EKS in 2026

Cluster Autoscaler vs Karpenter on EKS: scale-up speed, bin-packing, Spot handling, Auto Mode limits and a safe migration path, with v1 NodePool YAML.

11 min read•Aug 2026
GKE vs EKS vs AKS in 2026: Which Fits Your Team?

GKE vs EKS vs AKS in 2026: Which Fits Your Team?

GKE, EKS, and AKS compared for 2026 - control plane pricing, Autopilot vs Karpenter vs Node Auto Provisioning, and which platform actually fits your team.

5 min read•Aug 2026
K3s vs K8s vs MicroK8s: Which Distro in 2026?

K3s vs K8s vs MicroK8s: Which Distro in 2026?

Compare K3s, upstream Kubernetes and MicroK8s on footprint, datastores, HA and updates, and pick the right fit for edge, dev or production.

10 min read•Aug 2026
Canary Deployments with Argo Rollouts & Flagger

Canary Deployments with Argo Rollouts & Flagger

Ship to 5% of users first and auto-rollback on bad metrics: canary deployments on Kubernetes with Argo Rollouts, Flagger, and Gateway API.

11 min read•Jun 2026
OpenTelemetry Explained: Metrics, Logs, Traces

OpenTelemetry Explained: Metrics, Logs, Traces

OpenTelemetry in practice: instrument a Node.js service, run a production Collector, sample traces and link metrics, logs and traces in Grafana.

11 min read•Jun 2026
Kubernetes Cost Optimization Without SLO Risk

Kubernetes Cost Optimization Without SLO Risk

Kubernetes clusters average about 8% CPU use. Cut waste safely with request rightsizing, autoscaling, spot, and OpenCost, keeping SLOs.

11 min read•Jun 2026
ArgoCD vs FluxCD: GitOps for Kubernetes in 2026

ArgoCD vs FluxCD: GitOps for Kubernetes in 2026

ArgoCD vs FluxCD compared for 2026: UI, multi-tenancy, Helm, image automation and pruning risks, with a clear guide to picking your GitOps engine.

10 min read•Jun 2026

Explore More in Kubernetes Observability and Scaling

All 4 Topics

Frequently Asked Questions

Is Troubleshooting ImagePullBackOff in Kubernetes free to learn on DevOps Network?

Yes - this topic, like everything on DevOps Network, is 100% free with no paywall or sign-up gate.

What does the Troubleshooting ImagePullBackOff in Kubernetes topic cover?

Diagnose ImagePullBackOff and ErrImagePull in Kubernetes: wrong image names, missing pull secrets, expired ECR tokens, network blocks, and rate limits.

Found a mistake, an outdated step or a broken link?