Prompt
How do I troubleshoot a failed rolling update in Kubernetes?
Latest observation
Here’s a practical way to troubleshoot a failed Kubernetes rolling update.
1) Check the rollout status first
kubectl rollout status deployment/<deployment-name>
kubectl get deployment <deployment-name>
kubectl describe deployment <deployment-name>
Look for:
ProgressDeadlineExceededReplicaSetnot scaling up/downUnavailableorAvailableconditionsEventsat the bottom ofdescribe
2) Inspect ReplicaSets and Pods
Rolling updates create new ReplicaSets, so check what happened there:
kubectl get rs
kubectl describe rs <replicaset-name>
kubectl get pods -o wide
kubectl describe pod <pod-name>
Common signs:
- Pods stuck in
Pending - CrashLoopBackOff
- ImagePullBackOff
- Readiness probe failures
- Scheduling failures due to resource limits or node selectors
3) Check pod logs
If the new pods are crashing or failing readiness:
kubectl logs <pod-name>
kubectl logs <pod-name> --previous
If there are multiple containers:
kubectl logs <pod-name> -c <container-name>
4) Verify readiness/liveness probes
A bad probe is one of the most common causes of failed rollouts.
Check:
- Correct path/port
- Adequate initial delay
- Timeout and failure thresholds
- App actually starts before probe begins
Example:
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
If readiness never succeeds, Kubernetes will not route traffic to the new pods and the rollout may stall.
5) Look for resource or scheduling issues
If pods stay pending:
kubectl describe pod <pod-name>
Look for messages like:
Insufficient cpuInsufficient memorynode(s) didn't match node selector- taints/tolerations issues
- volume mount problems
Also check:
kubectl get events --sort-by=.metadata.creationTimestamp
6) Confirm the new image is valid
Check whether the deployment references the expected image tag/digest:
kubectl get deployment <deployment-name> -o yaml | grep image
Common issues:
- typo in image name or tag
- image not pushed to registry
- image pull secrets missing
- tag reused and not actually updated
Prefer immutable tags or image digests for safer rollouts.
7) Check rollout strategy settings
Your deployment strategy may be too strict.
kubectl get deployment <deployment-name> -o yaml
Inspect:
maxUnavailablemaxSurgeminReadySecondsprogressDeadlineSeconds
Example issue:
- If
maxUnavailable: 0and new pods never become ready, rollout can stall completely. - If
minReadySecondsis too high, rollout may appear slow or fail progress deadline.
8) Compare old and new pod specs
Sometimes the new ReplicaSet differs from the old one in a subtle way:
- env vars
- ConfigMap/Secret names
- command/args
- ports
- securityContext
- volume mounts
You can compare:
kubectl describe rs <old-rs>
kubectl describe rs <new-rs>
9) Check application-level compatibility
A rollout may fail because the new version can’t work with:
- current database schema
- existing data
- downstream services
- feature flags
If the app starts but fails readiness or crashes, check logs and dependencies.
10) Roll back if needed
If the rollout is broken in production, revert to the previous working version:
kubectl rollout undo deployment/<deployment-name>
You can also undo to a specific revision:
kubectl rollout history deployment/<deployment-name>
kubectl rollout undo deployment/<deployment-name> --to-revision=<n>
11) Useful commands summary
kubectl rollout status deployment/<name>
kubectl rollout history deployment/<name>
kubectl describe deployment/<name>
kubectl get rs
kubectl get pods
kubectl describe pod/<pod>
kubectl logs <pod>
kubectl get events --sort-by=.metadata.creationTimestamp
kubectl rollout undo deployment/<name>
Common root causes
- Bad image tag or failed image pull
- CrashLoopBackOff in new pods
- Failing readiness probe
- Insufficient cluster resources
- Misconfigured environment variables or secrets
- Broken service/port configuration
- App incompatible with existing data or dependencies
If you want, I can also give you a step-by-step troubleshooting checklist or help analyze a specific kubectl describe deployment / pod event output.
Brands