Skip to content
tezvyn:
Menu

What is a StorageClass and dynamic provisioning?

Source: interviewMediumHow cards are made

Summary

dynamic provisioning.

Key points

a StorageClass names a provisioner and parameters; a PVC referencing it triggers on-demand PV creation, so admins do not pre-create volumes.

What's really being asked

Whether you understand how Kubernetes automates storage creation and how that contrasts with manually pre-creating volumes.

The full answer

A StorageClass is an admin-defined template describing a category of storage. It names a provisioner, typically a CSI driver, sets backend-specific parameters such as disk type or IOPS, and specifies a reclaimPolicy and a volumeBindingMode like WaitForFirstConsumer. In static provisioning, an administrator must manually create a PersistentVolume for each anticipated need, and PVCs bind only if a matching PV already exists, which does not scale and wastes capacity. With dynamic provisioning, a PVC simply references a StorageClass by name; the control plane invokes that class's provisioner, which creates the underlying disk and a corresponding PV sized to the claim, then binds them automatically. This means developers request storage self-service and the right volume appears without any manual admin step, while WaitForFirstConsumer can delay provisioning until a Pod is scheduled so the disk lands in the correct zone.

The mistakes people make

Thinking the StorageClass stores the data itself. Believing volumes always must be pre-created. Ignoring the provisioner field. Forgetting volumeBindingMode and its impact on zone-aware scheduling.

What usually comes next

What does WaitForFirstConsumer solve? How does the default StorageClass work? Can you set allowVolumeExpansion? How does the reclaimPolicy on a StorageClass propagate to dynamically created PVs?

A concrete example

An admin creates a StorageClass named fast with provisioner ebs.csi.aws.com and type gp3; a developer's PVC sets storageClassName fast and requests 50Gi; the CSI driver provisions a 50Gi gp3 volume and a PV, binding it automatically with no manual admin action.

Interview question

What does referencing a StorageClass in a PVC accomplish compared to static provisioning?

  • a.It stores the PVC's data inside the StorageClass object
  • b.It encrypts the volume contents automatically
  • c.It triggers a provisioner to create a matching PV on demandCorrect
  • d.It requires an admin to pre-create a matching PV first
Why?

A StorageClass names a provisioner that dynamically creates a PV and backing disk when a PVC requests it, eliminating manual pre-provisioning. The StorageClass holds no data, and dynamic provisioning is precisely what avoids hand-creating PVs.

Just read this? Test yourself on what you have been reading.

Read the original → kubernetes.io

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on kubernetes — each one lists the topics its interview covers.

See open roles