What is the difference between a PersistentVolume (PV) and a PersistentVolumeClaim (PVC)?
Quick Answer
A PV is an actual storage resource in the cluster (NFS, EBS, Azure Disk…), provisioned by an admin or dynamically, existing independently of pods. A PVC is a user/app request for storage (size, access mode, storage class); Kubernetes binds it to a matching PV, and pods mount the PVC.
Detailed Answer
Think supply vs demand: the PV is the storage (cluster-scoped, holds capacity, access modes, reclaim policy, storage class); the PVC is the request (namespace-scoped). A PVC binds to a suitable PV — statically pre-created or dynamically provisioned via a StorageClass. Pods reference the PVC (not the PV) in volumes. Analogy: PV = a house on the market, PVC = a request for a house, StorageClass/K8s = the agent that matches them.
Code Example
# Pod uses the claim, not the volume directly
volumes:
- name: data
persistentVolumeClaim:
claimName: demo-pvcInterview Tip
Frame it as supply (PV, cluster-scoped) vs demand (PVC, namespaced), and note pods mount the PVC — a common follow-up.