• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide 2.0
  4. Cluster Management
  5. Managing Node Labels

Managing Node Labels

Node labels are attached to nodes to define different attributes for the nodes, facilitating node management and affinity or anti-affinity configuration.

Application Scenarios

Node labels are mainly used in the following scenarios:

  • Node management: Labels are used to classify and manage nodes.
  • Affinity or anti-affinity between applications and nodes:
    • Memory size, I/O performance, and the number of CPU cores required for applications vary depending on service demands. You can attach labels to define these attributes for nodes, so that applications can be deployed on appropriate nodes based on affinity or anti-affinity policies.
    • A system can be divided into modules, where each module consists of multiple microservices. To ensure efficient O&M, you can attach module labels to nodes, so that the modules can be deployed on their corresponding nodes. These modules work independently without affecting each other and can be easily maintained.

Fixed Labels

Table 1 lists the fixed labels attached to a node when it is created.

Table 1 Fixed labels

Key

Value

failure-domain.beta.kubernetes.io/region

Region where a node is located.

failure-domain.beta.kubernetes.io/zone

AZ where a node is located. Ensure that applications to which dynamic storages are mounted can be scheduled only to the nodes in the AZ to which the storages belong.

os.architecture

Node processor architecture.

For example, amd64 indicates a 64-bit AMD processor.

os.name

Operating system name of a node.

For example, EulerOS_2.0_SP2 indicates that the EulerOS 2.2 is used.

os.version

Kernel version of a node.

For example, 3.10.0-327.62.59.83.h112.x86_64

supportContainer

Whether a node can run containerized applications.

For example, true indicates that the node can run containerized applications.

Creating a Node Label

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes. The node list is displayed. Click Manage Labels in the Operation column.
  2. Click Add Label, specify the key and value of the label that you want to create, and click OK.

    For example, to indicate that the node is used to deploy a QA (test) environment, you can create a node label in which Key is set to deploy_qa and Value is set to true.

  3. After "Label updated successfully." is displayed, click Manage Labels. The label that you have added is displayed.

Deleting a Node Label

Only the labels you created can be deleted. Fixed labels cannot be deleted.

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Nodes. The node list is displayed. Click Manage Labels in the Operation column.
  2. Click Delete and click OK to delete the label.