ImagePullBackOff unauthorized authentication required
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
ImagePullBackOff with an unauthorized error means Kubernetes reached the registry but could not authenticate to pull the image. The pod keeps retrying with increasing delay, so deployments stall until credentials or permissions are fixed. This guide walks through diagnosis and a reliable fix path.
Core Topic Sections
Confirm the exact failure reason
Start with pod events, not assumptions. ImagePullBackOff is the state, while the event message reveals the root cause.
Look for messages like unauthorized: authentication required, denied, or pull access denied. If the event mentions not found, the problem is likely a bad image name instead of auth.
Validate image reference format
Many auth incidents are actually reference mistakes:
- Wrong registry host.
- Wrong repository path.
- Missing namespace.
- Wrong tag.
A safe check is to test pull locally with the same full image string used in the manifest.
If this fails with unauthorized, fix credentials first. If it fails with not found, fix image naming.
Create and attach an image pull secret
For private registries, create a docker-registry secret and attach it to the workload.
Then reference it from the pod template:
Apply and watch rollout:
Attach secret to a service account for reuse
If many workloads in one namespace use the same registry, bind the secret once on a service account.
Then use that service account in deployments. This removes repeated secret blocks and reduces copy-paste drift.
Handle cloud registry specifics
Managed registries often use short-lived tokens:
- Amazon ECR tokens expire and must be rotated.
- Google Artifact Registry relies on IAM plus helper auth.
- Azure Container Registry may use managed identity or admin credentials.
When tokens rotate, regenerate Kubernetes secret and restart affected workloads.
Verify RBAC and network policy
Even valid credentials can fail if nodes or runtime cannot reach the registry endpoint. Confirm:
- Egress rules allow registry host and port.
- Cluster DNS resolves registry host.
- Node runtime trusts required certificates.
Auth and connectivity issues often appear together during infrastructure changes.
Operational hardening
Treat pull credentials like application secrets:
- Store source credentials in a secret manager.
- Automate periodic rotation.
- Use least privilege repository access.
- Alert on repeated pull failures.
This keeps deployments resilient during key rollover and environment rebuilds.
Common Pitfalls
- Creating the secret in one namespace and deploying the pod in another namespace.
- Using a valid secret name but forgetting to reference it in the pod spec.
- Rotating registry credentials without updating Kubernetes secrets.
- Troubleshooting auth before validating image name and tag correctness.
- Assuming the issue is credentials when egress or DNS blocks registry access.
Summary
ImagePullBackOffwith unauthorized means registry auth failed during pull.- Diagnose from pod events first to separate auth from name errors.
- Create correct image pull secrets and attach them to workloads or service accounts.
- Account for cloud registry token expiration and automate secret rotation.
- Validate network reachability and DNS so auth fixes can actually succeed.
Related reading
- ImagePullSecrets GCR
- Import data to config map from kubernetes secret
- In Kubernetes, how can i have an access mode to allow one pod at a time to write and many pods to read only?
- In Kubernetes, how to setup multiple hosts in one ingress with let''s encrypt certificates
- Import broker definitions into Dockerized RabbitMQ
- Import data.sql MySQL Docker Container
- Implement exclusive access to an EFS/NFS directory
- Implementing Licencing mechanism for a Software

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.