Challenge Easy Submissions: 0/0
Troubleshoot a Deployment Stuck in ImagePullBackOff
A Deployment pulls its image from a private container registry, and its Pods are stuck in ImagePullBackOff. Create a registry Secret and update the Deployment manifest to get the Pods running.
Scenario
The catalog Deployment in the shop namespace runs an image from the team's private container registry:
registry.iximiuz.com/shop/catalog:v1
The Deployment was applied without any registry credentials, and its Pods are stuck in ImagePullBackOff. From cplane-01:
kubectl get pods -n shop
NAME READY STATUS RESTARTS AGE
catalog-647b446c54-6l8bz 0/1 ImagePullBackOff 0 43s
catalog-647b446c54-jkmt5 0/1 ImagePullBackOff 0 43s
The team's registry credentials:
| Registry | Username | Password |
|---|---|---|
registry.iximiuz.com | shop-ci | Pull-Catal0g-2026 |
The manifests are on cplane-01:
/home/laborant/shop/
├── catalog-deployment.yaml # update this file
├── ingress.yaml # do not change
├── namespace.yaml # do not change
└── service.yaml # do not change
Task
Fix the ImagePullBackOff error of the catalog Pods:
- Create a Secret with these properties:
Property Value Name registry-credsNamespace shopType kubernetes.io/dockerconfigjsonContent The registry credentials above - Update the Deployment manifest
/home/laborant/shop/catalog-deployment.yamlso that its Pods pull the image with theregistry-credsSecret, and apply it.
When the Pods run, http://catalog.shop.local shows the catalog page.
Important
Keep the image registry.iximiuz.com/shop/catalog:v1 and its imagePullPolicy as they are. Do not change the Service or the Ingress.
Hint 1 | Why the Pods do not start
The Pod events say what goes wrong when the node tries to pull the image:
kubectl describe pod <pod-name> -n <namespace>
Hint 2 | Registry credentials in Kubernetes
kubectl create secret has a subcommand made for registry credentials. To find how a Pod refers to such a Secret, explore the Pod spec:
kubectl create secret --help
kubectl explain pod.spec