The Container Storage Interface (CSI) plug-in in ACK lets you expand a cloud disk volume by modifying a persistent volume claim (PVC) — without restarting or interrupting your running pods. This requires Kubernetes 1.16 or later.
Prerequisites
Before you begin, make sure that:
The StorageClass bound to the PVC has
allowVolumeExpansion: true. ACK-provided StorageClasses have this set by default. For custom StorageClasses, you must set it manually. StorageClass properties cannot be changed after creation — create a new StorageClass if needed.The pod using the disk is in the Running state.
The disk is not a basic disk. Basic disks do not support online expansion.
The cluster runs Kubernetes 1.16 or later. To upgrade, see Upgrade clusters.
The disk supports resizing. See ResizeDisk for supported disk types.
Create a snapshot before resizing to back up your data. Delete the snapshot after expansion completes to avoid unnecessary charges. See Use disk snapshots.
ACK dedicated clusters only: Grant the ResizeDisk permission to the cluster's RAM role. ACK managed clusters already have this permission.
Log on to the ACK console and click Clusters.
Click the cluster name, then click Cluster Information in the left-side pane.
On the Basic Information tab, find Master RAM Role in the Cluster Resources section and click the link.
On the Roles page in the RAM console, add the
ResizeDiskpermission. See Modify the document and description of a custom policy.

Expand a disk volume using kubectl
The following example uses a disk volume created in Create a dynamically provisioned disk volume. Modifying the PVC triggers the CSI plug-in to resize the underlying disk and expand the filesystem online — the pod keeps running throughout.
Connect to your cluster. See Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster or Use kubectl on Workbench or Cloud Shell to connect to ACK clusters.
Verify that the pod is in the Running state.
kubectl get pod -l app=nginxExpected output:
NAME READY STATUS RESTARTS AGE disk-test-0 1/1 Running 0 23hCheck the current disk usage and PVC.
ImportantFor a statically provisioned disk volume, make sure that
storageClassNamein the PVC is not blank and that a StorageClass with that name exists in the cluster. If no matching StorageClass exists, create one with the existing disk's attributes and setallowVolumeExpansion: true.kubectl exec disk-test-0 -- df -h /dataExpected output:
Filesystem Size Used Avail Use% Mounted on /dev/vdb 20G 24K 20G 1% /datakubectl get pvcExpected output (PVC
disk-pvcis bound with 20 GiB capacity):NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE disk-pvc Bound d-uf6axyb1er071h6o**** 20Gi RWO alicloud-disk-wait-for-first-consumer <unset> 23hConfirm the StorageClass has
allowVolumeExpansion: true.kubectl get sc alicloud-disk-wait-for-first-consumer -o yamlExpected output:
allowVolumeExpansion: true apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: creationTimestamp: "2025-01-21T08:48:26Z" name: alicloud-disk-wait-for-first-consumer resourceVersion: "59936" uid: 5bdb798e-5888-40df-9f91-259ee8510f34 parameters: type: cloud_auto,cloud_essd,cloud_ssd provisioner: diskplugin.csi.alibabacloud.com reclaimPolicy: Retain volumeBindingMode: WaitForFirstConsumerPatch the PVC to request 30 GiB.
kubectl patch pvc disk-pvc -p '{"spec":{"resources":{"requests":{"storage":"30Gi"}}}}'Wait for a minute, then verify the new capacity.
kubectl get pvcExpected output:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE disk-pvc Bound d-uf6axyb1er071h6o**** 30Gi RWO alicloud-disk-wait-for-first-consumer <unset> 23hkubectl exec disk-test-0 -- df -h /dataExpected output:
Filesystem Size Used Avail Use% Mounted on /dev/vdb 30G 24K 30G 1% /data
Expand a disk volume using the ACK console
The ACK console supports only dynamically provisioned disk volumes. For statically provisioned disk volumes, use kubectl.
Log on to the ACK console and click Clusters.
Click the cluster name to go to the cluster management page.
Verify the pod state and find the PVC.
In the left-side navigation pane, choose Workloads > StatefulSets.
Click the application name. On the Pods tab, confirm the pod is in the Running state.

Click the pod name. On the Volumes tab, note the PVC used by the pod.

Confirm the StorageClass has expansion enabled.
In the left-side navigation pane, choose Volumes > Storage Classes.
Find the StorageClass used by the disk volume and click View in YAML.
Confirm
allowVolumeExpansion: trueis present.
Expand the PVC.
In the left-side navigation pane, choose Volumes > Persistent Volume Claims.
Find the PVC and click Expand.
Enter the new capacity, select I understand and agree to the preceding operations, and click OK.

Wait for expansion to complete, then verify the PVC shows the new capacity.
What's next
To automatically expand a disk volume when usage exceeds a threshold, see Automatically expand a disk volume (public preview).
For disk volume errors and solutions, see FAQ about disk volumes.