Let’s start with one of the most straightforward methods of scaling your Jenkins setup—permanently adding agent nodes.

This approach is simple to configure using Jenkins’ web interface and allows for distributing workloads efficiently.

Configuring Permanent Agents

Navigate to the Jenkins master node and head over to

Manage Jenkins > Manage Nodes.

Here, you can view all attached agents.

To add a new one, click New Node.

Give it a unique name, select "Permanent Agent" option and click Create. This brings you to the agent setup page.

Let’s break down the key parameters you'll need to configure:

  • Name: A unique identifier for the agent.
  • Description: A brief, human-readable note describing the agent's purpose.
  • Number of Executors: The number of concurrent builds this agent can handle at once.
  • Remote Root Directory: The folder on the agent machine where Jenkins will store job-related files (e.g., /var/jenkins). While this directory is important, critical data is synced back to the master, so it doesn’t need to be massive.
  • Labels: Tags that help assign specific jobs to this agent.
  • Usage: Specify whether the agent should handle all builds or only jobs matching specific labels (for example, Acceptance Testing builds only).
  • Launch Methods: You’ll need to decide how the agent will be launched. Here are your options---
  • Availability: You can also decide whether the agent should always remain online or go offline based on certain conditions, like inactivity or scheduled maintenance.

Once your agents are properly set up, you can switch the Jenkins master node to an offline state.

This ensures that the master only handles UI tasks and coordinates builds, while all actual job execution is offloaded to the agents—keeping your setup streamlined and efficient.

Understanding Permanent Agents in Jenkins

As previously mentioned, one downside to using permanent agents is the need to manage multiple agent types (labeled as slaves) for different project types. For instance, if you're running three types of projects—Java 7, Java 8, and Python—you'd need to maintain three separate sets of agents, each with a specific label. The situation is illustrated in the following scenario:

Imagine you have a project type labeled as java7, another as java8, and a third as python. To efficiently handle the builds for each project, you'd need a dedicated set of agents for each one.

So, how do we address this with Jenkins agents?

One possible solution is to—leverage Docker containers to make the setup more scalable and flexible. By having Docker installed on the agent machines, you can simplify the process by spinning up lightweight, isolated environments tailored for specific project requirements (Java 7, Java 8, Python, etc.) without the need to maintain separate physical agents for each type.

This not only reduces overhead but also provides better resource utilization and scalability, similar to how we manage production environments with Docker.