Which Kubernetes object manages rolling updates and keeps N replicas running?
Options
- Pod
- Deployment (Correct option)
- ConfigMap
- Namespace
Answer
Deployment
Why
A Deployment says 'I want 3 copies of this Pod running, with this image'. Kubernetes keeps that true: if a Pod dies, it creates a new one.
When you change the image version, it replaces Pods gradually (rolling update), so the app stays available, and you can go back with kubectl rollout undo.
For databases that need stable identities and disks, StatefulSets are used instead.
Remember
Deployment = desired number of Pods + rolling updates.