The simple version
You fill in a form asking for "a 2 TB locker that four people can open" (the claim). The building manager checks which locker types they have (storage classes) and gives you a real locker (the volume). If you asked for something no locker type offers, your form just sits in the tray.
The objects
| Object | What it is |
|---|---|
| PersistentVolumeClaim (PVC) | A request: size, access mode, storage class |
| PersistentVolume (PV) | An actual piece of storage bound to one claim |
| StorageClass | A recipe: which CSI driver provisions it, reclaim policy, binding mode |
| CSI driver | The plugin that creates and attaches storage for a given system |
Access modes
| Mode | Meaning | Typical backing |
|---|---|---|
| ReadWriteOnce (RWO) | Read-write by one node | Block devices, local NVMe |
| ReadOnlyMany (ROX) | Read-only by many nodes | Shared filesystems, snapshots |
| ReadWriteMany (RWX) | Read-write by many nodes | Shared filesystems (NFS, parallel FS) |
| ReadWriteOncePod (RWOP) | Read-write by one pod | Drivers that support it |
A multi-node training job that shares a dataset volume needs RWX or ROX from a class backed by shared storage. Asking a node-local class for RWX leaves the claim, and its pods, Pending (Lab 7.1).
Binding and lifecycle
volumeBindingMode: WaitForFirstConsumer delays provisioning until a pod is scheduled, so node-local volumes land on the right node; Immediate provisions as soon as the claim exists. reclaimPolicy: Retain keeps the data when the claim is deleted; Delete removes it. Most of a claim's spec can't change after creation: to switch class or mode, create a new claim.
$ kubectl get pvc,pv,sc
$ kubectl describe pvc train-data # events explain why it's PendingTools
kubectl get pvc|pv|sc|podsState of claims, volumes, classes and pods.
kubectl describe pvc NAMEEvents from the provisioner (why it's Pending).
kubectl apply -f / delete pvcCreate or replace claims.
Quiz
Lab
Lab 7.1 · Pods stuck Pending
Four training pods (trainer-0 to trainer-3) must all read and write the same dataset volume. They have been Pending for minutes. The claim is defined in manifests/train-pvc.yaml.
Try it now in the simulator (opens with the command ready; press Enter):
$ kubectl get sc$ cat manifests/train-pvc.yaml