Jenkins Master๐จโ๐ผ
๐ Central Hub: It's the central command center where all decisions and operations are coordinated.
๐ฉโ๐ป Task Manager: Like a manager assigning tasks, it directs and delegates jobs to different parts of a project.
๐ Control Center: Acts as a control center overseeing and managing various activities within a development process.
๐ค Coordinator: Functions as the coordinator, organizing and scheduling tasks to maintain a smooth workflow.
๐ Monitoring Hub: Monitors and provides an overview of the project's progress and any potential issues.
Jenkins Master is the main organizer and overseer, ensuring everything in a project runs efficiently and in harmony.
Jenkins Agent๐ทโโ๏ธ
๐ค Specialized Worker: Jenkins Agent is a dedicated worker that performs specific tasks in a project.
๐ข Remote Office: It operates like a remote office, executing tasks assigned by the Jenkins Master.
๐งโ๐ป Task Doer: If we consider it as a dedicated ๐งโ๐ผ "employee" who takes on specific jobs assigned by the boss (Jenkins Master). Similar to an employee, it handles assigned jobs efficiently.
๐คนโโ๏ธ Multitasker: It's capable of handling multiple tasks simultaneously, just like a skilled ๐คนโโ๏ธ "juggler" managing different tasks at once.
๐ Delivery Person: Like a ๐ "delivery person" who takes packages (tasks) from the main hub (Jenkins Master) to different locations (execution environments).
๐ Feedback Provider: The agent communicates back to the Jenkins Master, providing updates on the tasks it's working on.
Jenkins Agents are the hardworking hands that execute specific tasks as directed by the Jenkins Master, making the entire development process more efficient.
Pre-requisites
Letโs say weโre starting with a fresh Ubuntu 22.04 Linux installation. To get an agent working make sure you install Java ( same version as jenkins master server ) and Docker on it.
Note:- While creating an agent, be sure to separate rights, permissions, and ownership for jenkins users.
Task-01
Create an agent by setting up a node on Jenkins
Create a new AWS EC2 Instance and connect it to master(Where Jenkins is installed)
The connection of master and agent requires SSH and the public-private key pair exchange.
Verify its status under "Nodes" section.
Changing hostnames
sudo hostnamectl set-hostname
sudo apt update
sudo apt install openjdk-11-jre
Check java version
java -version
Generate ssh key on Master
Try to connect Slave from Master
Install Jenkins on Master
Allow port 8080 to access Jenkins
Point to remember: If there any trouble in launching an agent, Try to restart the Jenkins.
If SSH-Keygen private key create issue while copying in Jenkins to add credentials, Try to get new new key by using ssh-keygen -t ed25519
on the master and try to follow the same steps which were followed for "ssh-keygen" method.
Task-02
Run your previous Jobs on the new agent
Use labels for the agent, your master server should trigger builds for the agent server.
๐ Thank you for taking the time to explore this blog!๐ I hope you found the information both helpful and insightful.โจ
๐ Enjoy your learning journey, and don't hesitate to reach out if you have any feedback. ๐ค Happy exploring!