Using Storage Classes to Dynamically Provision PersistentVolumes
Explore how to use StorageClasses in Kubernetes for dynamic provisioning of PersistentVolumes in an AWS environment. Understand the differences between static and dynamic volume provisioning, how StorageClasses simplify storage claims, and how dynamic provisioning automatically creates and deletes storage based on PersistentVolumeClaims. This lesson helps you manage storage efficiently in Kubernetes clusters while leveraging AWS features.
Static volume provisioning
So far, we’ve used static PersistentVolumes. We had to create both EBS volumes and Kubernetes PersistentVolumes manually. Only after both became available were we able to deploy Pods that mounted those volumes through PersistentVolumeClaims. We’ll call this process static volume provisioning.
In some cases, static volume provisioning is a necessity. Our infrastructure might not be capable of creating dynamic volumes. That is often the case with on-premise infrastructure with volumes based on Network File System (NFS). Even then, with a few tools, a change in processes, and the right choices for supported volume types, we can often reach the point where volume provisioning is dynamic. Still, that might prove to be a challenge with legacy processes and infrastructure.
Since our cluster is in AWS, we cannot blame legacy infrastructure for provisioning volumes manually. Indeed, we could have jumped straight into this section. After all, AWS is all about dynamic infrastructure management.
However, we felt it would be easier to understand the processes by exploring manual provisioning first. The knowledge we obtained will help us understand better what’s coming next.
The second reason is that we may run a Kubernetes cluster on infrastructure ...