Kubernetes : Storage Classes



For the pods, we could have different types of storage classes that differ in speed, performance and other characteristic, like their policies, labels,...

We could have Storage classes with SSD, NVMe or NFS for example.


Applications could then "claim" storage depending on their need.
We could label storage classes, so its easier to choose among them.

For example, we could have "Fast SSD" or "Slow SATA drives" as labels.

We can list the storage classes using the below command:


The provisioner provisions PVs - persistent volumes for the pods - from the storage class.

The default storage class is mentioned in the annotations.
Below is a simple example of a storage class Yaml file:


Remark:

The parameter "type" is specific to the provisioner.

The provisioner name could be for example " kubernetes.io/gce-pd" which provisions "gce-pd" storage, or "kubernetes.io/aws-ebs" for AWS.

We could see that its the default storage class in the annotations.
The default storage class is used to provision storage, if the claim -  PVCfor the storage doesn’t mention the storage class to use.

Below a simple example of a storage claim that doesn't include a storage class
The default one will be used.


Comments

Leave as a comment:

Archive