
While deploying an application to Kubernetes, one of our pods went into a ImagePullBackOff state.
kubectl get podsNAME READY STATUS RESTARTS AGEmyapp-deployment-7f6b9c9f 0/1 ImagePullBackOff 0 5m
Failed to pull image "myacr.azurecr.io/myapp:latest":rpc error: code = Unknown desc = Error response from daemon:manifest for myacr.azurecr.io/myapp:latest not found
The issue was that Kubernetes could not authenticate with Azure Container Registry (ACR) to pull the private image.
We fixed it by creating an image pull secret in Kubernetes and linking it to the service account used by the deployment.
Run the following command:
kubectl create secret docker-registry acr-auth \--docker-server=myacr.azurecr.io \--docker-username=<ACR-USERNAME> \--docker-password=<ACR-PASSWORD> \--docker-email=<YOUR-EMAIL>
<ACR-USERNAME> and <ACR-PASSWORD> → credentials from Azure Portal or az acr credential showCreate a service account and reference the secret:
apiVersion: v1kind: ServiceAccountmetadata:name: acr-service-accountsecrets:- name: acr-auth
Update your deployment YAML:
apiVersion: apps/v1kind: Deploymentmetadata:name: myapp-deploymentspec:replicas: 1selector:matchLabels:app: myapptemplate:metadata:labels:app: myappspec:serviceAccountName: acr-service-accountcontainers:- name: myappimage: myacr.azurecr.io/myapp:latestports:- containerPort: 8080
Apply the changes:
kubectl apply -f deployment.yaml
Check pod status:
kubectl get podsNAME READY STATUS RESTARTS AGEmyapp-deployment-7f6b9c9f 1/1 Running 0 2m
Now the pod runs successfully 🎉
By properly configuring image pull secrets, we made our Kubernetes deployment stable and secure when using Azure Container Registry. 🚀
Thank you for reading our comprehensive guide on "Fixing ImagePullBackOff in Kubernetes with Azure Container Registry (ACR)" We hope you found it insightful and valuable. If you have any questions, need further assistance, or are looking for expert support in developing and managing your projects. our team is here to help!
Reach out to us for Your Project Needs:
🌐 Website: https://www.prometheanz.com
📧 Email: [email protected]
Copyright © 2025 PrometheanTech. All Rights Reserved.