Kubernetes Storage: PV vs PVC Explained

Kubernetes Storage: PV vs PVC Explained

Kubernetes Storage: PV vs PVC Explained

Kubernetes applications often need storage that remains available even when a Pod is restarted or recreated. This is where PersistentVolume (PV) and PersistentVolumeClaim (PVC) come into play.

💾 What is a PersistentVolume (PV)?

A PersistentVolume (PV) is a storage resource available inside a Kubernetes cluster.

It can use different storage backends such as:

  • NFS
  • AWS EBS
  • Azure Disk
  • Cloud storage solutions

A PV defines properties such as capacity, access modes, storage class, and reclaim policy.

Think of PV as the actual storage available to the cluster.

📋 What is a PersistentVolumeClaim (PVC)?

A PersistentVolumeClaim (PVC) is a request for storage made by an application or user.

For example, an application might request:

  • 10 GB of storage
  • ReadWriteOnce access
  • A specific StorageClass

Kubernetes then finds an appropriate PV or dynamically provisions one and binds it to the PVC.

Think of PVC as a request for the storage you need.

🔄 How PV and PVC Work Together

The typical flow is:

Storage → PV → PVC → Pod

  1. Storage is made available to Kubernetes.
  2. A PV represents that storage.
  3. An application creates a PVC.
  4. Kubernetes binds the PVC to a suitable PV.
  5. The Pod mounts the PVC and uses the storage.

🏠 Simple Example

Think of it like renting a house:

PV = Available house 🏠
PVC = Request for a suitable house 📋
Pod = Person using the house 👤

🚀 Final Thoughts

PV and PVC provide a clean separation between storage infrastructure and applications. Developers can request the storage they need without having to manage the underlying storage system directly.

Remember: PV is the storage resource; PVC is the request for that storage.

Tags: Kubernetes, PV, PVC, PersistentVolume, PersistentVolumeClaim, DevOps, Cloud Computing, Docker, Azure, AWS, Kubernetes Storage, Cloud Native.

Powered by Blogger.