This topic describes different types of StorageClass for Alibaba Cloud Container Service for Kubernetes (ACK) clusters. This topic also describes how to choose a proper StorageClass to meet your business requirements, and how to configure a default StorageClass.
StorageClass
- alicloud-disk-efficiency: ultra disk.
- alicloud-disk-ssd: SSD.
- alicloud-disk-essd: Enhanced SSD.
- alicloud-disk-available: a high-availability mode. In this mode, the system attempts
to create an SSD in priority. If the SSD resources are exhausted, the system attempts
to create an ultra disk.
Notice For versions earlier than alicloud-csi-provisioner v1.14.8.39-0d749258-aliyun, the system attempts to create a disk in the order of Enhanced SSD, SSD, and ultra disk.
- alicloud-disk-topology: create a cloud disk in WaitForFirstConsumer mode.
The first four types of StorageClass are suitable for single-zone clusters. The last type of StorageClass is suitable for multi-zone clusters.
- If you set volumeBindingMode: WaitForFirstConsumer in the StorageClass configuration, a disk is created in the zone where the pod is deployed.
- If you set volumeBindingMode: Immediate and specify only one zone in the zoneId parameter of the StorageClass configuration, a disk is created in the specified zone.
- If you set volumeBindingMode: Immediate and specify multiple zones in the zoneId parameter of the StorageClass configuration, the system attempts to create a disk in the specified zones in a round robin manner.
- If you set volumeBindingMode: Immediate and do not specify the zoneId parameter in the StorageClass configuration, a disk is created in the zone where the csi-provisioner is deployed.
If your cluster is deployed across zones, we recommend that you set volumeBindingMode: WaitForFirstConsumer in the StorageClass configuration. You can create a StorageClass based on the required disk type.
Default StorageClass
Kubernetes provides the default StorageClass feature. If a persistent volume claim (PVC) does not require a specific StorageClass, you can use a default StorageClass to provision a volume. For more information, see Default StorageClass.
- The default StorageClass applies to all PVCs. Exercise caution if your cluster supports multiple types of volume. For example, the default StorageClass may create a cloud disk as the persistent volume (PV) for a PVC in which a Network Attached Storage (NAS) volume is defined. Therefore, ACK clusters do not support the default StorageClass feature. If you want to configure a StorageClass, take the following steps.
- For each cluster, you can only configure one default StorageClass. If you configure more than one StorageClasses for a cluster, the StorageClasses of the cluster become invalid.
What to do next
$ kubectl patch storageclass alicloud-disk-ssd -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'