Managing Node Labels

Node Label Usage Scenario

Node labels are mainly used in the following scenarios:

Inherent Label of a Node

After a node is created, some fixed labels exist and cannot be deleted. For details about these labels, see Table 1.

Table 1 Inherent label of a node

Key

Description

New: topology.kubernetes.io/region

Old: failure-domain.beta.kubernetes.io/region

Region where the node is located

New: topology.kubernetes.io/zone

Old: failure-domain.beta.kubernetes.io/zone

AZ where the node is located

New: node.kubernetes.io/baremetal

Old: failure-domain.beta.kubernetes.io/is-baremetal

Whether the node is a bare metal node

false indicates that the node is not a bare metal node.

node.kubernetes.io/instance-type

Node specifications

kubernetes.io/arch

Node processor architecture

kubernetes.io/hostname

Node name

kubernetes.io/os

OS type

node.kubernetes.io/subnetid

ID of the subnet where the node is located.

os.architecture

Node processor architecture

For example, amd64 indicates a AMD64-bit processor.

os.name

Node OS name

os.version

Node OS kernel version

Adding a Node Label

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes.
  2. In the same row as the node for which you will add labels, choose Operation > More > Manage Labels.
  3. In the dialog box displayed, click Add Label below the label list, enter the key and value of the label to be added, and click OK.

    As shown in the figure, the key is deploy_qa and the value is true, indicating that the node is used to deploy the QA (test) environment.

  4. After the label is added, click Manage Labels. Then, you will see the label that you have added.

Deleting a Node Label

Only labels added by users can be deleted. Labels that are fixed on the node cannot be deleted.

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes.
  2. In the same row as the node for which you will delete labels, choose Operation > More > Manage Labels.
  3. Click Delete, and then click OK to delete the label.

    Label updated successfully is displayed.

Searching for a Node by Label

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes.
  2. In the upper right corner of the node list, click Search by Label.
  3. Enter a Kubernetes label to find the target node.