Chapter 4 of 510% of exam

Storage

This chapter explains how Kubernetes provides durable storage to Pods through PersistentVolumes and PersistentVolumeClaims, how StorageClasses enable dynamic provisioning, and how reclaim policies protect or clean up data. Knowing the difference between ephemeral and persistent volumes prevents accidental data loss.

Volumes, PVs, and PVCs

A Pod consumes durable storage by referencing a PersistentVolumeClaim (PVC), which binds to a PersistentVolume (PV) representing real storage. This abstraction decouples workloads from storage details. In contrast, an emptyDir volume lives only as long as the Pod, and hostPath ties data to one node, so neither is suitable for durable data that must survive rescheduling.

StorageClasses and dynamic provisioning

A StorageClass names a provisioner and parameters so that a PV is created automatically when a PVC requests that class, avoiding manual pre-provisioning. Marking a StorageClass as the default lets claims without an explicit class still be satisfied. This is the standard way most clusters supply storage on demand.

Reclaim policies and access modes

A PV's reclaim policy controls what happens after its PVC is deleted: Retain keeps the volume and its data for manual reuse, while Delete removes the underlying storage. Access modes such as ReadWriteOnce, ReadOnlyMany, and ReadWriteMany describe how many nodes can mount the volume and in what mode. Choosing Retain protects important data from accidental deletion.

Report