Prompt
How do I troubleshoot a deployment rollback that keeps triggering?
Latest observation
If a deployment rollback keeps triggering, the goal is to find why the new deployment is being marked unhealthy and then stop the automatic rollback loop long enough to investigate safely.
1) Confirm what is triggering the rollback
Check whether rollback is being caused by:
- Health checks failing
- Readiness/liveness probe failures
- CrashLoopBackOff / app startup errors
- Failed deployment conditions
- Resource limits / OOMKilled
- Canary/blue-green analysis failures
- Manual automation or pipeline logic
Look at:
- Deployment events
- Application logs
- Pod status
- Load balancer / ingress health checks
- CI/CD pipeline logs
2) Inspect the rollout status and events
For Kubernetes, start with:
kubectl rollout status deployment/<name>
kubectl describe deployment <name>
kubectl get events --sort-by=.metadata.creationTimestamp
kubectl get pods -o wide
kubectl describe pod <pod-name>
kubectl logs <pod-name> --previous
Pay attention to:
ProgressDeadlineExceededReadiness probe failedLiveness probe failedImagePullBackOffCrashLoopBackOffOOMKilled
3) Check probes and health checks
A very common cause is overly strict probes.
Review:
readinessProbelivenessProbestartupProbeif applicable
Common issues:
- Probe path is wrong
- App takes longer to start than the probe allows
- Wrong port
- TLS/HTTP mismatch
- App depends on another service that is not ready yet
If startup is slow, add or tune a startupProbe, or increase:
initialDelaySecondstimeoutSecondsfailureThresholdperiodSeconds
4) Check app logs for startup failures
Search for:
- Missing env vars
- Bad secrets/configmaps
- Database connection errors
- Migration failures
- Port binding errors
- Dependency failures
- Permission errors
If the app exits immediately, the rollback may be a symptom rather than the cause.
5) Validate resources and scheduling
A rollout may fail if new pods can’t get enough resources.
Check:
kubectl describe pod <pod-name>
kubectl top pods
kubectl top nodes
Look for:
- CPU/memory limits too low
- Node pressure
- Insufficient cluster capacity
- Failed volume mounts
6) Inspect service/ingress/load balancer behavior
Sometimes the app is fine, but external health checks fail.
Check:
- Service selector matches pod labels
- Ingress routes to the correct service/port
- Load balancer health check path/port
- Network policies or firewalls
- TLS/certificate issues
7) Check deployment strategy settings
If using rolling updates:
maxUnavailablemaxSurgeprogressDeadlineSeconds
If using blue/green or canary:
- Analysis runs
- Promotion gates
- Metrics thresholds
- Automated rollback policies
An aggressive analysis threshold or metric spike can cause repeated rollbacks.
8) Temporarily pause automation if needed
If a pipeline or controller keeps rolling back automatically, pause it while you investigate:
- Disable auto-rollback in the deployment tool
- Pause the rollout
- Scale down the automation controller if necessary
- Revert to a known good version manually
For Kubernetes:
kubectl rollout pause deployment/<name>
Resume later:
kubectl rollout resume deployment/<name>
9) Compare the bad revision to the last good one
Look for changes in:
- Container image
- Environment variables
- ConfigMaps/Secrets
- Resource requests/limits
- Probe settings
- Dependency versions
- Migrations
- Feature flags
Often rollback loops happen because a config change, not the code, is breaking readiness.
10) If rollback itself is failing
If the system tries to roll back but the previous revision also fails:
- Confirm the old version still works in the current environment
- Check whether shared dependencies changed
- Verify infrastructure drift
- Ensure rollback target image/config still exists
Quick checklist
- Check deployment events
- Check pod logs and previous logs
- Check readiness/liveness/startup probes
- Verify config/secrets/env vars
- Check resource limits and node capacity
- Validate service/ingress/LB health checks
- Compare good vs bad revision
- Pause auto-rollback if needed
If you tell me what platform you’re using—Kubernetes, Argo CD, Jenkins, GitHub Actions, AWS CodeDeploy, Azure DevOps, ECS, or something else—I can give you a more specific step-by-step troubleshooting path and the exact commands to use.