CI/CD · Ship safely, repeatedly
How do rolling deployments work and what should you watch?
Short answer
A rolling deployment replaces instances in batches while the remaining instances keep serving traffic. Readiness probes, surge settings and backward-compatible changes keep the service available during the rollout.
The orchestrator starts new instances, waits for them to become ready, then terminates old ones. At any moment both versions may be serving, so APIs, queues and database schemas must tolerate mixed-version operation.
- Use readiness probes so traffic is not sent to an instance that is still starting
- Set maxSurge and maxUnavailable to balance speed against capacity
- Drain connections gracefully with a termination grace period
- Keep message and API contracts backward compatible during the rollout
- Watch error rate and latency per version, not only at the service level
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
minReadySeconds: 15Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What happens if a new pod never becomes ready?
- 2How do you handle in-flight requests during termination?
- 3What is the difference between readiness and liveness?
- 4Why do mixed versions matter for message consumers?
Say it in the interview
A rolling deployment replaces instances in batches, keeping capacity available. I rely on readiness probes and conservative surge settings, and I make sure both versions can coexist because traffic and messages may hit either one. Graceful termination drains in-flight requests. I watch per-version error and latency signals, since a completed rollout does not necessarily mean the release is healthy.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live CI/CD mock interview and get scored feedback on depth, clarity and confidence.