Scaling Jenkins
The obvious use cases for server clustering are the staging and production environments. When used, it's enough to attach a physical machine in order to increase the capacity of the environment. Nevertheless, in the context of Continuous Delivery, we may also want to improve the Jenkins infrastructure by running Jenkins agent (slave) nodes on a cluster. In this section, we take a look at two different methods to achieve this goal.
Dynamic slave provisioning
We saw dynamic slave provisioning in Chapter 3, Configuring Jenkins. With Docker Swarm, the idea stays exactly the same. When the build is started, the Jenkins master runs a container from the Jenkins slave Docker image, and the Jenkinsfile script is executed inside the container. Docker Swarm, however, makes the solution more powerful since we are not limited to a single Docker host machine but can provide real horizontal scaling. Adding a new Docker host to the cluster effectively scales up the capacity of the Jenkins...