Kubernetes Deployment Rollbacks scenarios with ImagePullBackOff scenarios After Update
I'm experiencing a frustrating scenario with rolling back a deployment in Kubernetes. After updating my deployment to a new image version, I've attempted to roll back to the previous version due to some bugs that appeared in the new image. However, the rollback seems to be failing, and the pods are exploring in a `ImagePullBackOff` state. Here's what I have in my deployment configuration: ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app-container image: myregistry/my-app:v1.2.0 ports: - containerPort: 80 ``` When I try to rollback, I run the command: ```bash kubectl rollout undo deployment/my-app ``` The rollback reports success, but when I check the pods, they show the following message: ```bash kubectl get pods NAME READY STATUS RESTARTS AGE my-app-5c9f58c5b-5j7x4 0/1 ImagePullBackOff 0 1m ``` I've confirmed that the image tag `v1.2.0` exists in my Docker registry and is accessible. I also checked the image pull secrets, and they seem to be configured correctly. Where could the scenario lie? Is there something specific about how Kubernetes handles rollbacks that I might be overlooking? I'm running Kubernetes version 1.21.5. Additionally, when I describe the pod, I see the following behavior: ```bash kubectl describe pod my-app-5c9f58c5b-5j7x4 ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning Failed 1m (x6 over 1m) kubelet Failed to pull image "myregistry/my-app:v1.2.0": rpc behavior: code = Unknown desc = behavior response from daemon: manifest for myregistry/my-app:v1.2.0 not found: manifest unknown: Failed to fetch "myregistry/my-app:v1.2.0" ``` It seems like Kubernetes is unable to find the image, but I can see that it exists when I manually check in the Docker registry. What are the steps I should take to diagnose this scenario further? My development environment is macOS. Any ideas what could be causing this? Has anyone dealt with something similar?