Skip to content

Node Labels

Labels can be set on a worker node, which can then be used to limit where a workload is run and to make sure that the worker node the workload is run on has the required resources or properties. For example, a worker node could have a label of FinanceData because it provides access to a network store with the finance data; or if there were two worker nodes, one could have a label of Production and the other Development to make it clear of what workloads each is designed for.

Before you start

Goal

  • Add a label to a worker node.

Prerequisites

  • A configured hub server with at least one worker node.
  • Altair SLC Hub configuration privileges on the required worker.

Settings Worker Node Labels

In the Altair SLC Hub configuration files directory there will be a worker.yaml configuration file, this contains an example of how node labels can be configured for a worker node.

To add the label worker1 to a worker node you need to create a new file with a lexicographically greater name, for example, [etc directory]/config.d/worker_custom.yaml with the correct permissions containing:

worker:
  nodeLabels:
    - worker1

More labels can then be added to this list as required, for example, dev/prod/businessUnit1. To enable the changes, restart the Altair SLC Hub service using the following command:

hubctl service restart nomad

Restarting this service does not affect any currently running workloads. However, after the node labels have been changed, constraints will be re-evaluated and if necessary workloads may be moved to alternative nodes if they no longer satisfy the constraints.

Verify Labels

Verify label set

  • check new label appears in Altair SLC Hub portal.

In the Altair SLC Hub portal, launch Hub Administration and select Cluster Nodes. The page lists all nodes in the cluster, identify the worker node to which the new label was added based on its IP address and check that in the Node labels column the new label appears.