
- PersistentVolume (PV): a cluster-scoped resource representing a piece of storage.
- PersistentVolumeClaim (PVC): a user request for storage that gets bound to a PV.
- StorageClass: optional resource to enable dynamic provisioning of PVs.
- Binding: the process that matches PVCs to available PVs based on size, access mode, and selectors.
ReadWriteOnce, ReadOnlyMany, and ReadWriteMany. See the table below for concise descriptions and typical use cases.
Let’s create a simple PV manifest to see the structure. This example uses
hostPath for demonstration:
hostPath:
hostPath mounts storage from the node’s local filesystem. It’s useful for local development or single-node clusters. For production, use a networked or cloud-backed volume type (for example, AWS EBS, GCE Persistent Disk, NFS, or a CSI-backed driver configured via a StorageClass).Do not use
hostPath in multi-node or production clusters—data will not be portable between nodes and can be lost if the Pod is rescheduled to a different node. Use a networked volume or a CSI driver for durability and portability.pv-definition.yaml) with kubectl:
Next steps
- Create a PersistentVolumeClaim (PVC) to request storage from the cluster pool.
- Observe the PV/PVC binding process and how Pods mount the resulting volume.
- Consider using a
StorageClassand a CSI driver for dynamic provisioning in production.