Challenge Easy

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:

RegistryUsernamePassword
registry.iximiuz.comshop-ciPull-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:

  1. Create a Secret with these properties:
    PropertyValue
    Nameregistry-creds
    Namespaceshop
    Typekubernetes.io/dockerconfigjson
    ContentThe registry credentials above
  2. Update the Deployment manifest /home/laborant/shop/catalog-deployment.yaml so that its Pods pull the image with the registry-creds Secret, 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

⚒ Test Cases