KOP Cluster Metadata - Node Labels - Rafay Product Documentation

Node Labels

Kubernetes clusters administrators normally don’t need to choose a node to which the Pods should be scheduled. Instead, the selection of the appropriate node onto which to schedule the Pods is handled by the Kubernetes scheduler. Automatic node selection prevents users from selecting unhealthy nodes or nodes with a shortage of resources.

However, there are scenarios where you want certain pods to end up on specific nodes. For example:


Node Selector

nodeSelector is a Kubernetes feature designed for manual Pod scheduling. The idea behind the nodeSelector is to allow a Pod to be scheduled only on those nodes that have labels identical to the labels defined in the nodeSelector.


View Node Labels

To view labels associated with a node in a cluster,

Nodes in Kubernetes are assigned "default" labels that cannot be updated by users. Any label that has a key beta.kubernetes.io/* or kubernetes.io/* is a default label.


Add/Remove Node Labels

To add/remove labels associated with a node in a cluster,

πŸ”” Automatic Inventory Synchronization via Node Labels

For more information on how synchronized nodes appear and are managed in Inventory, see Inventory – Servers.

KubeCTL

To view labels associated with a node in a cluster using KubeCTL, in the Web Console, open the browser based KubeCTL shell and type the following command.

kubectl get nodes --show-labels

In the example below, the user has added a custom node label "app=frontend" using the Web Console workflow.