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
- Kubernetes1.36.4
- Provisionerrancher.io/local-path
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- TimeAbout 35 min
- Reviewed21 August 2026
Written against the versions above. PVC names are generated deterministically. That predictability is the feature, not an implementation detail.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
Before you start
- The StatefulSets guide, for stable identity and ordered rollout.
- The dynamic provisioning guide, since each generated claim provisions a volume.
- The reclaim policies guide, for what happens to the claims this guide leaves behind.
-
volumeClaimTemplates, and the names it generates
-
The volume belongs to the ordinal, not to the Pod
-
Scaling up creates a claim; scaling down does not remove one
-
Deleting the StatefulSet keeps them too