Storage
Volume basics
A Pod volume outlives container restarts but not Pod deletion. emptyDir is node-local scratch; hostPath binds a node path and is risky for scheduling. ConfigMap and Secret volumes project keys as files; subPath mounts a single key without replacing the directory. PersistentVolumes are cluster resources; PersistentVolumeClaims request storage. StorageClasses enable dynamic provisioning.
Binding and access
A PVC binds to a PV when capacity, access modes, storage class, and selector match. Access modes are RWO, ROX, RWX, RWOP; RWO is enforced at the node/volume level, not as one-Pod-only. Reclaim policy Delete removes backing storage; Retain keeps it. StatefulSets use volumeClaimTemplates to create one PVC per replica. The default StorageClass is marked by an annotation; without one, a PVC may stay Pending.
Traps
A PVC can be Pending because no provisioner exists, the requested access mode is unsupported, or the storageClassName is wrong. A Pod can be Running but unable to write due to permissions or a read-only mount. Deleting a PVC may delete data under Delete policy. Mounting a ConfigMap over a directory hides existing files unless using subPath or items.
Worked example: create a 1Gi PVC with ReadWriteOnce using the default class, mount it at /data in a Deployment, then exec in and write a file; delete the Pod and confirm the file persists because the PVC remains.