PersistentVolumeClaim (PVC) Fundamentals
What you'll learn: How PersistentVolumeClaims act as user requests for storage that bind to available PersistentVolumes in Kubernetes.
What Is a PersistentVolumeClaim?
A PersistentVolumeClaim (PVC) is a user's request for storage in Kubernetes. While PersistentVolumes (PVs) are provisioned by administrators and represent actual storage resources, PVCs are created by application developers or users to claim a portion of that storage.
Think of it like reserving a hotel room: the hotel (cluster) has rooms (PVs) available, and you submit a reservation request (PVC) specifying your needs—size, amenities, location. The hotel system then matches your request with an appropriate room.
How PVCs Work
When you create a PVC, you specify:
- Storage size (e.g., 10Gi)
- Access mode (ReadWriteOnce, ReadOnlyMany, ReadWriteMany)
- Storage class (optional, for dynamic provisioning)
Kubernetes then searches for a PV that satisfies these requirements. When it finds a match, it binds the PVC to that PV, creating a one-to-one relationship. Once bound, the PVC can be mounted into Pods just like any other volume.
The Binding Process
The binding happens automatically:
- User creates a PVC with specific requirements
- Kubernetes control plane searches for an available PV matching those requirements
- If a suitable PV exists, Kubernetes binds them together
- The PVC status changes to "Bound"
- Pods can now use the PVC by referencing its name
If no matching PV exists, the PVC remains in a "Pending" state until one becomes available (or is dynamically provisioned).
Key Takeaway: PersistentVolumeClaims are user requests for storage that Kubernetes automatically binds to matching PersistentVolumes, abstracting storage details from application developers and enabling portable storage declarations.