How do you make sure a deploy is safe to roll back?
IntermediateScenarioDeployments and releases
Answer
Situation read → Rollback safety is designed in before release, not discovered during an incident.
What I'd do →
- Immutable, versioned artifacts: images tagged with the Git SHA and referenced by digest, so "previous version" is exact.
- Config versioned alongside code (Helm values in Git, GitOps), so rolling back the app also rolls back its config.
- DB changes follow expand-and-contract: the new schema works with the old code, so rolling back code is always safe.
- Feature flags for risky behaviour, so "rollback" can be a toggle.
- Test the rollback path: run
helm rollbackor the Argo revert in staging as part of release.
helm history api -n staging
helm rollback api 41 -n staging --wait
- Message and cache format changes must be readable by both versions.
Why → A rollback that has never been tested is a hope, not a plan.
Interview tip → Name expand-and-contract explicitly.
More on Deployments and releases
A deploy went out and p99 latency doubled. Walk me through it.IntermediateYou deployed a new version and half the pods are in CrashLoopBackOff. What do you do?BeginnerA release passed every test in staging but broke in production. How do you investigate?IntermediateHow would you design a zero-downtime deployment for a stateless API on Kubernetes?BeginnerEvery deploy causes a short spike of 502 errors from the ALB. Why, and how do you fix it?IntermediateHow would you set up a canary release, and what decides whether it gets promoted?Intermediate