The following table explains the major fields used when defining a PersistentVolume (PV) in Kubernetes.
| Element | Required / Optional | Description | Example Syntax |
|---|---|---|---|
| apiVersion | Required |
Specifies the Kubernetes API version. For PersistentVolumes, this is typically v1.
|
|
| kind | Required | Defines the Kubernetes resource type being created. |
|
| metadata.name | Required | Unique name used to identify this PersistentVolume inside the cluster. |
|
| spec.capacity.storage | Required | Total storage capacity exposed by this volume. |
|
| spec.accessModes | Required | Determines how the storage can be mounted by nodes and Pods. |
|
| spec.<storage-source> | Required | Defines the actual storage backend. Exactly one storage plugin must be chosen. |
|
| spec.storageClassName | Optional (Recommended) | Associates the PV with a particular StorageClass and enables PVC matching. |
|
| spec.persistentVolumeReclaimPolicy | Optional (Recommended) | Controls what happens to the underlying storage after the PVC is deleted. |
|
| spec.volumeMode | Optional | Determines whether the volume is mounted as a filesystem or exposed as a raw block device. |
|
Important: A PersistentVolume must define exactly one storage backend
such as
hostPath, nfs, csi,
awsElasticBlockStore, azureDisk, or another supported storage plugin.
No comments:
Post a Comment