Day 52 - Storage Classes in Kubernetes | Static vs Dynamic Volume Provisioning

About this video

### Summary of the Video Content: 1. **Introduction and Context**: - The video is part of the CK 2025 series, focusing on **storage classes** and **dynamic volume provisioning** in Kubernetes. - The demo is conducted on a **GKE (Google Kubernetes Engine)** cluster, but other platforms like AKS, EKS, or storage solutions like NFS can also be used. 2. **Static vs. Dynamic Volume Provisioning**: - **Static Provisioning**: - A storage admin pre-provisions **Persistent Volumes (PVs)**. - Users create **Persistent Volume Claims (PVCs)** to request storage from these pre-provisioned PVs. - PVCs are bound to PVs based on matching criteria like storage size and access mode. - **Dynamic Provisioning**: - No need to pre-create PVs. - Users create PVCs with a reference to a **StorageClass**. - Kubernetes dynamically creates a PV based on the StorageClass and binds it to the PVC. 3. **Why Use Storage Classes?**: - Different workloads have varying storage requirements (e.g., high-performance SSDs, cost-effective HDDs). - StorageClasses allow dynamic provisioning of storage without manual intervention, saving costs and improving efficiency. - Volumes are created only when needed and deleted when no longer required. 4. **Components of StorageClass**: - **Provisioner**: Defines how storage is provisioned (e.g., AWS EBS, GCP Persistent Disk, NFS). - **Parameters**: Configuration options for performance, durability, and cost. - **Reclaim Policy**: Specifies what happens to storage when the PV or PVC is deleted (e.g., retain, delete). 5. **How Dynamic Provisioning Works**: - A user creates a PVC referencing a StorageClass. - Kubernetes uses the provisioner specified in the StorageClass to create a PV dynamically. - The PV is then bound to the PVC. 6. **Demo Overview**: - Two StorageClasses are created: - **High Performance**: Uses `PD-SSD` (Premium Persistent Disk) for high-performance computing. - **Cost-Effective**: Uses `PD-Standard` (Standard Persistent Disk) for dev/test workloads. - Default StorageClass is updated to the cost-effective one using the `kubectl patch` command. 7. **Key Observations During the Demo**: - **Volume Binding Modes**: - `Immediate`: PV is created and bound immediately when the PVC is created. - `WaitForFirstConsumer`: PV is created and bound only after a pod requests the PVC. - A mismatch in binding modes caused delays in provisioning for the high-performance PVC. - Deleting a PVC with a `Retain` reclaim policy retains the associated PV, while creating a new PVC generates a new PV. 8. **Final Steps**: - Both static and dynamic provisioning scenarios were demonstrated. - The importance of cleaning up resources (e.g., deleting clusters) to avoid unnecessary costs was emphasized. 9. **Conclusion**: - The video covered the fundamentals of **PV**, **PVC**, and **StorageClass** from both theoretical and practical perspectives. - It aimed to prepare viewers for Kubernetes certification exams while providing hands-on experience with dynamic provisioning. ### Key Takeaways: - **StorageClass** simplifies storage management by enabling dynamic provisioning. - Understanding **volume binding modes** and **reclaim policies** is crucial for effective storage management. - Always clean up unused resources in cloud environments to avoid unexpected charges.


Course: Certified Kubernetes Administrator Full Course For beginners | CKA 2025

This playlist contains the complete CKA series for beginners, based on the latest 2025 curriculum. It includes 40+ videos with hands-on demos, assignments, and exam-based scenarios. We will cover everything from the basics to the Advanced, including fundamental concepts such as Docker, containers, Docker storage and networking, DNS, etc.

View Full Course