Storage¶
Pods are disposable, but data usually isn't. This section builds the storage mental model in layers: the ephemeral volumes attached directly to a pod spec, the PersistentVolume/PersistentVolumeClaim abstraction that survives a pod being rescheduled, the StorageClasses that provision that storage on demand, and the patterns StatefulSets use to give each replica its own durable disk.
Read in this order¶
- Volumes — ephemeral volume types (
emptyDir,hostPath,configMap,secret,projected), and why none of them survive a pod being rescheduled to a different node - PersistentVolumes and PersistentVolumeClaims — the PV/PVC lifecycle and binding, access modes, and reclaim policies
- StorageClasses and Dynamic Provisioning — CSI drivers, the dynamic provisioning flow end to end, and volume expansion
- StatefulSet Storage Patterns —
volumeClaimTemplates, one PVC per replica, and what happens to that storage when pods and StatefulSets are deleted
If you only remember one thing
A Pod's volumes: block describes how storage is attached to that pod. It says nothing about where the bytes actually live or whether they outlive the pod — that's what PersistentVolumes, PersistentVolumeClaims, and StorageClasses are for.
Next¶
Once you can reason about how a pod gets durable storage, continue to Configuration and Packaging to see how the same workloads get their configuration and secrets injected.