PersistentVolumes (PV) & PersistentVolumeClaims (PVC)
Separate storage provisioning (PV) from consumer requests (PVC) in the binding model.
In plain words
A PV is the registered warehouse, and a PVC is a tenant's capacity request that is matched to one compatible unit. The simple Kubernetes rule is: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
Think of it like…
A PV is the registered warehouse, and a PVC is a tenant's capacity request that is matched to one compatible unit.
Where you’ve seen it
Before approving a data-path change, the storage owner runs kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod. Expected evidence: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode. If the run instead shows this symptom, stop and restore the last known state: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity.
Words you’ll hear
- PV
- For this lesson, PV is the controlling idea: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
- PVC
- PVC is the checkpoint; run
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prodand inspect the owner chain. A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity. - Binding
- Binding is the outcome to preserve; the cost is explicit: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time.
- Verification evidence
- The evidence command is
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod. It connects the declaration to this behavior: Separate storage provisioning (PV) from consumer requests (PVC) in the binding model.
Visual diagram
Theory & deep dive
How PV reaches the intended state
Separate storage provisioning (PV) from consumer requests (PVC) in the binding model. A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
The concrete checkpoint is kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod; compare the PV owner, PVC state, and Binding outcome instead of treating YAML acceptance as proof.
Run kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod after the change and correlate the result with Events and the owning object. A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
PVC: failure boundary and production cost
A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity. The prerequisite contract is concrete: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time. A safe design limits blast radius, records the last good configuration, and uses kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod as a deterministic rollback checkpoint.
Capture the current state with kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity.
How it works, step by step
Step 1 of 41. Declare the data contract
State capacity, topology, access, and ownership in the claim or class: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
- Goal
- Separate storage provisioning (PV) from consumer requests (PVC) in the binding model.
- Owner
- PV
When to use it & trade-offs
What it is
Separate storage provisioning (PV) from consumer requests (PVC) in the binding model. A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
Why it matters: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity. The invariant at risk is specific: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode. The quickest fact check before changing the design is kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod.
When to reach for it
- Use PV to enforce this invariant: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
- Use PVC evidence from
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prodin reviews and incident timelines. Separate storage provisioning (PV) from consumer requests (PVC) in the binding model. - Choose the managed external data plane route only when this cost is justified by governance or scale: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time.
When to avoid or be careful
- Avoid assuming PV is complete after YAML submission; the required behavior is concrete: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prodfirst: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity. - Avoid adopting a heavier platform wrapper before measuring its cost: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time.
Native, manual, and managed paths for PV
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod.Strengths: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
Watch out: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time. Recovery must also recognize this signal: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity.
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod; the expected invariant is: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.Strengths: kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike PV, it does not make this symptom self-documenting: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity.
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
Watch out: The added platform ownership buys value at this cost: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
- Trace PV to Binding through PVC; the invariant is: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
- Recognize the symptom: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity.
- Justify the cost: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time.
- Verify with kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod instead of only inspecting YAML.
Benchmarks & rules of thumb
- 1
- bound PV can satisfy only one PVC claim at a time
- 2
- volume modes are Filesystem and Block
- 0
- Pending PVCs provide usable storage to the Pod
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the PV owner contract: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode.
- Ignoring this telltale condition leads to unrelated changes: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity.
- Repeating
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prodwithout an owner for remediation wastes retry cost. Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode?
- Which owner object, logs, and Events would you inspect for this symptom-A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity-?
- At what threshold would this cost become unacceptable: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time?
kubectl get pv,pvc -A; kubectl describe pvc data-api-0 -n prod, name the failure, then justify the cost. Invariant: A PersistentVolume represents provisioned storage and a PersistentVolumeClaim requests capacity, access, and class; binding depends on compatible selectors and volume mode. Failure: A PVC in Pending has no matching PV or provisioner path, and a bound claim does not prove the volume can mount or the filesystem has the expected capacity. Cost: Separating capacity from workload ownership enables dynamic provisioning, but lifecycle fields, topology, and access modes must match at binding and mount time.Knowledge check
Put it into practice
Practice related interview Q&A
Apply PersistentVolumes (PV) & PersistentVolumeClaims (PVC) with generative AI interview Q&A and hands-on practice.