Welcome to this comprehensive guide on Persistent Volume Claims (PVCs) in Kubernetes. In this article, you’ll learn how to create PVCs, understand their relationship with Persistent Volumes (PVs), and explore how reclaim policies affect your storage resources. Kubernetes administrators are responsible for creating PVs, while users create PVCs to request and utilize that storage. Once a PVC is defined, Kubernetes automatically binds it to an available PV that meets specific criteria such as capacity, access modes, volume modes, storage class, and additional parameters. Each PVC is exclusively bound to a single PV. If no matching volume exists at the time of creation, the PVC remains in a pending state until a compatible PV becomes available.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
When multiple PVs meet the claim criteria, you can leverage labels and selectors to ensure that the correct volume is bound. Even if the claim is smaller than the available PV, any surplus capacity will not be allocated to other claims.


Creating a Persistent Volume Claim
To get started with creating a PVC, you will need to define a YAML configuration. In the example below, the API version is set to v1, the resource kind is PersistentVolumeClaim, and the PVC is named “myclaim”. This claim requests 500Mi of storage with an access mode of ReadWriteOnce. Save the contents below in a file namedpvc-definition.yaml:
Even if a PVC requests only a portion of the storage available in a PV (e.g., 500Mi out of 1Gi), Kubernetes will bind it to that PV if the access mode and other conditions match.
Deleting a Persistent Volume Claim and Understanding Reclaim Policies
To delete the PVC, use the following command:| Reclaim Policy | Description | YAML Example |
|---|---|---|
| Retain | The PV is preserved even after the associated PVC is deleted. Manual cleanup by an administrator is required. | persistentVolumeReclaimPolicy: Retain |
| Delete | The PV is automatically deleted when the PVC is removed, freeing up the underlying storage. | persistentVolumeReclaimPolicy: Delete |
| Recycle | The PV is cleared of data (scrubbed) and made available for reuse by other PVCs. | persistentVolumeReclaimPolicy: Recycle |