Learning · Kubernetes

Storage and volumes

Volumes, PVCs, StorageClasses, and CSI — persistent data without pretending every disk is forever.

Pods are ephemeral; volumes are how you attach durable or shared storage when you must.

Volume types you will meet

  • config/secret volumes — projected config, not databases
  • emptyDir — scratch space tied to Pod lifetime
  • PVC — claim on durable storage provisioned via StorageClass / CSI

PV and PVC

A PersistentVolumeClaim requests size/access mode; the control plane binds a PersistentVolume (often dynamically). Access modes matter: ReadWriteOnce vs ReadWriteMany decide whether multiple nodes can mount — cloud disks are often RWO.

StorageClass

Defines provisioner, reclaim policy, volume expansion, and binding mode. Teams should pick platform-approved classes (fast SSD, cheap HDD, regional) — not invent one-off classes per app.

CSI and operations

CSI drivers own attach/mount/snapshot. Outages often sit in the driver, IAM permissions, or AZ mismatch (volume in zone A, Pod scheduled in zone B). Use topology-aware scheduling for zonal disks.

Data safety

  • reclaimPolicy Retain vs Delete — know which you use before deleting claims
  • snapshots and backups are your responsibility even with PVCs
  • StatefulSets + volumeClaimTemplates are the usual pattern for per-replica disks

Anti-patterns

Hosting a critical database on a single RWO PVC with no backup, no operator, and a Deployment that can reschedule across zones “for HA.” Storage does not create HA by itself.

← Kubernetes