
This is not a hypothetical risk—running stateful services on ephemeral container storage can and will lead to data loss during node maintenance, evictions, autoscaling, and failures.



Kubernetes storage stack (three layers)
Understanding which component creates and manages what is essential for platform teams and developers.
- StorageClass — A template or “menu entry” that defines how volumes are provisioned. It points to a CSI driver (the provisioner) and includes provider-specific parameters such as disk type, IOPS, encryption, and topology constraints. Platform teams create and manage StorageClasses for developers to choose from.
-
PersistentVolume (PV) — A representation of an actual storage resource. PVs are either:
- statically provisioned by admins (manually created), or
- dynamically provisioned by a StorageClass when a PVC is requested. Cloud environments typically use dynamic provisioning.
- PersistentVolumeClaim (PVC) — A developer’s request for storage. The PVC declares size, access mode(s), and optionally a StorageClass name. Kubernetes attempts to find an existing matching PV or asks the StorageClass to provision one, then binds the PVC to that PV. A pod mounts the PVC as a directory (for example, /data).
Access modes
Access modes define how a volume may be mounted and how many nodes/pods can use it. Not all modes are supported by every backend.- ReadWriteOnce (RWO): mount read-write by a single node (multiple pods on that node may share). Typical for block volumes and databases.
- ReadOnlyMany (ROX): mount read-only by many nodes. Good for distributing static assets across replicas.
- ReadWriteMany (RWX): mount read-write by many nodes. Requires a network filesystem or file-share CSI driver (NFS, EFS, Azure Files, etc.).


Example PVC
A PVC declares size, accessModes, and optionally astorageClassName. Kubernetes will bind an existing PV or ask the StorageClass to provision a PV dynamically. If storageClassName is omitted, the cluster default StorageClass (if configured) will be used.
Correct example PVC:
Pending to Bound. If the PVC remains Pending inspect it:
Pending:
- StorageClass name typo or missing StorageClass.
- Insufficient capacity in the backend.
- StorageClass uses
volumeBindingMode: WaitForFirstConsumerand no pod is scheduled that references the PVC yet. - Requested access mode is not supported by available PVs or provisioner.
If a PVC stays
Pending, check the StorageClass, backend capacity, and volumeBindingMode. For multi-AZ clusters, prefer WaitForFirstConsumer to ensure volumes are provisioned in the consuming Pod’s zone.StorageClass details
Platform teams define StorageClasses to expose curated storage offerings. Developers reference them by name in PVCs. Example StorageClass:
Notes on reclaim policies:
- Delete: good for ephemeral or reproducible data where storage lifecycle follows the PVC.
- Retain: use for critical data that must be preserved after PVC deletion (manual cleanup required).
Immediatemay cause volumes to be provisioned in the wrong AZ/zone for multi-AZ clusters.WaitForFirstConsumerensures volumes are created in the correct topology aligned to where the Pod will run.
Choosing storage for workloads
Answer the question “Which storage should I use?” using four criteria: access mode, storage type, reclaim policy, and workload characteristics. Suggested mappings:
Name StorageClasses by use case (e.g.,
fast-ssd, shared-nfs, bulk-hdd) rather than by cloud provider. This keeps the platform portable and makes selection easier for developers.

Five key takeaways
- PVCs request storage; PVs provide it. Developers create PVCs; platform teams manage StorageClasses—clear separation of concerns.
- Access modes dictate sharing semantics. Not every backend supports every mode.
- StorageClasses abstract provider details; name them by use case to help developers choose the right one.
- Match workload to storage: databases typically need SSD +
Retain; batch jobs can use cheaper disks +Delete. - Storage decisions affect both performance and cost—evaluate IO, throughput, durability, and availability when designing StorageClasses.

Links and References
- Kubernetes Persistent Volumes: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
- Kubernetes StorageClasses: https://kubernetes.io/docs/concepts/storage/storage-classes/
- CSI (Container Storage Interface) docs: https://kubernetes-csi.github.io/
- AWS EBS CSI Driver: https://github.com/kubernetes-sigs/aws-ebs-csi-driver
- NFS and RWX solutions: see cloud vendor docs for EFS (AWS), Azure Files, and GCP Filestore.