Member-only story
Running Jenkins builds on the master node can lead to resource overload and potential crashes, compromising your CI/CD pipeline’s stability. The best practice is to offload these builds to Jenkins slaves or agents, enabling scalability and efficiency. This guide will demonstrate how to configure Jenkins slave agents using AWS ECS Fargate, eliminating the need to manage servers manually.
Refer to my previous blog for Jenkins Installation
Step 1: Understand the Need for Jenkins Slaves
When builds run directly on the Jenkins master server, they utilize its resources, increasing the risk of performance issues and crashes. By offloading builds to agents (slaves), the master server can efficiently delegate tasks while maintaining optimal functionality.
Jenkins agents can be provisioned using EC2 instances or Fargate tasks. In this setup, we’ll use Fargate for a fully managed, serverless experience.
Step 2: Disable Executors on Jenkins Master Node
- Go to the Jenkins dashboard and navigate to Manage Jenkins > Manage Nodes and Clouds.
- Set the number of executors for the master node to
0
. - Save the configuration.
This change ensures no jobs will execute directly on the master node. If attempted, Jenkins will show a “waiting for next available executor” message.