Persistent Volumes and PersistentVolumeClaims
Understand the PV and PVC model, access modes, reclaim policies, and how a pod mounts durable storage through a claim.
PV and PVC in Plain English
A PersistentVolume (PV) is storage available to the cluster. A PersistentVolumeClaim (PVC) is a request for some of that storage from within a namespace.
Scope Difference
| Resource | Scope |
|---|---|
| PV | Cluster-level |
| PVC | Namespace-level |
Binding Lifecycle
| State | Meaning |
|---|---|
| Available | PV exists and is not yet claimed |
| Bound | PVC is attached to a PV |
| Released | Claim was removed but PV handling is not finished |
| Failed | Binding or reclaim operation failed |
Access Modes
| Mode | Meaning |
|---|---|
| RWO | ReadWriteOnce |
| ROX | ReadOnlyMany |
| RWX | ReadWriteMany |
Reclaim Policies
| Policy | Effect |
|---|---|
| Retain | Keep storage for manual cleanup or reuse |
| Delete | Remove underlying storage when released |
| Recycle | Legacy pattern, rarely used now |
Full YAML Example
apiVersion: v1
kind: PersistentVolume
metadata:
name: demo-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /data/demo-pv
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: demo-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Pod
metadata:
name: pvc-demo
spec:
containers:
- name: app
image: busybox:1.36
command: ['sh', '-c', 'echo hello > /data/hello.txt && sleep 3600']
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: demo-pvc
Binding Diagram
Pod → PVC → PV → Storage backend
Pod
mounts /data
PVC
claim · namespace
requests: 10Gi RWO
PV
cluster-wide resource
capacity: 50Gi
Storage
AWS EBS / GCP PD
NFS / hostPath
PV lifecycle phases
Why PVCs Are Better for App Teams
Developers usually should not hardcode infrastructure details. A PVC lets them ask for storage by size and capabilities, while platform teams manage the backing implementation.
Scope Check
Which statement about scope is correct?
Retain Policy
What does the `Retain` reclaim policy generally mean?