Node label and taint management

Updated at:

Container Compute Service (ACS) supports managing nodes by using methods such as labels, annotations, and taints, subject to usage constraints in an ACS cluster. For GPU-HPN (High-Performance Network GPU) nodes, ACS also supports configuring custom properties, which you can use for affinity scheduling.

Usage notes

Node objects in an ACS cluster come in two forms: regular virtual nodes and GPU-HPN reserved nodes. By default, ACS supports the following add, delete, and modify operations for labels and taints on each node type.

  • Regular virtual nodes: Label, Annotation, and Taint are not supported.

  • GPU-HPN reserved nodes:

    • If the GPU-HPN node custom labels and scheduler configuration item is enabled, any Label, Annotation, or Taint is supported.

    • Otherwise, only Label, Annotation, and Taint keys that use custom.k8s.io/ as the prefix are supported.

The ACS scheduler configuration item GPU-HPN node custom labels and scheduleris enabled by default in newer versions. For details, see kube-scheduler.

Procedure

The following example shows the result of configuring a custom label for a GPU-HPN reserved node.

  1. View the GPU-HPN reserved nodes in the cluster.

    # GPU-HPN nodes are labeled by default with "alibabacloud.com/node-type=reserved"
    kubectl get node -lalibabacloud.com/node-type=reserved

    Expected output:

    # The actual output varies depending on your cluster
    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. 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 output:

    # Indicates that the label was added
    node/cn-wulanchabu-c.cr-cye8scj0ukxxxxxxxgbg labeled
  3. View the labels of the GPU-HPN reserved node.

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

    Expected output:

    # The output shows that the node includes the newly added 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