ACS allows you to manage nodes by label, annotation, and taint. You can also configure custom attributes to schedule GPU-HPN nodes based on affinity rules. This topic describes how to use labels, annotations, and taints to manage nodes in ACS clusters and the limits.
Precautions
ACS supports two types of nodes: regular virtual nodes and GPU-HPN reserved nodes. By default, you can add, delete, and modify labels and taints for ACS nodes. If you want to allow GPU-HPN reserved nodes to use labels of other formats, see Enable custom labels and schedulers for GPU-HPN nodes.
Regular virtual node | GPU-HPN reserved node | |
Label | Not supported | Support only labels starting with |
Annotation | Not supported | Support only annotations starting with |
Taint | Not supported | Support only taints starting with |
Procedure
The following example demonstrates how to configure custom labels for GPU-HPN reserved nodes.
Run the following command to query GPU-HPN reserved nodes in the cluster:
# GPU-HPN nodes carry the label "alibabacloud.com/node-type=reserved" by default kubectl get node -lalibabacloud.com/node-type=reservedExpected result:
# The actual output depends on your cluster configuration NAME STATUS ROLES AGE VERSION cn-wulanchabu-c.cr-cye8scj0ukxxxxxxxgbg Ready agent 4d20h v1.28.3-xx cn-wulanchabu-c.cr-u9mqtuqxxxxxxx9noka5 Ready agent 2d22h v1.28.3-xxRun the following command to add the
custom.k8s.io/test-key: test-valuelabel to the first node:kubectl label node cn-wulanchabu-c.cr-cye8scj0ukxxxxxxxgbg custom.k8s.io/test-key=test-valueExpected result:
# Indicates that the label was successfully added node/cn-wulanchabu-c.cr-cye8scj0ukxc3gkxxgbg not labeledRun the following command to query the labels of the GPU-HPN node:
kubectl get node cn-wulanchabu-c.cr-cye8scj0ukxxxxxxxgbg -Lcustom.k8s.io/test-keyExpected result:
# You can see that the node now includes the new label "custom.k8s.io/test-key=test-value" NAME STATUS ROLES AGE VERSION TEST-KEY cn-wulanchabu-c.cr-cye8scj0ukxxxxxxxgbg Ready agent 4d21h v1.28.3-xx test-value