Provision Volume by Creating a New StorageClass
Explore how to create and deploy a new StorageClass in Kubernetes to dynamically provision persistent volumes using fast SSD storage. Understand the process of defining storage properties, deploying PVCs and Pods, and managing volumes with reclaim policies to retain data after deletion. This lesson helps you gain practical skills in Kubernetes storage management and dynamic provisioning.
We'll cover the following...
Create and use a new StorageClass
In this lesson, we’ll create a new StorageClass and use it to dynamically provision and use a new volume.
Use the following widget to execute all the commands for this lesson.
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: sc-fast-repl provisioner: pd.csi.storage.gke.io parameters: type: pd-ssd replication-type: regional-pd volumeBindingMode: WaitForFirstConsumer reclaimPolicy: Retain
We’ll create the StorageClass defined in the sc-gke-fast-repl.yml file in the storage folder. It defines a StorageClass called sc-fast-repl with the following properties:
Fast SSD storage (
type: pd-ssd)Replicated (
replication-type: regional-pd) ...