Labels, groups, and load balancing
When creating a new slave node, Jenkins allows us to tag a slave node with a label. Labels represent a way of naming one or more slaves. We leverage this labeling system to tie the execution of a job directly to one or more slave nodes.
By leveraging the labeling system described above we can begin to create very powerful load-balanced Jenkins solutions. When Jenkins discovers a job execution is pending, which is tied to a label, it will attempt to locate any available slave nodes tagged with that label that are not in use. If any nodes with that label are free Jenkins will run the job on the available node. If no nodes are available, Jenkins will queue the job for the next available node that has the specified label. Figure 2-18 illustrates a simple label containing two Microsoft Windows slaves tagged with the label Windows.
Attaching a slave to a group by creating a label
By labeling multiple slave nodes with the...