Multiple Jenkins Nodes

July 10, 2019

Below are some tips I found on how to deal with Jenkins Nodes and wanting different behaviors.

Choosing to run a job on any node:

If you have x number of nodes and your job can run on any one of them you can simply use this expression to have Jenkins run the job on whichever node happens to be available like so:

node("nodeLabelA||nodeLabelB||nodeLabelC")

Jenkins Plugin to better manage Node Load Balancing:

The Least Load Plugin will do just as it says. When enabled/installed it will choose the node with least load to run your jobs on. This is great if you are dealing with resource allocation issues. Note that this is just a simple bandage for a much bigger problem. There are other things you can do to solve a resource issue.