DevOps(Day-36) : Setup a Jenkins Agent in Master(Part-1)
TABLE OF CONTENTS
Jenkins Master
Jenkins Slave(Agent)
Pre-Requisites
Let's first understand what is Jenkins Agent and Jenkins Master.
Jenkins Master
The Master is the server that manages and builds the code. Jenkins’s server or master node holds all key configurations. The Jenkins master server is like a control server that orchestrates all the workflow defined in the pipelines. For example, scheduling a job, monitoring the jobs, etc.
The basic installation of Jenkins operating alone is called a “master” or “controller.” The controller handles all tasks for your build system in this configuration. A “slave” or “agent” is a computer that’s set up to offload build projects from the master. Once set up, this distribution of tasks is fairly automatic.
The Jenkins controller schedules projects, assign agents/nodes and send builds to agents to execute projects. The controller will also monitor the agent state (offline or online), receive build result responses, and display build results on the console output.
Jenkins Slave(Agent)
An agent is typically a machine or container that connects to a Jenkins master and this agent executes all the steps mentioned in a Job. When you create a Jenkins job, you have to assign an agent to it. Every agent has a label as a unique identifier.
When you trigger a Jenkins job from the master, the actual execution happens on the agent node that is configured in the job.
A single, monolithic Jenkins installation can work great for a small team with a relatively small number of projects. As your needs grow, however, it often becomes necessary to scale up. Jenkins provides a way to do this called “master to agent connection.” Instead of serving the Jenkins UI and running build jobs all on a single system, you can provide Jenkins with agents to handle the execution of jobs while the master serves the Jenkins UI and acts as a control node.
Pre-Requisites
Spin up two AWS EC2 instances.
One of the servers should be Master and the other should be Agent.
Install Jenkins, Docker, and Docker-compose on both servers.
Note:- While creating an agent, be sure to separate rights, permissions, and ownership for Jenkins users.
Comments
Post a Comment