Kubernetes interview question · Most asked

How do persistent volumes work? Explain PV, PVC, StorageClass and CSI.

Summary

A PersistentVolumeClaim is a pod's request for storage (size, access mode); a PersistentVolume is the actual piece of storage; a StorageClass describes how to provision volumes dynamically, through a CSI (Container Storage Interface) driver for the backing system (EBS, Persistent Disk, Ceph, NFS).

Longer Answer

Details that matter: access modes (ReadWriteOnce attaches to one node; ReadWriteMany needs shared file storage such as EFS or NFS); volumeBindingMode: WaitForFirstConsumer provisions the volume in the zone where the pod is scheduled, avoiding zone mismatches; reclaimPolicy decides whether the disk is deleted with the claim; volume expansion and snapshots depend on the driver.

Block volumes are zonal, so a StatefulSet pod tied to a volume in one zone cannot move to another zone. Back up data independently of Kubernetes objects.

Key Points

  • PVC = request; PV = storage; StorageClass = provisioning.
  • CSI drivers implement backends.
  • Access modes; WaitForFirstConsumer.
  • Zonal volumes pin pods to zones.

More most-asked Kubernetes questions

← All Kubernetes questions