Persistent storage, StatefulSets, and volume management
This domain tests whether storage survives Pod churn and whether volumes bind in the same zone as the Pod that needs them.
Core rules
volumeClaimTemplatescreates one PVC per StatefulSet ordinal; the PVC outlives the Pod.ReadWriteOnceis node-level access, not a guarantee that only one Pod anywhere can mount the volume.- For zonal disks, use a StorageClass with
volumeBindingMode: WaitForFirstConsumerso provisioning follows scheduling. - Reclaim policy determines whether deleting a PVC deletes the backing volume.
- Capacity and IOPS matter: compaction and repair are I/O heavy, and a full disk takes a node down.
Worked example
A StorageClass uses zonal SSD with WaitForFirstConsumer. cassandra-0 is scheduled to zone B; the CSI driver then provisions the PV in zone B and binds it. With Immediate binding, the PV could be created in zone C before scheduling, leaving the Pod permanently Pending because the volume's node affinity conflicts with the chosen node. After the cluster is running, resizing the PVC requires allowVolumeExpansion on the StorageClass and a filesystem resize before Cassandra sees the new space.
Traps
- A
Deletereclaim policy on data volumes without an independent backup. - Deleting a PVC to restart a node; that can destroy its data.
- Using local volumes without node affinity or a replacement plan.
- Assuming PVC expansion is instant and requires no filesystem step.