Deployments occasionally take down the service for 30 seconds even with rolling updates.
AdvancedScenarioDeployment Strategies and GitOps
Answer
Situation read → Graceful shutdown or readiness gaps.
What I'd do →
- Add a correct readiness probe and
minReadySeconds. - Add
preStop: sleep 10and aterminationGracePeriodSecondslonger than the drain time, so load balancers deregister before SIGTERM. - Set
maxUnavailable: 0and a PodDisruptionBudget. - Ensure the app handles SIGTERM by finishing in-flight requests.
Why → Endpoints removal and SIGTERM race each other, causing dropped connections.
Interview tip → The preStop sleep is a well-known trick.