The Claim Check System
If a Persistent Volume (PV) is a physical hard drive in the data center, a Persistent Volume Claim (PVC) is the "ticket" a user presents to get access to it.
1. The Separation of Concerns
Kubernetes splits storage responsibilities into two roles:
- Cluster Administrator: Manages the infrastructure. Creates the PVs (the actual storage).
- Developer: Deploys applications. Creates a PVC (a request for storage).
The Developer doesn’t care if the storage is on AWS EBS, Google PD, or a NetApp filer. They just say: “I need 10Gi of ReadWriteOnce storage.” The cluster handles the matchmaking.
2. The Binding Lifecycle
The process of matching a PVC to a PV is called Binding.
- Pending: The PVC is created but hasn’t found a matching PV.
- Bound: The Control Plane finds a PV that satisfies the PVC’s requirements (Size, AccessMode, StorageClass) and glues them together.
- Released: The PVC is deleted, and the PV is released (depending on
ReclaimPolicy).
3. Interactive: Binding Simulator
Watch how the Kubernetes Control Plane matches a user’s request (PVC) to available infrastructure (PVs).
Infrastructure (PVs)
User Request (PVC)
4. Access Modes Matrix
The Access Mode determines how the storage can be mounted. This is a capability of the physical storage provider.
| Mode | Abbreviation | Description | Typical Use |
|---|---|---|---|
| ReadWriteOnce | RWO | Mounted by Single Node as Read-Write. | Databases (Postgres, MySQL). Block Storage. |
| ReadWriteMany | RWX | Mounted by Many Nodes as Read-Write. | Web Assets, Shared Logs. NFS / EFS. |
| ReadOnlyMany | ROX | Mounted by Many Nodes as Read-Only. | Config Data, AI Models. |
[!WARNING] RWO is per NODE, not per POD. If you have 3 Replicas of a Pod scheduled on the same Node, they can ALL access the RWO volume. But if one Pod moves to Node 2, it loses access.
5. Using a PVC in a Pod
To use the storage, the Pod refers to the PVC by name. The Pod never talks to the PV directly.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
# Leave empty to find any matching PV, or specify storageClassName
storageClassName: ""
apiVersion: v1
kind: Pod
metadata:
name: mysql-pod
spec:
containers:
- name: mysql
image: mysql:5.7
volumeMounts:
- mountPath: "/var/lib/mysql"
name: mysql-storage
volumes:
- name: mysql-storage
persistentVolumeClaim:
claimName: mysql-pv-claim
6. The Problem with Manual PVs
In this model, the Administrator must manually create PVs before Developers can claim them. If the Admin sleeps, development stops.
To solve this scaling bottleneck, Kubernetes introduced Storage Classes and Dynamic Provisioning.