PersistentVolume

Also known as: persistent volume

On this page 8

A PersistentVolume (PV) is a cluster-level Kubernetes resource that represents a piece of provisioned storage, such as a cloud block disk, an NFS export or a local SSD, with a lifecycle that is independent of any Pod. In Kubernetes, it is the object that lets stateful applications keep their data when containers restart, move to another node or are replaced during a rollout.

A persistent volume is never consumed directly by a Pod. Instead, an application requests storage through a PersistentVolumeClaim (PVC), and the control plane binds the claim to a matching volume. This separation lets platform teams manage storage infrastructure while developers simply declare how much capacity and which access pattern they need.

How a PersistentVolume fits the Kubernetes storage model

A PersistentVolume is the supply side of Kubernetes storage: it describes real capacity that exists outside the Pod, while the PVC describes demand. The PV object records the capacity, access modes, reclaim policy, storage class and the backend details, usually a reference to a Container Storage Interface (CSI) driver and a volume handle.

When a Pod that references a bound claim is scheduled, the kubelet on the chosen node asks the CSI driver to attach the backing device and mount it into the container path. If the Pod is deleted and recreated on another node, the volume is detached and reattached, so the data outlives the container. Ordinary emptyDir volumes, by contrast, disappear with the Pod.

PersistentVolumes are not namespaced, whereas PVCs are. This design keeps physical storage a shared cluster asset and lets RBAC restrict who may create or inspect volumes, while application teams operate only on claims inside their own Kubernetes namespace.

Static and dynamic provisioning

Kubernetes supports two ways of creating PersistentVolumes, and the choice determines who does the provisioning work. Modern clusters rely almost entirely on dynamic provisioning, but static volumes remain useful for existing data.

ApproachWho creates the PVTypical use
Static provisioningAdministrator, ahead of timeExisting NFS shares, migrated disks, preloaded datasets
Dynamic provisioningCSI driver, triggered by a PVCDefault for cloud block storage and most new workloads
Pre-bound volumeAdministrator, with a claimRefReserving a specific volume for one claim
Provisioning approaches compared

Dynamic provisioning depends on a StorageClass, which names the provisioner and its parameters, such as disk type, IOPS tier or file system. When a claim references the class, the driver creates the backend disk and a matching PV automatically. Setting the volumeBindingMode to WaitForFirstConsumer delays creation until a Pod is scheduled, which prevents a zonal disk from appearing in a zone where the Pod cannot run.

Access modes, reclaim policies and volume modes

Three fields on a PersistentVolume define how it can be mounted and what happens after use. Misreading them is one of the most frequent causes of failed deployments.

Access modeMeaningTypical backend
ReadWriteOnce (RWO)Read-write by Pods on a single nodeCloud block disks, iSCSI
ReadOnlyMany (ROX)Read-only by many nodesShared datasets, NFS
ReadWriteMany (RWX)Read-write by many nodesNFS, CephFS, managed file services
ReadWriteOncePod (RWOP)Read-write by exactly one PodCSI block volumes needing strict exclusivity
Access modes and their meaning

Access modes describe capabilities, not enforcement of locking: RWO permits several Pods on the same node to mount the volume, which surprises teams that expect single-writer behavior. RWOP closes that gap for workloads that must guarantee one writer.

The reclaim policy decides what happens when the claim is deleted. Delete, the default for most dynamic classes, removes the backend disk and its data. Retain keeps the disk and leaves the PV in a Released state for manual recovery. The volume mode chooses between a mounted Filesystem and a raw Block device for databases that manage storage themselves.

PersistentVolume lifecycle phases

Every PersistentVolume moves through a small set of phases that the control plane reports in its status. Reading the phase is the first diagnostic step when storage misbehaves.

PhaseMeaningNext step
AvailableFree and not bound to a claimWaits for a matching PVC
BoundExclusively bound to one claimUsed by Pods referencing the claim
ReleasedClaim deleted, data still presentManual cleanup or rebinding under Retain
FailedAutomatic reclamation failedInvestigate the driver and backend
Phases of a PersistentVolume

Binding is one-to-one and exclusive: a bound PV cannot serve a second claim, even if it has spare capacity. A released volume under the Retain policy also does not return to Available on its own; an administrator must clear the old claimRef deliberately, which protects data from accidental reuse.

PersistentVolumes with StatefulSets and other workloads

A StatefulSet is the workload type most closely paired with PersistentVolumes. Its volumeClaimTemplates create one claim per replica, so each database member keeps its own volume with a stable name across rescheduling. A Deployment, by contrast, shares one claim among all replicas, which suits only RWX storage or single-replica applications.

  • Volume expansion is possible when the StorageClass sets allowVolumeExpansion, by editing the claim size; shrinking is not supported.
  • Volume snapshots through the CSI snapshot API capture point-in-time copies that can seed new claims.
  • Topology constraints pin zonal disks to nodes in the same availability zone, which affects scheduling during outages.

Common mistakes and failure modes

Most PersistentVolume incidents trace back to policy defaults and topology, not to the storage hardware. The table lists recurring symptoms with their usual causes.

SymptomLikely causeFix
PVC stays PendingNo matching PV or missing StorageClassCheck class name, capacity and access mode
Pod stuck in ContainerCreatingVolume still attached to an old nodeWait for detach or resolve the stale attachment
Data lost after deleting a releaseReclaim policy was DeleteUse Retain for critical data and back up
Pod unschedulable after node failureZonal disk in a zone without capacitySpread replicas and plan zone capacity
Symptoms, causes and fixes

The most expensive mistake is treating a PersistentVolume as a backup. Replication inside a cloud disk protects against hardware failure, not against deletion, corruption or ransomware, so production data still needs independent snapshots or backups stored outside the cluster.

The idea in brief

Containers in Kubernetes are temporary by design. When one stops, anything it saved inside itself is gone. A PersistentVolume is a storage space that stays when the container goes away.

Think of it as a rented storage locker. The application asks for a locker of a certain size, Kubernetes hands over the key, and whichever container holds the key later can open the same locker and find the same data still there.

A practical scenario

An online retailer runs a PostgreSQL cluster of three replicas on a managed Kubernetes service. The platform team defines a StorageClass for SSD block disks with WaitForFirstConsumer binding, the Retain reclaim policy and volume expansion enabled. A StatefulSet requests a 200 GiB ReadWriteOnce claim per replica, and the CSI driver provisions one disk in each zone where a replica is scheduled.

During a node failure, the primary database Pod is rescheduled to another node in the same zone, the disk is reattached and the database restarts with no data loss within about two minutes. Months later, ahead of a seasonal sales peak, the team expands each claim to 400 GiB online by editing the PVC, without downtime. When an engineer later deletes the StatefulSet by mistake, the Retain policy keeps all three disks, and the cluster is restored from the released volumes the same afternoon.