TOPIC CONTAINERS
StatefulSets & Operators running databases in clusters
IN 10 SECONDS
StatefulSets manage stateful workloads (like databases) by guaranteeing persistent identity names (pod-0, pod-1) and stable storage. Operators extend the API to automate database failovers.
GOTCHA Deleting a StatefulSet does not delete its persistent volumes, preventing accidental database wiping. You must clean up storage volumes manually.
HOW STATEFUL ROLLOUTS FLOW
01 Stateful order launches pod-0 first, waits for it to report healthy, then launches pod-1.
02 Storage mount each pod mounts its own dedicated persistent volume (PVC) matching its index number.
03 Failover event pod-1 crashes. StatefulSet recreates pod-1, linking it back to its original storage disk.
04 Operator loop special controller monitors status, automatically electing a new database primary if pod-0 dies.
POKE IT YOURSELF
kubectl get statefulset — list active StatefulSet controllers
kubectl get pvc — see volume claims bound to stateful pods
Drill this topic →
~75 sec read