On AWS, there are several different types of volume available that offer different price and performance characteristics.
In order to provide a simple way to choose the volume type (and some other settings) when we provision a volume, we create a StorageClass object that we can then refer to by name when we create PersistentVolumeClaim.
Storage classes are created in the same way as any other Kubernetes objects, by submitting manifests to the API using kubectl:
kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: general-purpose annotations: "storageclass.kubernetes.io/is-default-class": "true" provisioner: kubernetes.io/aws-ebs parameters: type: gp2
This manifest creates a storage class called general-purpose that creates volumes with the gp2 volume type. If you remember our discussion about EBS volume types in...