All Products
Search
Document Center

Container Compute Service:Node label and taint management

Last Updated:Apr 02, 2025

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 custom.k8s.io/.

Annotation

Not supported

Support only annotations starting with custom.k8s.io/.

Taint

Not supported

Support only taints starting with custom.k8s.io/.

Procedure

The following example demonstrates how to configure custom labels for GPU-HPN reserved nodes.

  1. 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=reserved

    Expected 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-xx
  2. Run the following command to add the custom.k8s.io/test-key: test-value label to the first node:

    kubectl label node cn-wulanchabu-c.cr-cye8scj0ukxxxxxxxgbg custom.k8s.io/test-key=test-value 

    Expected result:

    # Indicates that the label was successfully added
    node/cn-wulanchabu-c.cr-cye8scj0ukxc3gkxxgbg not labeled
  3. Run the following command to query the labels of the GPU-HPN node:

    kubectl get node cn-wulanchabu-c.cr-cye8scj0ukxxxxxxxgbg -Lcustom.k8s.io/test-key

    Expected 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