- Documentation
Volcengine Kubernetes Engine
Volcengine Kubernetes Engine
User guide
Storage
EBS Volumes
Expanding by using dynamically provisioned EBS volumes
EBS Volumes
Expanding by using dynamically provisioned EBS volumes
Expanding by using dynamically provisioned EBS volumes
VKE supports online expansion of PVs and their corresponding Elastic Block Storage (EBS) file systems. When the file system of an EBS volume is not mounted, expansion can be implemented with a pod restart. When the file system of an EBS volume is already mounted to a node, expansion can be implemented without requiring a pod restart. This topic describes the steps of expanding EBS capacity as dynamically provisioned PersistentVolumes (PV).
Prerequisites
- A VKE cluster that uses v1.20.15-vke.11 or later has been created, and the csi-ebs add-on in the cluster has been upgraded to the latest version.
- To avoid data loss caused by expansion failure, we recommend that you back up data in advance. For details, see Using EBS snapshots.
Procedure
Method 1 (recommended): Offline expansion with a pod restart
An unmounted file system during EBS volume expansion helps prevent volume and file system expansion errors. This expansion method is recommended to ensure file system stability.
- Run the kubectl exec [pod_name] df [data volume mount path] command to view the file system status before expansion. Run the kubectl get pv [pv_name] command to view the PV status. The following is an example (both the PV size and the file system size are 20 GiB):
- Run the kubectl label pv [pv_name] topology.kubernetes.io/zone=nozone command to add an invalid zone label to the PV. The purpose of this operation is to prevent the pod from being scheduled to any node after it restarts. The example is as follows:
- Run the kubectl delete pod [pod_name] command to delete the current pod, which will cause a new pod to be started. Because the zone label of the PV for the pod is invalid, the newly started pod will remain in the Pending state. The example is as follows:
tip
After you run the kubectl delete command, a new pod is created with a different name.
- Run the kubectl patch pvc [pvc_name] -p '{"spec":{"resources":{"requests":{"storage":"[capacity after expansion]"}}}}' command to change the capacity of the PVC to 30 GiB. The example is as follows:
tip
We recommend configuring expanded PVC capacity in multiples of 10.
- Run the kubectl label pv [pv_name] topology.kubernetes.io/zone- command to remove the label previously set on the PV. After the label is removed, the pod can be scheduled successfully. The example is as follows:
- Run the following command to validate the expansion result. The response shows that the pod status is Running and that the corresponding PV and file system have already been expanded from 20 GiB to 30 GiB. The example is as follows:
Method 2: Online expansion without a pod restart
When the file system of the EBS volume is mounted on a node, I/O processes during expansion may cause file system expansion to encounter errors. Please take precautions to avoid this.
- Run the kubectl exec [pod_name] df [data volume mount path] command to view the file system status before expansion. Run the kubectl get pv [pv_name] command to view the PV status. The following is an example (both the PV size and the file system size are 20 GiB):
- Run the kubectl patch pvc [pvc_name] -p '{"spec":{"resources":{"requests":{"storage":"[capacity after expansion]"}}}}' command to change the capacity of the PVC to 30 GiB. The example is as follows:
tip
We recommend configuring expanded PVC capacity in multiples of 10.
- Repeat the command in Step 1 to validate the expansion result. The response shows the corresponding PV and file system have already been expanded from 20 GiB to 30 GiB. The example is as follows:
Last updated: 2026.07.24 10:53:31