Interview Prep/Kubernetes/Deployments and rollouts

A rollout must never reduce capacity below current replicas. How do you configure the strategy?

IntermediateScenarioDeployments and rollouts
Answer

Situation read → A latency-sensitive API with 10 replicas that cannot lose capacity during deploys.

What I'd do →

  1. Set strategy.rollingUpdate.maxUnavailable: 0 and maxSurge: 25% (or a number)
  2. Make sure the cluster has headroom for the surge pods or the rollout will hang Pending
  3. Add a readinessProbe so a new pod only counts as available once it can serve
  4. Set minReadySeconds: 10 to avoid counting a pod that flaps right after start
  5. Verify with kubectl rollout status and watch kubectl get rs -w

Why → With maxUnavailable 0 the controller must bring up a new Ready pod before it terminates an old one, so serving capacity never drops.

Interview tip → Point out the trade-off: you need spare capacity for surge, otherwise the rollout stalls.

All Kubernetes questions Roadmap: Kubernetes core

More on Deployments and rollouts