StatefulSet
The Kubernetes object for replicated applications where each pod needs a stable name and its own storage, such as databases.
In more detail
Pods are named with an ordinal, web-0, web-1 and so on, and keep that name and their claim when replaced. A headless Service gives each one a stable DNS name, and volume claim templates create one claim per replica. Pods start and stop in order by default.
Example
kubectl get pvc -l app=webRelated terms
- ordinal identity — The numbered, stable name each StatefulSet pod gets, such as web-0, which it keeps together with its storage across restarts.
- headless Service — A Service with no cluster IP whose DNS name returns the individual pod addresses, giving each pod a stable name of its own.
- PersistentVolumeClaim — A namespaced request for storage of a given size and access mode, which Kubernetes binds to a matching PersistentVolume.
Taught in
- Container Images The Exam Way — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Choose The Right Workload Resource — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Persistent And Ephemeral Volumes — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Design And Build: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Upgrading For CVEs: Read The Feed, Then Patch — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Same Name, Wrong Namespace: Objects, Namespaces And Labels — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Five Jobs, Five Workloads — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- A Name That Outlives Its Pods: Services And DNS — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Fundamentals Sprint: Four Tickets Before The Doors Open — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Bookings That Survive The Pod: Volumes And Claims — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- The Festival, End To End: Final Review — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- StorageClasses, CSI And Dynamic Provisioning — Kubernetes: Production-Grade Container Orchestration
- StatefulSets, Stable Identity And Data Recovery — Kubernetes: Production-Grade Container Orchestration
- Which Node Was It? Collector Deployment Patterns — OpenTelemetry Certified Associate (OTCA) Exam Prep