Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Native Storage Playground

A reproducible Proof of Concept demonstrating Kubernetes native persistent storage using StorageClass, PersistentVolume, PersistentVolumeClaim and a CSI driver.

License Open Source Status Kubernetes SPIFFE Association


📖 Overview

Kubernetes provides a native storage model that abstracts the underlying storage infrastructure through the Container Storage Interface (CSI).

This Proof of Concept demonstrates how Kubernetes dynamically provisions persistent storage using:

  • 📦 StorageClass
  • 💾 PersistentVolumeClaim (PVC)
  • 🗄️ PersistentVolume (PV)
  • 🐳 Pod volume mounting

The objective is to understand the complete lifecycle of persistent storage without relying on any application-specific configuration.


🏗️ Architecture

schema


🎯 Objective

This Proof of Concept demonstrates how Kubernetes natively manages persistent storage.

After completing this repository, you will understand:

  • ✅ how a StorageClass provisions storage dynamically;
  • ✅ how a PersistentVolumeClaim requests storage;
  • ✅ how Kubernetes automatically binds a PersistentVolume;
  • ✅ how a Pod consumes persistent storage;
  • ✅ why data persists after Pod recreation.

📋 Prerequisites

  • ☸️ Kubernetes v1.27 or later
  • 💽 A CSI driver supporting dynamic provisioning
  • 🔧 kubectl
  • 📦 A default StorageClass or adapt the provided manifests

⚙️ Installation

Deploy the StorageClass (if required):

kubectl apply -f k8s/storageclass.yaml

Create the PersistentVolumeClaim:

kubectl apply -f k8s/pvc.yaml

Deploy the demonstration Pod:

kubectl apply -f k8s/pod.yaml

🚀 Deployment

Verify that all resources are running:

kubectl get storageclass
kubectl get pv
kubectl get pvc
kubectl get pod

✔️ Verification

Create a file inside the mounted volume:

kubectl exec demo -- sh -c "echo OMSL > /data/demo.txt"

Display the file:

kubectl exec demo -- cat /data/demo.txt

Delete the Pod:

kubectl delete pod demo

Recreate it:

kubectl apply -f k8s/pod.yaml

Verify that the file still exists:

kubectl exec demo -- cat /data/demo.txt

🎉 If the file is still present, Kubernetes has successfully preserved the persistent data.


🧪 Testing

Display storage resources:

kubectl get storageclass
kubectl get pv
kubectl get pvc

Describe the PersistentVolumeClaim:

kubectl describe pvc demo-pvc

Inspect the mounted filesystem:

kubectl exec demo -- df -h /data

🎓 What You Will Learn

By completing this Proof of Concept, you will learn:

  • 📦 Kubernetes native storage architecture
  • ⚡ Dynamic volume provisioning
  • 🗄️ StorageClass concepts
  • 💾 PersistentVolume lifecycle
  • 📄 PersistentVolumeClaim lifecycle
  • 🐳 Pod volume mounting
  • 🔒 Persistent data across Pod recreation

🧹 Cleanup

Remove all deployed resources:

kubectl delete -f k8s/

📚 References


🏛 About OpenMind Systems Lab

OpenMind Systems Lab is an independent French non-profit association dedicated to research, experimental development and technical benchmarking in Cloud Native technologies.

Our mission is to produce practical, reproducible and educational Open Source Proofs of Concept covering Kubernetes, Platform Engineering, Distributed Messaging, Infrastructure Security and Artificial Intelligence.

GitHub Organization:

https://github.com/openmind-systems-lab


Made with ❤️ by OpenMind Systems Lab

About

A reproducible Proof of Concept demonstrating Kubernetes native persistent storage using StorageClass, PersistentVolume, PersistentVolumeClaim and a CSI driver.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors