CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Administrator

Storage for StatefulSets: volumeClaimTemplates

volumeClaimTemplates gives every replica its own claim, named by ordinal. Delete a Pod and its data comes back; scale down or delete the whole StatefulSet and the claims stay behind, which is deliberate and is the thing that surprises people.

Storage Guide 73 of 103 Intermediate

Written against the versions above. PVC names are generated deterministically. That predictability is the feature, not an implementation detail.

Three worker nodes, so each replica's volume lands somewhere different.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. volumeClaimTemplates, and the names it generates

  2. The volume belongs to the ordinal, not to the Pod

  3. Scaling up creates a claim; scaling down does not remove one

  4. Deleting the StatefulSet keeps them too

Official sources