← All notes

Kubernetes StatefulSets

Answer: A StatefulSet manages Pods that need a stable identity: each Pod gets a fixed ordinal name (web-0, web-1, ...), a stable network identity through a headless Service, and its own persistent storage. Pods are created, scaled and deleted in order.

Compared with a Deployment

Both run Pods from one template, but a Deployment's Pods are interchangeable.

Key pieces

Updates

kubectl patch statefulset web --type=json   -p='[{"op":"replace","path":"/spec/template/spec/containers/0/image","value":"registry.k8s.io/nginx-slim:0.24"}]'

Caution

Deleting or scaling down a StatefulSet does not delete its volumes, which protects data but leaves storage to clean up.

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Kubernetes Authors, StatefulSets, CC BY 4.0 (kubernetes/website); Kubernetes Authors, StatefulSet Basics, CC BY 4.0 (kubernetes/website).

Cite this

Permanent ID: iil:note:sz4tfjgs

iinventedlight. 2026. "Kubernetes StatefulSets." iinventedlight Library, iil:note:sz4tfjgs, version of 2026-11-04. https://iinventedlight.com/library/notes/kubernetes-statefulsets/. License: CC-BY-4.0.

@misc{iil_note_sz4tfjgs,
  author = {{iinventedlight}},
  title = {{Kubernetes StatefulSets}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/kubernetes-statefulsets/},
  note = {Permanent ID iil:note:sz4tfjgs. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/kubernetes-statefulsets.md.