# Understanding Kubernetes: Part 11 -Persistent Volume (PV)

<figure><img src="https://miro.medium.com/v2/resize:fit:840/1*Hk1wrSLRWpZgM99yCueXYQ.png" alt="" height="394" width="700"><figcaption></figcaption></figure>

> If you’ve been following our **Kubernetes series 2025**, welcome back! For new readers, check out Part 10: [**Understanding Kubernetes: StorageClass**](https://medium.com/@techwithpatil/understanding-kubernetes-part-10-storageclass-9aeadec5817c)

📖 **Not a Medium member?** No worries! Here’s the free link: [**Part 11-StorageClass**](https://blog.techwithpatil.com/blogs/medium-articles/kubernetes-series-2025/understanding-kubernetes-part-10-storageclass)

## What is a Persistent Volume (PV) in Kubernetes? <a href="#c32c" id="c32c"></a>

A Persistent Volume (PV) in Kubernetes is a storage resource that exists independently of pods and provides a way to store data persistently. Unlike ephemeral pod storage, a PV allows data to persist even if the pod is deleted or restarted. It abstracts the underlying storage system, such as NFS, AWS EBS, or local disks, and provides a unified way to manage storage in Kubernetes.

### For example: <a href="#id-187e" id="id-187e"></a>

If you have an application that requires a database, like MySQL, the database data must be retained across restarts. A Persistent Volume ensures that the data is stored on durable storage, allowing the database to recover its state after any disruption.

### Persistent Volume Capabilities: <a href="#d6d9" id="d6d9"></a>

* **Abstraction**: Supports multiple storage backends (e.g., local disks, cloud storage).
* **Decoupled from Pods**: A PV exists independently of pods, providing persistent storage.
* **Access Modes**: Supports `ReadWriteOnce`, `ReadOnlyMany`, or `ReadWriteMany` for different usage scenarios.
* **Lifecycle Management**: A PV is provisioned and bound to Persistent Volume Claims (PVCs) by users or dynamically created by storage classes.

### In my previous role: <a href="#id-7b84" id="id-7b84"></a>

As a Senior DevOps Engineer, I used Persistent Volumes to manage storage for our Jenkins CI/CD setup. Jenkins required durable storage for build artifacts and configurations. I configured an NFS-backed Persistent Volume, which ensured data availability across pod restarts. By combining PVs with Persistent Volume Claims, I provided teams with seamless access to shared storage while maintaining strict isolation between workloads. This setup ensured high reliability for our build and deployment processes.

### Here’s a simple YAML for a Persistent Volume: <a href="#id-877f" id="id-877f"></a>

```
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-storage
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /mnt/data
```

This Persistent Volume provides 10GB of storage with a `ReadWriteOnce` access mode. The `hostPath` configuration binds it to the `/mnt/data` directory on the host machine, ensuring durability for applications like databases or CI/CD pipelines. This makes PVs an essential component for persistent storage in Kubernetes.

## 🚀 Ready to Master Kubernetes? <a href="#c6e4" id="c6e4"></a>

Take your Kubernetes journey to the next level with the **Master Kubernetes: Zero to Hero course!** 🌟 Whether you’re a beginner or aiming to sharpen your skills, this hands-on course covers:

✅ Kubernetes Basics — Grasp essential concepts like nodes, pods, and services.\
✅ Advanced Scaling — Learn HPA, VPA, and resource optimization.\
✅ Monitoring Tools — Master Prometheus, Grafana, and AlertManager.\
✅ Real-World Scenarios — Build production-ready Kubernetes setups.

🎓 **What You’ll Achieve**

💡 Confidently deploy and manage Kubernetes clusters.\
🛡️ Secure applications with ConfigMaps and Secrets.\
📈 Optimize and monitor resources for peak performance.

🔥 Start Learning Now: \[Join the Master Kubernetes Course]\([**https://cloudops0.gumroad.com/l/k8s**](https://cloudops0.gumroad.com/l/k8s))

Don’t miss your chance to become a Kubernetes expert! 💻✨

🚀 Stay ahead in DevOps and SRE! 🔔 [**Subscribe now**](https://techwithpatil.medium.com/subscribe) and never miss a beat on Kubernetes and more. 🌟
