Learn how to use Kubernetes Persistent Volumes (PVs) and Persistent Volume Claims (PVCs) in this Minikube hands-on demo. Pods in Kubernetes are temporary, but with persistent storage you can keep your data safe even after restarts or deletions. In this tutorial, you’ll see how to create PVs and PVCs, mount them in Pods, test data persistence, and troubleshoot common issues like PVC stuck in Pending or Terminating, and PV stuck in Failed state. Perfect for developers, DevOps engineers, and system administrators who want to understand Kubernetes storage step by step.
👉 Watch the theory explanation of Persistent Volumes & PVCs here: [ • 23. Kubernetes Persistent Volumes & PVC Ex... ]
✔️ Start Minikube & clean setup
✔️ Create Persistent Volume & PVC
✔️ Mount PVC in Pod & write data
✔️ Test persistence after Pod deletion
✔️ Reclaim policies: Retain vs Delete
✔️ Fix stuck PVCs & PVs like a pro
📌 Commands Used in This Video
minikube start --driver=docker
kubectl delete all --all --all-namespaces
kubectl delete pvc --all --all-namespaces
kubectl delete pv --all
kubectl apply -f pv.yaml
kubectl apply -f pvc.yaml
kubectl delete pvc demo-pvc
kubectl exec -it demo-pod -- sh
kubectl patch pvc demo-pvc -p '{"metadata":{"finalizers":null}}'
kubectl patch pv demo-pv -p '{"spec":{"persistentVolumeReclaimPolicy":"Delete"}}'
kubectl edit pv demo-pv
📚 Chapters
0:00 🎬 Intro to PV & PVC Demo
0:50 📋 Demo Plan & Goals
1:21 🛠️ Minikube Setup & Cleanup
4:53 🗄️ Creating a Persistent Volume (PV)
9:17 📝 Creating a Persistent Volume Claim (PVC)
11:38 ⚠️ Troubleshooting a Stuck PVC
13:59 🚀 Creating and Mounting the Pod
16:45 🔄 Testing Data Persistence Across Pod Deletion
19:32 🗑️ Deleting PVC & Reclaim Policy
23:14 💬 Troubleshooting a Stuck PV
27:30 🔁 Demo Recap & Summary
28:11 👋 Outro
🔥 Master Kubernetes storage in minutes and take your DevOps skills to the next level!
👉 Subscribe for more tutorials and leave your thoughts in the comments below.
🎓 Continue Learning with These Playlists :
🐧 Linux for Beginners (Start from scratch):
👉 [Watch the Playlist]( • Linux for Beginners 🐧 )
💻 Linux Command Line Tutorials (Terminal-focused skills):
👉 [Explore Commands]( • Linux Command )
🚀 Kubernetes Series for Admins and Devs :
👉 [Start Learning Kubernetes]( • Kubernetes )
---
🔔 Subscribe for more tutorials :
👉 [@TechOpsTutorials]( / @techopstutorials )
#Kubernetes #DevOps #PersistentVolume