Hands-on Lab·Certified Kubernetes Administrator
PersistentVolumes and PersistentVolumeClaims
Create a 1Gi volume by hand, then two claims: one asks for 5Gi and waits forever, the other asks for 500Mi and gets the whole gigabyte. The matching rules and the misleading error message are both worth seeing directly.
Storage Guide 67 of 103 Intermediate
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 30 min
hostPath is used for the PV so the example needs no storage backend. It is not a production choice.
| 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 |
This guide includes
Use this when storage has to outlive a Pod and you need to know which half of it is your job. This matters because the PV and PVC split exists to separate two roles, and a claim that cannot be satisfied fails with a message pointing at the wrong thing.
- creating the volume and the claim as separate objects, because two different people own them
- asking for more than any volume offers, and reading a Pending that misleads
- asking for less and binding immediately - to the whole volume, not to the amount requested
Before you start
- The emptyDir and hostPath guide, for why a Pod-scoped volume is not enough.
- The namespaces guide: a PersistentVolume is cluster-scoped and a claim is namespaced, which is the whole point of the split.
- A cluster where you can create cluster-scoped objects.
-
Two objects, because two people are involved
-
A claim that cannot be satisfied, and a misleading error
-
A claim that fits, and gets more than it asked for