Storage Classes and Dynamic Provisioning
Look at storage classes’ YAMLs and how to implement them.
We'll cover the following...
Storage classes are resources in the storage.k8s.io/v1 API group. The resource type is StorageClass, and we define them in regular YAML files. We can use the sc short name when using kubectl.
Note: We can run a
kubectl api-resourcescommand to see a full list of API resources and their short names. It also shows each resource’s API group and what its equivalentkindis.
As the name suggests, StorageClasses let us define different classes of storage that apps can request. How we define our StorageClasses is up to us and will depend on the types of storage we have available. For example, if we have a storage system with fast and slow storage, as well as optional remote replication, we might define these four classes:
fast-localfast-replicatedslow-localslow-replicated
Let’s look at an example.
A StorageClass YAML
The following YAML defines a StorageClass object called fast-local that will provision encrypted SSD volumes capable of 10 IOPs per gigabyte from the Ireland AWS region.
As with all Kubernetes YAML files, kind and ...