How do you handle rollback in Kubernetes?
⚡
Quick Answer
Use kubectl rollout undo deployment/<name> to revert to the previous ReplicaSet revision; kubectl rollout history shows revisions and you can target a specific one with --to-revision.
Detailed Answer
Kubernetes keeps a bounded history of Deployment revisions (revisionHistoryLimit), so rollback is fast and built-in. Readiness probes gate the rolled-back pods just like a normal rollout. For GitOps, the equivalent is git revert so the repo stays the source of truth. Backward-compatible schema changes are what make rollbacks safe.
💡
Interview Tip
Give the exact command and add that in GitOps you roll back via git revert, not kubectl — matching the workflow matters.
kubernetesrollbackdeployment