Skip to content

Node Labels

Labels can be set on a worker node to limit where a workload is run. This limit ensures that the worker node has the required resources or properties to run the workload. For example, a worker node could have a label of FinanceData because it provides access to a network store with the finance data. 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

Node labels are specified using a configuration file on the Altair SLC Hub worker.

An example of configuring node labels for worker nodes can be found in the worker.yaml configuration file in the Altair SLC Hub configuration files directory.

To add a new label, for example, worker1 to a worker node: Create a new file with a lexicographically greater name thaty worker.yaml, for example, [etc directory]/config.d/worker_custom.yaml with the correct permissions. Add the following section to the new file:

worker:
  nodeLabels:
    - worker1

More labels can 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 worker 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 the new label is displayed in the Node labels column.