Interview Prep/CI/CD/Release Engineering and Progressive Delivery

How do you do zero-downtime deployments on Kubernetes?

IntermediateProductionRelease Engineering and Progressive Delivery
Answer

Combine: RollingUpdate with maxUnavailable: 0, accurate readiness probes, a preStop hook with a short sleep plus graceful shutdown handling SIGTERM (so in-flight requests finish before the pod is removed from endpoints), appropriate terminationGracePeriodSeconds, PodDisruptionBudgets, and multiple replicas across zones. Without the preStop delay, some requests hit a terminating pod because endpoint removal and SIGTERM race.

lifecycle:
  preStop: { exec: { command: ["sleep", "10"] } }
terminationGracePeriodSeconds: 45
All CI/CD questions Roadmap: CI/CD fundamentals

More on Release Engineering and Progressive Delivery