tencent cloud

Boost Engagement with Tencent RTC Free TrialFree video and chat features await!

Feedback

Tencent Kubernetes Engine

Setting a Node Label

Last updated: 2024-12-23 15:29:47

Operation Scenario

This document guides you through the process of setting a node Label.

Usage Restrictions

Labels related to kubernetes and qcloud cannot be edited or deleted.
kubernetes and qcloud labels are reserved keys and cannot be added.
Currently, you can set Labels for one single node at a time, and batch setting is not supported.

Directions

Setting a Node Label in the Console
Using kubectl to Set a Node Label
1. Log in to the TKE console.
2. In the left sidebar, click Clusters to go to the cluster management page.
3. Select the ID/name of the cluster for which to set the node Label to go to the cluster details page.
4. In the left sidebar, select "Node Management" > "Nodes" to go to the "Node list" page.
5. Select the row of the node for which to set the Label and click More > Edit a Label.
6. In the "Edit a Label" window that pops up, edit the Label and click Submit. See the figure below:


1. Install kubectl and connect to a cluster. For detailed operations, see Connecting a Cluster via kubectl.
2. Run the following command to set a node Label.
kubectl label nodes <node-name> <label-key>=<label-value>
3. Run the following command to view the node Label.
kubectl get nodes --show-labels
A message similar to the one below is returned:
NAME STATUS ROLESAGEVERSIONLABELS
172.17.124.5 Ready <none> 12d v1.10.5-tke.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=QCLOUD,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=sh,failure-domain.beta.kubernetes.io/zone=200001,kubernetes.io/hostname=172.17.124.5
172.17.124.8 Ready <none> 12d v1.10.5-tke.3 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=QCLOUD,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=sh,failure-domain.beta.kubernetes.io/zone=200001,kubernetes.io/hostname=172.17.124.8



Catalog

In The Article

Setting a Node Label

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon