Skip to main content
In this lesson, we’ll explore how StorageClasses enable dynamic volume provisioning in Kubernetes. If you’re familiar with static provisioning—where you manually create cloud disks and bind them via PersistentVolumes (PVs) and PersistentVolumeClaims (PVCs)—you’ll see how StorageClasses automate this workflow.

Table of Contents


Static Provisioning Recap

With static provisioning, you manually create the underlying cloud disk before you define a PV:
Then you define:
Static provisioning works, but each new disk requires manual cloud CLI steps. Maintenance and scaling can become cumbersome.

Dynamic Provisioning with StorageClass

With a StorageClass, Kubernetes can automatically create and bind a PV when you apply a PVC. This dynamic provisioning eliminates manual disk creation.

StorageClass Definition

Define a StorageClass that uses the GCE PD provisioner:

Using a Dynamic PVC and Pod

  1. Create a PVC that references your StorageClass:
  2. Deploy a Pod that mounts the PVC:
Kubernetes will then:
  1. Provision a new GCE PD of the requested size.
  2. Create a corresponding PV.
  3. Bind your PVC to that PV.
  4. Attach the volume to your Pod.

Comparing Provisioning Methods


Customizing StorageClass Parameters

Most provisioners let you fine-tune disks. For GCE PD, you can specify:
Be cautious with regional-pd: it offers high availability at higher cost. Always choose based on your SLA requirements.

Defining Service Tiers

You can create multiple StorageClasses to represent different performance tiers:
When you create a PVC, just set storageClassName to select your tier. Kubernetes handles provisioning and binding behind the scenes.

Mastering StorageClasses empowers you to build scalable, self-service storage in your Kubernetes clusters—no more manual volume management!

Watch Video