Kubernetes Deep Dive

Sign Up Free or Log In to participate!

Is Storage Class optional? How does SC helps and what is it basically used for when we have PV? What are roles of SC and PV?

Is Storage Class optional? As I understood PV can copy the volume from actual storage via CSI and PVC retrieves the required data from the PV instead of directly going to Storage as PODs are ephemeral. How does SC helps and what is it basically used for when we have PV.

2 Answers

with PV you have to have provisioned the storage on your storage provider, but SC dynamically provisions that for you

StorageClass is just a higher level of abstraction over PersistentVolumes (PV).

Think of them as a plugin to the cloud-provided storage (either aws s3/ebs, gcp gcs/pd). You put in the parameters of the StorageClass, then just reference the storageClassName in PersisentVolumeClaim and PersistentVolume.

In term, say whenever a Pod is deployed .. it will trigger a PV which in turn talks to the StorageClass.

The StorageClass has a provisioner type, which essentially points to the volume plugin. So something more concrete:


kind: StorageClass

apiVersion: storage.k8s.io/v1

metadata:

  name: fast

provisioner: kubernetes.io/aws-ebs

parameters:

  type: io1

  zones: us-west-1

  iopsPerGB: "10"

https://kubernetes.io/docs/concepts/storage/storage-classes/

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?