100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Kubernetes

Storage Classes

Understand how StorageClass objects define provisioners, parameters, and policies that govern how storage is dynamically created in Kubernetes.

StorageIntermediate8 min readJul 10, 2026
Analogies

What a StorageClass Represents

A StorageClass is a cluster-scoped object that describes a 'class' or tier of storage an administrator offers, such as 'fast-ssd' or 'archive-hdd'. It names a provisioner (like ebs.csi.aws.com or the older kubernetes.io/gce-pd) and a set of provisioner-specific parameters (disk type, IOPS, filesystem type, encryption keys). Instead of admins pre-creating dozens of PVs by hand, a StorageClass lets the system create the exact right volume on demand whenever a PVC references that class, which is the foundation of dynamic provisioning.

🏏

Cricket analogy: A StorageClass is like a stadium's tiered pitch menu — 'green seamer pitch' vs 'dry turner' — where groundstaff prepare the exact pitch type requested rather than curators guessing in advance.

Default StorageClass and Volume Binding Mode

A cluster can mark one StorageClass as default via the annotation storageclass.kubernetes.io/is-default-class: 'true'; any PVC that omits storageClassName then uses it automatically. The volumeBindingMode field controls timing: Immediate provisions the volume as soon as the PVC is created, while WaitForFirstConsumer delays provisioning until a Pod using the PVC is scheduled, which is essential in multi-zone clusters so the volume is created in the same availability zone as the node the Pod lands on, avoiding cross-zone attach failures.

🏏

Cricket analogy: WaitForFirstConsumer is like not rolling the pitch until the toss decides which end teams will bowl from, ensuring preparation matches the actual match conditions rather than guessing early.

yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast-ssd
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: ebs.csi.aws.com
parameters:
  type: gp3
  iops: "4000"
  throughput: "250"
  encrypted: "true"
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer

Setting allowVolumeExpansion: true on a StorageClass lets you grow a PVC later by simply editing its requests.storage field — the CSI driver resizes the underlying volume, and for many filesystems (ext4, xfs) the filesystem itself expands online without a Pod restart.

  • A StorageClass defines a provisioner and parameters for creating storage on demand.
  • Marking a class default means PVCs without storageClassName use it automatically.
  • volumeBindingMode: WaitForFirstConsumer delays provisioning until Pod scheduling, avoiding cross-zone mismatches.
  • allowVolumeExpansion enables growing PVC size after creation.
  • reclaimPolicy on the StorageClass becomes the default for PVs it dynamically creates.
  • Different StorageClasses can represent tiers like fast-ssd, standard-hdd, or archive-cold.

Practice what you learned

Was this page helpful?

Topics covered

#Kubernetes#AdvancedKubernetesStudyNotes#DevOps#StorageClasses#Storage#Classes#StorageClass#Represents#OOP#StudyNotes#SkillVeris