VKE supports multiple cloud disk types as storage volumes to meet storage performance and cost requirements in different scenarios. When you use cloud disk volumes, you can change cloud disk types as needed. This topic describes the considerations and procedure for changing cloud disk types.
In a VKE cluster, cloud disks are the core storage medium for stateful applications, such as databases and message queues. These applications are highly sensitive to performance metrics such as disk IOPS and throughput. In the past, the performance specifications of a cloud disk were fixed when the disk was created and could not be changed directly. When business growth and increased traffic resulted in insufficient storage performance, you usually had to create a high-specification cloud disk and migrate data to it. This process causes downtime and involves data migration risks and costs. For periodic traffic spikes, such as major promotions or month-end settlements, provisioning high-performance cloud disks for the long term wastes resources during off-peak hours.
To resolve these issues, VKE provides a solution for changing cloud disk types based on VolumeAttributesClass (VAC). This solution decouples configurations such as cloud disk types and performance specifications from PersistentVolumes (PVs) and abstracts them into an independently adjustable configuration template. You can directly modify parameters such as the type, IOPS, and throughput of a running cloud disk without rebuilding the PV or interrupting services. This solution provides the following core benefits:
- Online configuration change without service interruption: When you adjust cloud disk types and performance parameters, you do not need to unmount volumes or restart Pods. Applications can continue to read and write data.
- Configuration and data decoupling: Cloud disk types and performance parameters are defined in a VAC. One VAC can be reused by multiple PersistentVolumeClaims (PVCs). To adjust specifications, you only need to modify one configuration, which helps with unified governance.
- Adapt performance to business cycles: Temporarily increase performance during peak hours and restore the standard level afterward. This allows storage costs to scale with actual demand and avoids long-term spending on peak capacity.
- Only scenarios that use dynamically provisioned cloud disk PVs are supported.
- Currently, only changes between ESSD_PL0 and ESSD_FlexPL specifications are supported. Changes to other cloud disk types are not supported.
- You have created a managed cluster and the cluster version is v1.32 or later. If the version does not meet the requirement, upgrade the cluster. For details, see Upgrading clusters.
- If the cluster version is v1.32, submit a ticket to request feature-gates=VolumeAttributesClass=true for the cluster.
- If the cluster version is v1.34 or later, no additional prerequisites are required.
- You have installed the csi-ebs add-on and upgraded it to v1.5.0 or later. For details, see csi-ebs.
Step 1: Enable the cloud disk configuration change feature
- In the left navigation bar, click Cluster. Click the target cluster name to go to the management page of this cluster.
- In the left navigation pane, select Addons and click the Storage tab.
- Hover over the csi-ebs add-on card, click Configuration, and enable the VAC feature. For more information about add-on parameters, see csi-ebs.
- Click Confirm to finish configuration.
VACs are configuration templates for different storage types in the cluster. In a VAC configuration, driverName and parameters cannot be modified after the VAC is created. We recommend creating a separate VAC for each target cloud disk specification and switching configuration templates by updating the PVC.
warning
- When you configure a VAC, we recommend including the version and key specification information in the name for easier recognition and use. An example is ebs-flexpl-iops10k-burst-v1.
- Do not reuse names that are already used. This helps avoid deleting and re-creating VACs with the same name.
- Create a YAML file for the VAC. The following vac-ebs-demo.yaml file serves as an example:
- The key parameters are described in the following table.
- Run the following command to create the VAC.
Step 3: Change the PVC configuration
- Add or modify the VAC configuration in the PVC to specify the required cloud disk type. The following pvc-ebs-dynamic.yaml file serves as an example:
- The key parameters are described in the following table.
- Run the following command to change the PVC configuration.
After the configuration is complete, the system automatically changes the type or parameters of the cloud disk PV. You can also log in to the EBS console to view the volume details after the change and confirm whether the change meets your requirements.