Provision Volume Using an Existing StorageClass
Explore how to use StorageClasses to dynamically provision persistent volumes in Kubernetes, particularly on Google Kubernetes Engine. Understand StorageClass configurations, reclaim policies, and volume binding modes to effectively manage storage in production environments. Learn to create Persistent Volume Claims and Pods that trigger volume provisioning, and verify resource lifecycle on Google Cloud.
We'll cover the following...
In this and the next lesson, we’ll use StorageClasses to dynamically provision volumes on external systems. These lessons will only work on Regional GKE clusters. Refer to the Getting Kubernetes chapter on how to create a cluster on GKE. Every cloud and storage system has its own CSI plugin and configuration options; we can’t create examples for them all. Don’t be upset if you don’t have a Regional GKE cluster; you’ll still learn a lot by reading through the demos.
Use the following widget to execute all the commands for this lesson.
apiVersion: v1
kind: Pod
metadata:
name: volpod
spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: pvc-prem
containers:
- name: ubuntu-ctr
image: ubuntu:latest
command:
- /bin/bash
- "-c"
- "sleep 60m"
volumeMounts:
- mountPath: /data
name: data