How does persistent storage work in Kubernetes (PV, PVC, StorageClass)?
What they are really testing: Whether you understand the claim abstraction, dynamic provisioning, access modes, and reclaim policy. Storage is where stateful workloads succeed or fail.
A real interview question
How does persistent storage work in Kubernetes (PV, PVC, StorageClass)?
What most people say
drag me
“You create a PersistentVolumeClaim and the pod uses it for storage that survives restarts.”
It names the PVC but skips the StorageClass and dynamic provisioning, access modes, and reclaim policy, the things that determine whether the storage actually works for your workload and what happens to your data.
The follow-ups they ask next
Several pods on different nodes need to share a volume but it will not mount. Why?
The volume is ReadWriteOnce (typical for block storage like EBS), which only allows one node. You need a ReadWriteMany-capable shared filesystem (EFS, NFS, Filestore) for multi-node sharing.
What does the reclaim policy control, and why care for a database?
What happens to the underlying volume when the PVC is deleted: Delete destroys it, Retain keeps the data for manual recovery. For databases you want Retain so an accidental claim deletion does not lose data.
What the interviewer is listening for
- Explains PV/PVC abstraction + dynamic provisioning
- Knows access modes (RWO vs RWX) gotcha
- Knows reclaim policy + StatefulSet volumeClaimTemplates
What sinks the answer
- Only mentions PVC
- Unaware RWO blocks multi-node sharing
- No notion of reclaim policy / data loss
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“A [PV is real storage, a PVC is a pod request for size + access mode], the pod mounts the claim. A [StorageClass dynamically provisions the volume] instead of pre-creating PVs. Access modes: [RWO = one node (most block storage), RWX needs shared file storage like EFS]. The [reclaim policy (Retain vs Delete) decides if data survives claim deletion]. StatefulSets use [volumeClaimTemplates for stable per-replica volumes].”
Keep going with kubernetes
Foundation
What problem does Kubernetes solve, and what does it actually do for you?
Foundation
What are the main components of a Kubernetes cluster (control plane and nodes)?
Foundation
What is a Pod, and why do you use a Deployment instead of creating Pods directly?
Foundation
What is a Service in Kubernetes, and what are the main types?
Junior
When would you use a Deployment versus a StatefulSet versus a DaemonSet?
Junior
How do you inject configuration and secrets into a pod, and what is the catch with Kubernetes Secrets?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free