Managing Node Labels
Node Label Usage Scenario
Node labels are mainly used in the following scenarios:
- Node management: Node labels are used to classify nodes.
- Affinity and anti-affinity between a workload and node:
- Some workloads require a large CPU, some require a large memory, some require a large I/O, and other workloads may be affected. In this case, you are advised to add different labels to nodes. When deploying a workload, you can select nodes with specified labels for affinity deployment to ensure the normal operation of the system. Otherwise, node anti-affinity deployment can be used.
- A system can be divided into multiple modules. Each module consists of multiple microservices. To ensure the efficiency of subsequent O&M, you can add a module label to each node so that each module can be deployed on the corresponding node, does not interfere with other modules, and can be easily developed and maintained on its node.
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.
|
Key |
Value |
|---|---|
|
New: topology.kubernetes.io/region Old: failure-domain.beta.kubernetes.io/region |
Indicates the region where the node is located. For example, cn-south-1 indicates the CN South-Guangzhou region. |
|
New: node.kubernetes.io/baremetal Old: failure-domain.beta.kubernetes.io/is-baremetal |
Indicates whether the node is a bare metal node. false indicates that the node is not a bare metal node. |
|
node.kubernetes.io/container-engine |
Indicates the container engine. Example: docker or containerd |
|
topology.kubernetes.io/zone |
Indicates the AZ where the node is located. For example, cn-south-1a indicates the CN South-Guangzhou1 region. |
|
node.kubernetes.io/subnetid |
Indicates a subnet ID. |
|
os.architecture |
Indicates the processor architecture of a node. For example, amd64 indicates a AMD64-bit processor. |
|
os.name |
Indicates the operating system name of a node. For example, EulerOS_2.0_SP5 indicates that EulerOS 2.5 is used. |
|
os.version |
Indicates the kernel version of a node. For example, 3.10.0-862.14.0.1.h147.eulerosv2r7.x86_64. |
Adding a Node Label
- Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes.
- In the same row as the node for which you will add labels, choose Operation > More > Manage Labels.
- 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.
Figure 1 Adding a label
- After the label is added, click Manage Labels. Then, you will see the label that you have added.
Figure 2 Label added successfully
Deleting a Node Label
Only labels added by users can be deleted. Labels that are fixed on the node cannot be deleted.
- Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes.
- In the same row as the node for which you will delete labels, choose Operation > More > Manage Labels.
- Click Delete, and then click OK to delete the label.
Label updated successfully is displayed.
Figure 3 Label updated successfully
Searching for a Node by Label
- Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes.
- In the upper right corner of the node list, click Search by Label.
- Enter a Kubernetes label to find the target node.
Last Article: Logging In to a Node
Next Article: Synchronizing Node Data
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.