Day 24 Task: Jenkins Agent for DevOps Engineers.
Jenkins Agent Digram.

Day 24 Task: Jenkins Agent for DevOps Engineers.


No alt text provided for this image

Dear Engineers in today topic we will discuss on the topic Jenkins Agents in DevOps.

Jenkins Master (Server):-

Jenkins is an open source automation server, that helps for software engineers,building,testing and deploy software. Jenkins will used the Master and Slave architecture. In which master server server is responsible for managing and coordinating the entire build process.

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

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.

Now let us discuss with the help of Task-1 & Task-2:-

Create an agent by setting up the 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.

Now at the end verify the status under nodes section.

Let's move forward with below steps:-

1 Create 2 Ec2 Instances for Master and Agent.

A) Jenkins Master EC2 Instance.

No alt text provided for this image
Jenkins Master EC2 Instance. Diagram

B) Jenkins-Agent EC2 Instance.

No alt text provided for this image
Jenkins-Agent EC2 Instance. Diagram.

C) In Jenkins-agent instance install the Jenkins and docker.Here are the few steps to install the docker and jenkins in the diagram

No alt text provided for this image
Jenkins and Docker Install Commands Diagram

D) Generate SSH keys on “Jenkins-master” EC2 instance

No alt text provided for this image
Generate SSH keys on “Jenkins-master” EC2 instance Diagram.

Add public key from “Jenkins-master” instance to “Jenkins-agent” instance under location “.ssh/authorized_keys”

Jenkins Master Instance .ssh key:-

No alt text provided for this image
Jenkins Master Instance .ssh key.

Jenkins Agent Instance .ssh key (I will add master key to agent with the help od authorised key option. Mention in the below Diagram:-

No alt text provided for this image
.ssh key added to the master to agent side Diagram.

2 Create a agent by setting up a node in Jenkins.With below steps.

Go to the Jenkins dashboard and click on the Manage Jenkins, then

Click on the "Manage nodes and clouds"

No alt text provided for this image
Jenkins dashboard and click on the Manage Jenkins, then

To create a node click on "New Node" on right side.

Create your first agent.

No alt text provided for this image
Create your first agent. Diagram.

Add details of your node, accordingly.

No alt text provided for this image
Add details of your node, accordingly. Diagram.
No alt text provided for this image
Add details of your node, accordingly. Diagram

Add credentials for jenkins:

No alt text provided for this image
Add credentials for jenkins: Diagram

Add private key that we created in 'jenkins-master' instance using ssh-keygen.

after creating the private key enter in these key column and save the description.

No alt text provided for this image
Add private key that we created in 'jenkins-master' instance using ssh-keygen. Diagram.

Below we select ubuntu for credentials.

No alt text provided for this image
Below we select ubuntu for credentials. Diagram

Click on 'save' that will create node.

 You can see agent will be connected and online.

No alt text provided for this image
You can see agent will be connected and online.Diagram.
No alt text provided for this image
Status of Agent Diagram.

Thank you for reading this Article !! Stay Connected!!

Happy Learning!!


Next Topic:

Day 25 Task: Jenkins Interview Questions.







To view or add a comment, sign in

More articles by Maninder Singh

  • Artificial Intelligence for DevOps Engineer

    Dear learners, In today article we will explain the Artificial Intelligence for the DevOps Engineers. Important Aspects…

    12 Comments
  • Bash Shell Scripting:- Lesson 7,8 &9 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 Comments
  • Bash Shell Scripting:- Lesson 4,5 &6 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 Comments
  • Bash Shell Scripting:- Lesson 1,2 &3 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 Comments
  • EP 2 DevOps:- 2 Tier Application Deployment

    2-Tier Application Deployment Diagram (Architecture) Dear Learners in today topic we will deploy a 2 Tier Application…

    8 Comments
  • DevOps Engineers:- Docker Cheat Sheet

    Dear learner, presented below is a concise yet comprehensive Docker cheat sheet, complete with detailed commands and…

    7 Comments
  • DevOps (Day-90): Ending the challengs

    Table of Contents: Flashback Self-Impact of Learning Today, We have completed the 90days of DevOps challenge where we…

    16 Comments
  • DevOps (Day-88): Kubernetes Architecture

    Dear Learner's in today topic we will discuss the Kubernetes Architecture in detail. Table of Contents Kubernetes…

    1 Comment
  • DevOps (Day-87): Argo CD

    Dear Learners in today topic we will the discuss the Argo CD in Kubernetes. Table of Contents Challenges with CD into…

    13 Comments
  • DevOps (Day-86): Project-7 Portfolio App

    Dear Learners in Today's article we will deploying a Portfolio app on AWS S3 Bucket using GitHub. Table of Contents:…

    10 Comments

Others also viewed

Explore content categories