PV and PVC Binding Process
You'll learn: How Kubernetes automatically connects storage requests (PVCs) to available storage resources (PVs) through its binding mechanism.
The Matchmaking Process
When you create a PersistentVolumeClaim, Kubernetes acts like a matchmaker, searching for a compatible PersistentVolume. Think of it like ordering a rental car: you specify requirements (size, features, location), and the system finds an available vehicle that meets your needs.
How Binding Works
The Kubernetes control plane continuously monitors for unbound PVCs and available PVs. When it finds a match, it creates a one-to-one binding between them. This binding is exclusive—once bound, that PV is reserved for that specific PVC.
Matching Criteria
Kubernetes evaluates several factors:
- Storage size: The PV must have at least the capacity requested by the PVC
- Access modes: Must match exactly (e.g.,
ReadWriteOnce,ReadOnlyMany) - Storage class: If specified in the PVC, the PV must have the same
storageClassName - Selectors: PVCs can use label selectors to target specific PVs
Binding States
A PVC progresses through states:
- Pending: Waiting for a suitable PV
- Bound: Successfully matched to a PV
- Lost: The bound PV no longer exists
If no matching PV exists, the PVC remains Pending until one becomes available or is created (through dynamic provisioning, covered later).
Best-Fit Selection
When multiple PVs match, Kubernetes picks the smallest PV that satisfies the request to minimize waste—like choosing the most appropriately sized rental car for your needs.
Key Takeaway: The PV and PVC binding process automatically matches storage requests to available resources based on capacity, access modes, and storage class, creating an exclusive one-to-one relationship that reserves the PV for the PVC's use.