Concept and Usage
Persistent Volume (PV) is a storage resource in the cluster provisioned by an administrator or dynamically via Storage Classes. A PV has its own lifecycle, meaning it is not tied to any pod. To use a PV in your pod, you create a Persistent Volume Claim (PVC) that requests a PV with specific storage requirements.PV and PVC are bound together — one PV can only be bound to one PVC (one-to-one relationship). No other PVC can use the same PV’s remaining capacity.
Create a PV
pv.yaml
| Access Mode | Description |
|---|---|
ReadWriteOnce | Mounted as read-write by a single node. Multiple pods on the same node can access it. |
ReadOnlyMany | Mounted as read-only by many nodes. |
ReadWriteMany | Mounted as read-write by many nodes. |
ReadWriteOncePod | Mounted as read-write by a single Pod only, across the whole cluster. |
| Policy | Description |
|---|---|
Retain | Volume remains until manually deleted. |
Delete | Volume is deleted when the PVC is deleted. |
Create a PVC
When you create a PVC, Kubernetes will bind the PVC to a PV that meets the requirements. If no matching PV exists, the PVC status will remain unbound.
pvc.yaml