Kubernetes & Operations
StatefulSet vs Deployment
A Deployment treats Pods as interchangeable. A StatefulSet gives each Pod a name, an address and a disk that survive replacement, which is what a database replica needs and nothing more.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Kubernetes & Operations
- Pods: containers that share a network and storageBeginner · 6 min
A Pod is not a container with a new name. It is a small shared environment, which is why a log shipper can read your app's files and a bare Pod does not come back when…
- Deployments: replicas and rolling updatesBeginner · 5 min
A Deployment never edits a running Pod. It starts a second ReplicaSet and moves traffic across at a speed you control, which is why a bad image tag on Friday costs you…
- DaemonSetBeginner · 4 min
DaemonSet schedules a Pod on qualifying nodes.
- NoSchedule taintBeginner · 4 min
NoSchedule taint blocks new Pods lacking a matching toleration.
- Node affinityBeginner · 4 min
Node affinity constrains or prefers node labels.
- Pod anti-affinityBeginner · 4 min
Pod anti-affinity spreads workloads relative to other Pods.