As application data grows, cloud disk storage on an ACK Serverless cluster can run out of capacity. For dynamically provisioned cloud disk persistent volumes, you can expand storage without stopping pods—keeping your workloads uninterrupted throughout the process.
Limitations
The following limitations apply to cloud disk persistent volume expansion on ACK Serverless clusters:
-
InlineVolume is not supported. Only volumes attached through a PersistentVolumeClaim (PVC) can be expanded.
-
Static provisioning is not supported. The persistent volume (PV) bound to the PVC must be associated with a StorageClass (dynamically provisioned only).
-
Basic disks cannot be expanded.
-
Cross-type expansion is not supported. Expand only within the capacity range of the current cloud disk type. Do not change the cloud disk type.
Prerequisites
Before you begin, make sure that you have:
-
The Container Storage Interface (CSI) storage component installed and upgraded to the latest version. For more information, see Install and Upgrade the csi-provisioner Component.
-
A pod in Running state with the cloud disk attached.
-
A StorageClass with
allowVolumeExpansion: true. This is the default. If you did not setallowVolumeExpansionwhen creating the StorageClass, the system sets it totrueautomatically. -
(Optional) A cloud disk snapshot for backup. Create one before expanding to prevent data loss from unexpected issues. Delete the snapshot after the expansion completes to avoid ongoing snapshot fees. For more information, see Manually Create a Single Snapshot.
Enable online cloud disk expansion
ACK Serverless clusters do not support cloud disk expansion by default. Enable it by setting enablePVCController to true in the eci-profile ConfigMap.
Use kubectl
-
Connect to the cluster. For more information, see Obtain Cluster KubeConfig and Connect to the Cluster Using kubectl.
-
Edit
eci-profile.kubectl edit configmap eci-profile -n kube-system -
Set
enablePVCControllertotrueand save.
Use the console
-
Log on to the Container Service Management Console. In the left navigation pane, click Clusters.
-
Click the name of your cluster. In the left navigation pane, choose Configurations > ConfigMaps.
-
Select the kube-system namespace.
-
Find
eci-profileand click Edit. -
Set
enablePVCControllertotrue, then click OK.
Expand a cloud disk online
-
Connect to the cluster. For more information, see Obtain Cluster KubeConfig and Connect to the Cluster Using kubectl.
-
Check the current disk usage. The following example uses pod
test-0with mount path/data.kubectl exec test-0 -- df /dataExpected output:
Filesystem 1K-blocks Used Available Use% Mounted on /dev/vdb 25626852 24 25610444 1% /data -
List PVCs to identify the one to expand.
kubectl get pvcExpected output. In this example, the PVC
test-pvcis bound to cloud diskd-uf68pljc3sppvhss****with a capacity of 25 GiB.NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE test-pvc Bound d-uf68pljc3sppvhss**** 25Gi RWO test-sc <unset> 7m38s -
Patch the PVC to request the new capacity. The following example expands
test-pvcto 30 GiB.kubectl patch pvc test-pvc -p '{"spec":{"resources":{"requests":{"storage":"30Gi"}}}}' -
After a period, verify that expansion succeeded.
-
Check that the PVC capacity has updated.
kubectl get pvcExpected output. The cloud disk
d-uf68pljc3sppvhss****now shows 30 GiB.NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE test-pvc Bound d-uf68pljc3sppvhss**** 30Gi RWO test-sc <unset> 18m -
Confirm the new capacity is visible inside the pod.
kubectl exec test-0 -- df /dataExpected output:
Filesystem 1K-blocks Used Available Use% Mounted on /dev/vdb 30787492 24 30771084 1% /data
-