A PersistentVolumeClaim (PVC) is a request for storage made by an application. Developers create PVCs instead of dealing directly with disks or storage infrastructure. Kubernetes then finds a matching PersistentVolume (PV) or dynamically provisions one using a StorageClass.
| Element | Required / Optional | Description | Example Syntax |
|---|---|---|---|
| apiVersion | Required |
Specifies the Kubernetes API version. For PVCs, this is always v1.
|
|
| kind | Required | Defines the Kubernetes resource type. |
|
| metadata.name | Required | The unique name of the claim. Pods, Deployments, and StatefulSets reference this name when mounting storage. |
|
| spec.accessModes | Required | Defines how the application intends to access the storage. The requested mode must be supported by the underlying PersistentVolume. |
|
| spec.resources.requests.storage | Required | Specifies the minimum storage capacity required by the application. |
|
| spec.storageClassName | Optional (Recommended) | References a specific StorageClass for dynamic provisioning or acts as a matching tag when binding to a static PersistentVolume. |
|
| spec.volumeMode | Optional |
Specifies whether the storage should be mounted as a traditional filesystem or exposed as a raw block device. Defaults to Filesystem.
|
|
PVC Binding Rule:
Kubernetes will only bind a PVC to a PersistentVolume that satisfies all requested requirements, including
storage size,
accessModes,
storageClassName,
and
volumeMode.
Relationship:
Pod → PVC → PV → Physical Storage
Applications consume storage through PVCs, while Kubernetes handles the mapping to actual disks or cloud storage resources.
Pod → PVC → PV → Physical Storage
Applications consume storage through PVCs, while Kubernetes handles the mapping to actual disks or cloud storage resources.
No comments:
Post a Comment