Pcornel
Containers · Container Storage

Kubernetes PersistentVolumes and Claims

Cheat sheet · https://pcornel.dk/topic.php?topic=6135

Back to the Topic

Answer

PersistentVolumeClaims request storage of a size and access mode; Kubernetes binds them to PersistentVolumes, usually provisioned dynamically by a StorageClass.

Remember

PVC Pending → no matching StorageClass/PV or provisioner problem. Access modes (RWO, RWX) must match the use. Reclaim policy Delete removes data when the PVC is deleted.

First checks

  • docker ps -a — containers and exit codes
  • docker logs <c> — container output
  • docker inspect <c> — config, mounts, network, state

Commands

kubectl get pvc,pv

Verify in this order

PVC → StorageClass → provisioner → PV bound → mounted in pod

Where it usually breaks

No default StorageClass leaves PVCs Pending forever.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6135

Confirmation

Confirm action

Continue?