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 ...

Get Mastering Jenkins now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.