DevOps Engineer interview question · Most asked
How do Kubernetes rolling updates work, and how do maxSurge and maxUnavailable affect them?
Summary
The Deployment controller creates a new ReplicaSet and shifts pods from old to new in steps. maxSurge is how many pods above the desired count may exist, and maxUnavailable how many may be missing; both default to 25%. Readiness probes gate each step, and kubectl rollout undo returns to the previous ReplicaSet.
Longer Answer
maxUnavailable 0 with a surge keeps full capacity but needs spare cluster resources; a higher maxUnavailable rolls faster with less headroom. PodDisruptionBudgets protect availability during node maintenance, not rollouts.
Key Points
- New ReplicaSet, stepwise replacement.
- maxSurge vs maxUnavailable trade-offs.
- Readiness gates progress.
- rollout undo for rollback.
Deep dive: DevOps Tutorial: Rolling Updates, Probes and Resources
Explanation
What interviewers look for
Mechanics plus trade-offs for capacity and speed.
More most-asked DevOps Engineer questions
- Design a CI/CD pipeline for a containerised microservice from commit to production.
- Pods keep restarting with OOMKilled under load. How do you investigate and fix it?
- How do you handle database schema migrations in an automated deployment pipeline?
- How do you handle secrets in CI/CD pipelines securely?
- What happens when you type a URL into a browser and press Enter?
- A rollback after a release made the outage worse because the database had already been migrated. How do you design releases so rollbacks are always safe?
- What are DORA metrics, and how would you use them without gaming them?
- Every deployment produces a burst of 502s. What do you check?