Course contentsShow
← Cloud and Infrastructure
Lesson 1322 of 2,98926. Kubernetes StorageFree lesson

Volume Expansion with CSI

Dynamically expanding persistent volumes online using CSI driver capabilities and allowVolumeExpansion flag.

Volume Expansion with CSI

You'll learn how to grow persistent volumes on-the-fly without disrupting your running applications using CSI driver features.

What Is Volume Expansion with CSI?

Volume expansion lets you increase the size of a PersistentVolume after it's already been created and is in use. With CSI (Container Storage Interface) drivers, this can happen online — meaning your pods keep running while the storage grows. It's like adding more space to your apartment without having to move out.

How It Works

For volume expansion to work with CSI, two things must be true:

  1. The StorageClass must enable expansion — Set allowVolumeExpansion: true in the StorageClass definition
  2. The CSI driver must support it — Not all storage backends can resize volumes, especially while they're mounted

When you edit a PVC to request more storage, the CSI driver communicates with the underlying storage system (like AWS EBS, Azure Disk, or GCP Persistent Disk) to expand the volume. The filesystem inside may also need resizing, which modern CSI drivers handle automatically.

The Process

  1. Edit your PVC's spec.resources.requests.storage to a larger value
  2. Kubernetes instructs the CSI driver to expand the volume
  3. The CSI driver resizes the underlying storage
  4. The filesystem is expanded automatically (for online-capable drivers)
  5. Your pod now has more space — no restart needed

Important: You can only increase size, never decrease. Once expanded, there's no shrinking back.

Key Takeaway: Volume expansion with CSI allows you to dynamically grow persistent storage without downtime by setting allowVolumeExpansion: true in your StorageClass and editing your PVC's requested capacity.