⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Kubernetes Interview Questions Scenario 82 of 207 in Kubernetes
Junior / Associate DevOps [L1] Kubernetes Advanced Scenarios Core Fundamentals [L1]
🎯 Target Role / Context: Kubernetes Scenario #71 (L1) · Advanced Scenarios

Q: Pod shows `ErrImagePull`.

Image not found or wrong tag. Check image name/tag. For private registry, ensure imagePullSecret is configured.

#Kubernetes #Advanced Scenarios #L1 #Container Orchestration #K8s
🎙️ Candidate Opening & Architectural Context
"A pod that shows <strong>ErrImagePull</strong> means the kubelet tried to pull the container image and failed; after retries the status flips to <code>ImagePullBackOff</code>, which is the same problem with an exponential delay (up to 5 minutes). The fix is always in the event message: wrong name or tag, missing credentials, registry rate limit, network or DNS trouble. Interviewers ask this to see if you start from <code>kubectl describe pod</code> rather than guessing."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: A pod that shows <strong>ErrImagePull</strong> means the kubelet tried to pull the container image and failed; after retries the status flips to <code>ImagePullBackOff</code>, which is the same problem with an exponential delay (up to 5 minutes). The fix is always in the event message: wrong name or tag, missing credentials, registry rate limit, network or DNS trouble. Interviewers ask this to see if you start from <code>kubectl describe pod</code> rather than guessing.

1️⃣

Read the exact ErrImagePull error first

The Events section names the failing image and the registry's reason.

kubectl describe pod my-app-6f7d9-abcde -n prod | sed -n '/Events:/,$p'
# Failed to pull image "registry.example.com/my-app:1.4.O":
#   rpc error: code = NotFound ... not found
kubectl get pod my-app-6f7d9-abcde -n prod \
  -o jsonpath='{.spec.containers[*].image}{"\n"}'
  • Describe: kubectl describe pod <pod> -n prod and read the last Failed events.
  • Typical messages: manifest unknown or not found (bad tag), unauthorized or pull access denied (credentials), toomanyrequests (rate limit), no such host or timeout (DNS or network).
  • Namespace events: kubectl get events -n prod --sort-by=.lastTimestamp.
  • Spec image: confirm the image string in the pod spec, not in your Git repo.
2️⃣

Fix credentials with imagePullSecrets

Private registries need a Secret of type kubernetes.io/dockerconfigjson in the pod's namespace.

kubectl create secret docker-registry regcred -n prod \
  --docker-server=registry.example.com \
  --docker-username=ci-bot --docker-password="$REGISTRY_TOKEN"

kubectl patch serviceaccount default -n prod \
  -p '{"imagePullSecrets":[{"name":"regcred"}]}'
kubectl rollout restart deploy/my-app -n prod
  • Create the Secret: kubectl create secret docker-registry with registry server, user and token.
  • Reference it: add imagePullSecrets to the pod spec or patch the ServiceAccount so all pods in the namespace use it.
  • Namespace scope: Secrets do not cross namespaces; create one per namespace.
  • Cloud registries: ECR tokens expire after 12 hours, so use node IAM roles, kubelet credential providers or a refresh job.
Advertisement
3️⃣

Verify from the node, not only the API

Reproduce the pull exactly where the kubelet runs.

kubectl get pod my-app-6f7d9-abcde -n prod -o wide
# on the node:
sudo crictl pull registry.example.com/my-app:1.4.0
getent hosts registry.example.com
docker manifest inspect registry.example.com/my-app:1.4.0 >/dev/null && echo exists
  • Which node: kubectl get pod -o wide shows the node.
  • CRI pull: on a containerd node run crictl pull <image> to see the registry response.
  • DNS and egress: check the node resolves and reaches the registry (proxy, firewall, NAT, VPC endpoint).
  • Image exists: query the registry for the tag directly, for example crane manifest or docker manifest inspect.
4️⃣

Less obvious causes

When the name and credentials look right:

  • Rate limits: anonymous Docker Hub pulls are limited per IP; authenticate or use a registry mirror or pull-through cache.
  • Architecture: a no matching manifest for linux/arm64 message means the image lacks that platform, common on mixed Graviton and x86 clusters.
  • Digest pins and tags: a tag deleted by a retention policy returns not found though it worked yesterday.
  • Policy: imagePullPolicy: Always forces a registry contact on every start; a registry outage then blocks restarts.
  • TLS: private CAs must be trusted by the container runtime on every node.
5️⃣

Production practice: prevent pull failures

Treat image delivery as a dependency.

  • Pin versions: deploy immutable tags or digests built by CI; never rely on latest.
  • Pre-flight: CI verifies the tag exists in the registry before applying manifests.
  • Mirror: use a pull-through cache or in-region registry for resilience and speed.
  • Alert: alert on pods in ImagePullBackOff via kube-state-metrics kube_pod_container_status_waiting_reason.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Run <code>crictl pull</code> on the node that hosts the pod, since it reproduces the kubelet's exact credentials, DNS and network path in seconds."
⚡ 60-Second Elevator Pitch Talking Points
  • ErrImagePull means the kubelet failed to pull the image; ImagePullBackOff is the same failure being retried with backoff.
  • I read <code>kubectl describe pod</code> events, then confirm the tag, credentials and reachability, testing with <code>crictl pull</code> on the node.
  • I prevent it with pinned tags, a CI tag-exists check, pull-through caching and an alert on waiting reason.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Treating ImagePullBackOff as a different problem from ErrImagePull It is the same pull failure with a growing retry delay; the cause is in the original event.
  2. Creating the pull secret in the wrong namespace imagePullSecrets are namespaced; a secret in default does nothing for pods in prod.
  3. Debugging only from your laptop Your workstation has different credentials, DNS and network than the node; reproduce on the node.
  4. Ignoring architecture mismatch A single-platform image fails on nodes of another CPU architecture with a manifest error, not an auth error.
Advertisement
📥 FREE DOWNLOAD · 101-PAGE COMPANION HANDBOOK
Studying for Kubernetes & SRE Technical Rounds?
Download the complete 100-question PDF field guide covering all 11 core modules with offline diagnostic runbooks.
📥 Download PDF (Free) Read Online Guide →
Want more Kubernetes scenarios?
Explore our complete collection of scenario-based Kubernetes interview runbooks.
Browse All Kubernetes Questions →