Day 28 Task: Jenkins Agents๐Ÿ‘ฅ

Day 28 Task: Jenkins Agents๐Ÿ‘ฅ

ยท

3 min read

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!

ย