Kubernetes PersistentVolumes and PVCs: Connect Storage and Protect Data
To keep data when a Pod restarts or moves to another node, a workload needs persistent storage rather than only a container's temporary filesystem. A PersistentVolume (PV) is a storage resource available to a cluster; a PersistentVolumeClaim (PVC) is a namespace-scoped request for the capacity and access the application needs. A StorageClass specifies which provisioner and storage policy can provide a volume, so an application can request storage without knowing the backend implementation.
Kubernetes PersistentVolumes and PVCs: Connect Storage and Protect Data
To keep data when a Pod restarts or moves to another node, a workload needs persistent storage rather than only a container's temporary filesystem. A PersistentVolume (PV) is a storage resource available to a cluster; a PersistentVolumeClaim (PVC) is a namespace-scoped request for the capacity and access the application needs. A StorageClass specifies which provisioner and storage policy can provide a volume, so an application can request storage without knowing the backend implementation.
What do PV, PVC, StorageClass, and Pod each do?
These four objects separate where storage comes from, how it is requested, and how a workload uses it.
| Component | Role | Scope and lifetime |
|---|---|---|
| PersistentVolume (PV) | Represents backend storage as a Kubernetes resource | Cluster-scoped and independent of an individual Pod's lifetime |
| PersistentVolumeClaim (PVC) | Requests storage capacity, access mode, and optionally a class | Namespace-scoped; referenced by a Pod |
| StorageClass | Defines the provisioner and storage policy for dynamic provisioning | A class offered by the cluster operator |
| Pod | References a PVC as a volume and mounts it into a container path | A PVC and PV may remain after the Pod ends |
PV and PVC objects are normally bound one-to-one. A PVC claims one PV, and a bound PV is not assigned to another PVC at the same time. A Pod usually references a PVC in its own namespace instead of selecting a PV directly. The control plane finds a PV that matches the request or creates one through a StorageClass and provisioner, then binds it to the claim.
This separation matters because compute and storage have different lifetimes. A Deployment can replace a Pod, or a Pod can be rescheduled after a node failure. If the replacement Pod references the same PVC, it can continue using the data as long as the storage backend supports that use. PVs and PVCs are not backups or replication by themselves; durability and recovery depend on the storage service and backup design.
How does a PVC request get connected to a PV?
A cluster administrator can provision storage statically by creating PVs in advance. Alternatively, a StorageClass can use a dynamic provisioner to create backend storage and a PV when a PVC is submitted. Dynamic provisioning requires the requested class and a compatible driver to be configured in the cluster. The existence of a default StorageClass does not guarantee a particular performance or replication level, so ask the operator about that class's implementation and policy.
A binding control loop looks for a PV that matches the PVC's requested capacity, access mode, volume mode, StorageClass, and any selector. If no suitable volume is available yet, the PVC can remain in Pending. Its events and description help distinguish a wait for a static PV, a missing or misconfigured class or driver, and a delay while the cluster waits to place the first Pod because of storage topology.
For example, suppose a development web application requests 5Gi of file storage. If the operator has configured a standard StorageClass and a dynamic provisioner, binding the PVC may create a backend volume and PV. The Pod refers to the PVC by name and mounts the volume at a container path. If the PVC is kept when the Pod is replaced, the next Pod can reuse the same claim. This example explains the flow; it does not assume that a class named standard exists in your cluster.
First inspect the StorageClasses available in the cluster and replace standard in the example with an actual class name. Even if a default class exists, check that it provides the kind of storage you need. The manifest and commands below are illustrative and were not run on a real cluster.
kubectl get storageclassThis PVC requests a 5Gi filesystem volume. ReadWriteOnce means read-write mounting on one node; it does not mean that only one Pod can use the volume. Multiple Pods on the same node may be able to use it. Actual support depends on the storage driver.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: web-content
namespace: app
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
storageClassName: standard # Replace with a StorageClass that exists in the cluster.
resources:
requests:
storage: 5GiThe Pod refers to the PVC in the same namespace through persistentVolumeClaim.claimName. mountPath is where the volume appears inside the container. Mounting a volume can hide files already present at that path, so check the application image and path before applying the example.
apiVersion: v1
kind: Pod
metadata:
name: web
namespace: app
spec:
containers:
- name: web
image: nginx
volumeMounts:
- name: content
mountPath: /usr/share/nginx/html
volumes:
- name: content
persistentVolumeClaim:
claimName: web-contentCheck separately whether the PVC is Bound, which PV it is connected to, and whether the Pod is ready. A PVC is namespaced while a PV is cluster-scoped, so kubectl get pvc -n app and kubectl get pv query different scopes.
kubectl apply -f storage.yaml
kubectl get pvc -n app
kubectl describe pvc web-content -n app
kubectl get pv
kubectl describe pod web -n appHow should you choose access mode and volume mode?
An access mode describes how a volume can be mounted and is used when Kubernetes matches a PVC to a PV. Actual support depends on the volume type and CSI driver.
| Mode | Meaning | What to keep in mind |
|---|---|---|
ReadWriteOnce (RWO) | Read-write mounting on one node | Does not mean one Pod only; multiple Pods on that node may use it |
ReadOnlyMany (ROX) | Read-only mounting on multiple nodes | The access-mode label alone does not guarantee that every backend enforces write protection |
ReadWriteMany (RWX) | Read-write mounting on multiple nodes | Requires support from the driver and backend, such as a shared filesystem |
ReadWriteOncePod (RWOP) | Read-write mounting by one Pod in the cluster | Requires CSI volume support; check the driver and related sidecar versions |
In particular, do not interpret RWO as “only one Pod can access this.” If you need to enforce single-Pod access, consider RWOP. This mode has been stable since Kubernetes v1.29, but it is supported only for CSI volumes, so check the cluster version and driver configuration. Access modes describe binding and mounting conditions; they are not a security boundary that prevents an application from writing after a volume is mounted.
volumeMode determines whether storage is mounted as a filesystem or presented as a raw block device. If omitted, Filesystem is the default. Block presents the device without a filesystem layer, so the application must know how to manage the raw device. Unless an application such as a database has a specific reason to manage block storage directly, filesystem mode is the more natural choice for ordinary file storage.
What should you check when a PVC stays Pending?
Pending does not immediately mean something is broken. Narrow down the cause in this order:
Run `kubectl describe pvc <name> -n <namespace>` and inspect events and messages. Check the PVC name, namespace, requested capacity, and access mode first.
Run `kubectl get storageclass` to see whether the requested class exists and whether a provisioner is configured for dynamic provisioning. If the PVC omits a class, confirm how the cluster's default-class policy applies.
For static provisioning, compare the claim with available PVs: capacity must be at least the requested size, and the class, access mode, volume mode, and selector must match. A PV can be larger than requested, but a smaller one cannot satisfy the request.
With a StorageClass using `WaitForFirstConsumer`, binding may be delayed until a Pod exists and can be scheduled. Check scheduling constraints along with the volume's zone or topology. Setting `nodeName` directly on the Pod bypasses the scheduler and can leave the PVC Pending; with this mode, use scheduler inputs such as an appropriate node selector instead.
When diagnosing the issue, distinguish an unbound claim from a mount or attach failure reported in Pod events. A PVC can be Bound while a Pod still fails to start because of driver, permission, node-topology, filesystem, or mount problems. Deleting a PVC or PV before identifying the cause can lose data or make cleanup harder.
Does deleting a PVC delete the stored data?
What happens to a PV and its actual storage backend after a PVC is deleted depends on the PV's reclaim policy. A dynamically provisioned PV inherits the reclaimPolicy from its StorageClass; if the class does not specify one, the default is Delete. With a supported driver, Delete can remove both the Kubernetes PV object and the associated external storage asset. Check the PV and StorageClass policy before deleting a PVC.
Retain leaves the PV and backend storage after the PVC is deleted, but the old data remains, so the volume does not automatically become available for a new claim. An operator must decide how to preserve or clean up the data and whether to reuse the PV. Delete can simplify automatic cleanup, but it can also permanently remove data that needs to be recovered. Do not delete a production PVC until you have checked the storage policy and backup-and-recovery procedure. Recycle is deprecated and is no longer the recommended approach.
Protection finalizers can delay deletion while a Pod still uses a PVC or while a PV remains bound to a claim. This protection prevents an in-use object from disappearing immediately; it is not a backup or a substitute for data protection. Before deletion, separately verify Pod and PVC references, the reclaim policy, and whether a backup can actually be restored.
If the required capacity grows, you may be able to increase the PVC request after confirming that the StorageClass supports allowVolumeExpansion: true. Expansion also depends on the backend driver, and it cannot be used to shrink a volume. Do not edit the PV capacity directly in a way that makes the control plane assume expansion has already happened; use the PVC status and events to confirm completion.
In summary
A PV represents storage available to a cluster; a PVC is a namespaced request for that storage. A StorageClass and its CSI or other provisioner connect the request to the way storage is created, and a Pod references the PVC as a volume. In operation, check not only capacity, class, and access mode but also delayed binding, topology, reclaim policy, backup, and deletion effects. Healthy Kubernetes storage objects do not by themselves guarantee backend replication, backups, or disaster recovery.
References
Roles of PersistentVolume and PersistentVolumeClaim, binding, access modes, and reclaim policies
StorageClass provisioners, default reclaim policy, expansion, and binding modes
Dynamic volume provisioning with StorageClasses
Using volumes in Pods and the lifetime of ephemeral volumes
Scope: This article explains Kubernetes PersistentVolumes and PersistentVolumeClaims, StorageClasses, static and dynamic provisioning, PVC binding and Pod mounts, access modes, Pending diagnosis, expansion, and reclaim policies. Official Kubernetes documentation was checked on 2026-11-23. The manifests and commands are illustrative and were not run on a real cluster. StorageClass names, CSI capabilities, access modes, and deletion behavior can vary by installed driver and operator policy; verify them before applying changes. PVCs and PVs are not backups or replicas; validate data protection and recovery through the backend and a separate backup process.