Interview Prep/CI/CD/Deployment Strategies and GitOps

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 →

  1. Add a correct readiness probe and minReadySeconds.
  2. Add preStop: sleep 10 and a terminationGracePeriodSeconds longer than the drain time, so load balancers deregister before SIGTERM.
  3. Set maxUnavailable: 0 and a PodDisruptionBudget.
  4. 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.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Deployment Strategies and GitOps