## BLOG 50: Available StorageClass Provisioner # 🎩 **1. NFS StorageClass β€” RWX, dynamic provisioning (already done)** ### Why demo it? * Best example of **ReadWriteMany** * Works on ANY cluster (on-prem, KinD, K3s) * Shows folder creation magic ✨ ### SC example: ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: nfs-client provisioner: k8s-sigs.io/nfs-subdir-external-provisioner reclaimPolicy: Delete ``` ### Cool demo ideas: * Two pods writing to same PVC * PVC fills up β†’ observe NFS behavior * Files show up instantly in NFS folder --- # 🧊 **2. HostPath Provisioner β€” simple, for single-node clusters** ### Why demo? * Shows how Kubernetes can use raw host filesystem * Easy to break, easy to fix, great for teaching * Perfect for **minikube/k3s** demos ### SC example: ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: hostpath provisioner: kubevirt.io/hostpath-provisioner reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer ``` ### Demo ideas: * Show PVC binding waits until Pod is scheduled * Open node path β†’ see automatically created folders --- # ⚑ **3. Local Persistent Storage (Local PV) β€” Fastest performance** ### Why demo? * Shows SSD/NVMe power * Demonstrates **node affinity** * Very realistic for bare-metal clusters ### StorageClass: ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: local-storage provisioner: kubernetes.io/no-provisioner volumeBindingMode: WaitForFirstConsumer ``` ### Local PV: ```yaml apiVersion: v1 kind: PersistentVolume metadata: name: local-pv-1 spec: volumeMode: Filesystem capacity: storage: 10Gi accessModes: - ReadWriteOnce storageClassName: local-storage local: path: /mnt/disks/disk1 nodeAffinity: required: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - k8s-node-1 ``` ### Demo ideas: * Show Pod scheduling to the specific node * Disable the node β†’ PVC becomes stuck --- # ☁️ **4. AWS EBS CSI StorageClass β€” cloud-native demo** Great when using **real AWS** or a mock environment. ### Why demo? * Shows cloud block volumes * Demonstrates `gp2`, `gp3`, `io2`, throughput settings ### Example (gp3): ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: gp3 provisioner: ebs.csi.aws.com parameters: type: gp3 iops: "3000" throughput: "125" reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer ``` ### Demo ideas: * Explain difference in performance parameters * Use small pods to benchmark IOPS --- # πŸ”₯ **5. Ceph RBD (rook) β€” highly scalable storage** ### Why demo? * Production-grade * Amazing for showing replicating block storage * Shows how CSI drivers work * Very popular in on-prem clusters ### SC example: ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: rook-ceph-block provisioner: rook-ceph.rbd.csi.ceph.com parameters: clusterID: rook-ceph pool: replicapool imageFeatures: layering reclaimPolicy: Delete allowVolumeExpansion: true ``` ### Demo ideas: * Expand a PVC live (e.g., 1Gi β†’ 5Gi) * Kill OSDs β†’ show Ceph healing itself --- # ♻️ **6. GlusterFS StorageClass β€” distributed, expandable** ### SC example: ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: gluster-heketi provisioner: kubernetes.io/glusterfs parameters: resturl: "http://heketi-storage.gluster.svc:8080" ``` ### Demo idea: * Show automatic provisioning across nodes --- # 🧊 **7. Longhorn Storage β€” cloud-native block storage for on-prem** ### Why demo? * Nice dashboard * Self-healing * Snapshots, backups built-in ### SC example: ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: longhorn provisioner: driver.longhorn.io allowVolumeExpansion: true reclaimPolicy: Delete ``` ### Demo: * Damage nodes β†’ volume self-replicates * Show backup/restore --- # 🏰 **8. OpenEBS β€” per-workload storage engine** ### Engines you can demo: * Jiva * cStor * LocalPV ### SC example (OpenEBS Jiva): ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: openebs-jiva provisioner: jiva.csi.openebs.io ``` --- # 🌊 **9. CSI HostPath Driver β€” CSI demo for teaching** Great for explaining CSI because it’s tiny and simple. ### SC: ```yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: csi-hostpath-sc provisioner: hostpath.csi.k8s.io ``` --- # πŸŒ• **10. EmptyDir vs PersistentVolume demo** Even though `emptyDir` is not a StorageClass, it's a PERFECT compare-demo: ### Demo: * Kill a pod β†’ see `emptyDir` wiped * PVC persists This explains storage persistence beautifully. --- # ⭐ **Recommended Combination for a Powerful Demo Set** | Storage Type | What It Shows | | --------------- | ------------------------------- | | **NFS** | RWX, dynamic provisioning | | **HostPath** | Basic provisioning on on-prem | | **LocalPV** | Node affinity + fastest storage | | **EBS (Cloud)** | Cloud block volumes | | **Longhorn** | Cloud-native features | | **EmptyDir** | Ephemeral storage | This covers **100% of what students / trainees / clients want to see.**