DevOps Engineer interview question
How do you roll out a Kubernetes deployment safely?
Roll out with immutable images, realistic readiness and startup probes, resource requests, a rolling or canary strategy, disruption limits, monitored error and latency gates, automatic pause, and a tested rollback path.
Direct answer
What a strong answer covers
How it works
A safe rollout starts with an image pinned by digest and a Deployment whose probes tell the truth: a startup probe for slow boots, readiness that reflects real ability to serve, and liveness limited to hung processes. Resource requests are set from measured usage so the scheduler places pods realistically. The strategy is rolling with maxUnavailable at zero and a small maxSurge for most services, or a canary through a service mesh or Argo Rollouts when the blast radius matters. A PodDisruptionBudget keeps enough replicas during node maintenance, a preStop hook and terminationGracePeriod let connections drain, and the rollout pauses on error or latency gates with kubectl rollout undo rehearsed.
Example
The orders service deploys through Argo Rollouts: 5 percent of traffic for 10 minutes with an analysis template that queries Prometheus for 5xx rate and p95, then 25, 50, and 100 percent. A PDB of minAvailable 3 protects it during cluster upgrades, preStop sleeps 5 seconds so the load balancer stops routing before the process gets SIGTERM, and a failed analysis step automatically aborts and restores the stable ReplicaSet.
Common mistakes
- Using a mutable tag so a rollback re-pulls a different image.
- Setting no readiness probe and sending traffic to pods still starting.
- Skipping the PodDisruptionBudget and losing every replica in one node drain.
A useful answer structure
Answer from your own work.
Do not memorise a script: use only examples you can explain honestly in follow-up questions.
Open the desktop workspace and rehearse a clear answer in your own words.