Persistent Volumes and Claims: Managing Kubernetes Storage
Learn how to use Persistent Volumes (PV) and Claims (PVC) to decouple storage infrastructure from your applications in Kubernetes for reliable, durable data.

Previously in this course, we explored Persistent Storage Basics: Using Volumes in Kubernetes, where we touched on ephemeral storage and basic hostPath volumes. While those work for local testing, they are tied to specific nodes and lack the flexibility required for production environments.
In this lesson, we introduce the PersistentVolume (PV) and PersistentVolumeClaim (PVC) pattern. This abstraction layer is the industry standard for managing storage in Kubernetes, allowing developers to request resources without needing to know the underlying infrastructure details—be it AWS EBS, Google Persistent Disk, or an NFS server.
Understanding the PV and PVC Abstraction
In Kubernetes, managing storage is a two-way street:
- PersistentVolume (PV): A piece of storage in the cluster that has been provisioned by an administrator. It is a resource in the cluster, just like a Node. It exists independently of any individual Pod.
- PersistentVolumeClaim (PVC): A request for storage by a user. It is similar to a Pod; just as Pods consume node resources (CPU/RAM), PVCs consume PV resources.
This Abstraction allows for a clean separation of concerns. An infrastructure engineer manages the PVs (the "supply"), while a developer creates a PVC (the "demand") to attach storage to their application.
The Lifecycle of Storage
When a developer creates a PVC, Kubernetes searches for a PV that matches the request (size, access mode, etc.). Once a match is found, the PV is "bound" to the PVC. If no PV is available, the PVC stays in a Pending state until a matching volume is created.
Worked Example: Creating a PV and PVC

Let's create a static volume. For this example, we'll define a simple local volume.
Step 1: Create the PersistentVolume
Save this as pv.yaml. This acts as our storage pool.
YAMLapiVersion: v1 kind: PersistentVolume metadata: name: my-pv spec: capacity: storage: 1Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: /mnt/data
Apply it with kubectl apply -f pv.yaml. You've now defined the resource.
Step 2: Create the PersistentVolumeClaim
Now, the application developer creates a request. Save this as pvc.yaml.
YAMLapiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi
Apply it with kubectl apply -f pvc.yaml.
Check the status with kubectl get pvc. You should see my-pvc in the Bound state, linked to my-pv.
Hands-on Exercise
- Inspect: Run
kubectl get pvandkubectl get pvc. Observe the status and theCAPACITYfield. - Modify: Change the
storagerequest in yourpvc.yamlto2Gi. Apply it. Notice that the PVC remains inPendingbecause the PV only provides1Giand cannot satisfy the request. - Delete: Delete the PVC (
kubectl delete pvc my-pvc). Check the status of the PV. Because we set thepersistentVolumeReclaimPolicytoRetain, the PV is not deleted; it remains in aReleasedstate, preserving your data.
Common Pitfalls
- Size Mismatch: If your PVC requests more storage than the PV offers, they will never bind.
- Access Mode Conflicts: If your PV is configured as
ReadOnlyManybut your Pod attempts to write to it, you will encounter permission errors. Always match the access mode to your application's needs. - Namespace Scoping: Remember that PVCs are namespaced, while PVs are cluster-wide. You can only use a PVC from the same namespace where it was created.
- Reclaim Policy: Using
Deleteas a reclaim policy will automatically remove the underlying storage when the PVC is deleted. Be cautious in production;Retainis often safer for critical data.
FAQ
Q: Do I need to manually create a PV every time? A: Not necessarily. In most cloud environments, we use StorageClasses to perform "Dynamic Provisioning," which creates the PV automatically when a PVC is requested. We will cover this in the next lesson.
Q: Can multiple Pods share a PVC?
A: Yes, if the access mode is ReadOnlyMany or ReadWriteMany. However, for standard block storage (like most cloud disks), only one Pod can use a ReadWriteOnce volume at a time.
Recap
We have successfully decoupled storage from infrastructure by using the PV/PVC pattern. You’ve learned that the PV represents the physical storage, the PVC represents the claim for that storage, and how to verify their binding status. This abstraction is essential for building portable, resilient applications that can survive Pod restarts and rescheduling.
Up next: Dynamic Provisioning — we will learn how to automate storage creation using StorageClasses so you don't have to manually provision PVs ever again.
Work with me

Custom Email & File Storage System on Cloudflare (Google Workspace Alternative)
Your own private email + file storage suite on your domain — unlimited mailboxes, no per-seat fees. A self-owned Google Workspace alternative for a flat ~$5/month.

CI/CD Pipeline & Docker Containerization
Ship with confidence: automated CI/CD pipelines and Docker setups so every push is tested and deployed — no more manual, error-prone releases.


