CBS cloud disks do not support cross-AZ mounting to nodes. Therefore, in cross-AZ clusters, we recommend that you use the CBS-CSI topology awareness feature to avoid cross-AZ mounting problems.
Topology-aware scheduling requires the cooperation of multiple Kubernetes components, including the Scheduler, PV controller, and external-provisioner. The detailed process is as follows:
volume.kubernetes.io/selected-node: 10.0.0.72
.volume.kubernetes.io/selected-node
), obtains the node object based on the nodeName, and then passes it to the external-provisioner.failure-domain.beta.kubernetes.io/zone
), and then creates the PV in the corresponding AZ. In this way, it can be in the same AZ as the pod, and you can prevent cloud disk mounting failure caused by cloud disks and the node being in different AZs.Use the following YAML to set volumeBindingMode to WaitForFirstConsumer in the Storageclass. Below is a sample:
kind: StorageClass
metadata:
name: cbs-topo
parameters:
type: cbs
provisioner: com.tencent.cloud.csi.cbs
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
Note:Both CBS-CSI and In-Tree support this operation.
Was this page helpful?