Jenkins Architecture with Diagrams Tutorial (Explained)

Jenkins Architecture with Diagrams Tutorial (Explained). In this article blog we will explain what is Jenkins, its features and then move onto its architecture with diagrams phase.

Jenkins is designed for developers to build and test their software projects. Makes it easier for Devops to integrate changes into the project and making it easier for users to get a new build.

Shall we start with Jenkins Architecture with Diagrams Tutorial (Explained).

What is Jenkins?

Firstly Jenkins is an open source automation tool written in Java with plug ins created for continuous integration purposes. It also allows you to deliver your software by integrating it with a wide range of test and implementation technologies. In addition Jenkins enables organizations to accelerate the software development process through automation. 

With Jenkins it integrates all types of development lifecycle processes, including build, document, test, package, phase, deploy, static analysis and more. In addition Jenkins realizes seamless integration using plug ins.

Plugins allow for the integration of different DevOps stages. If you want to integrate a particular instrument, you need to install plug ins for that instrument.

For example, Git, Maven 2 project, Amazon EC2, HTML editor, etc.

Moreover Jenkins provides an open source platform that allows organizations to automate their infrastructure tasks such as deployment of applications or code updates across multiple environments.

The Jenkins is an open source automation server that allows you to build and test your software. It is a very popular tool in the DevOps community because it allows you to automate your software development process, thereby reducing the cost of manual testing and increasing quality.

Equally Jenkins is an open source tool with over 1000 plugins which makes it easy to configure and customize for any project. The best thing about Jenkins is that it is free, and there are no fees for using it.

Why Jenkins?

Firstly Jenkins is one of the best DevOps tools because it is free, open source and modular. It also integrates with almost every other DevOps tool available.

There are over a thousand plugins you can use to extend Jenkins’ capabilities and make it user specific. All these plugins and extensions are developed in Java.

The companies Netflix and Google also use Jenkins with very little downtime. These companies have thousands of servers that need to be monitored by a single person or team of people who can maintain them at all times to ensure they run smoothly.

Secondly Jenkins helps keep these servers up and running smoothly by monitoring them constantly and automatically restarting them if anything goes wrong or needs to be upgraded or patched.

Features of Jenkins

  • Well Jenkins is an open source automation server. It is designed to build, test and deploy software projects by automating all of the tedious or time consuming phases of a software project.
  • It provides a virtual machine for executing builds (runs), automatic testing of code before it goes live and a web interface to view the results.
  • More benefit is that Jenkins is completely free and open source (Apache Software Foundation). It runs on any operating system that supports Java Virtual Machine (JVM), including Windows, Linux, Mac OS X and Solaris.
  • This tool has become an important part of modern DevOps teams due to its ease of use and extensibility. It can be used with any programming language or platform such as PHP or Ruby on Rails with no configuration required other than installing Jenkins itself.
  • This makes it possible for IT organizations to manage their entire application lifecycle from development through deployment at scale.

Jenkins Architecture

3 Key Components of Jenkins Architecture are:

  • Jenkins Agent Nodes.
  • Jenkins Web Interface

Jenkins Master(Server)

The Jerkins master server is responsible to hold all key configurations.

It’s job is to handle

  • Sending builds to slaves for actual execution.
  • Monitor slaves (go online and offline as needed).
  • Recording and presentation results.
  • A master instance of Jenkins can also run build jobs directly.

Jenkins Agent Nodes

Next are Jenkins Agents. They are the worker nodes that actually perform all the steps mentioned in a job. They are assigned to a job when you create it and they run the actual tasks.

When you trigger a Jenkins task from the master, Masternodes act as agents. You can run jobs on the Jenkins server without an agent, but then Master nodes will act as agents.

You can attach any number of Jenkins agents to a master using a combination of Windows, Linux, and even container servers as build agents. Depending on the application, you can also limit execution to specific agents.

For example: if you have an agent with Java 8 configurations, you can assign jobs that require a Java 8 environment to those agents. There is no uniform standard for the use of agents; you can configure a workflow and strategy based on your project needs.

Jenkins Web Interface

In addition Jenkins 2.0 introduced a new web interface called “Jenkins Blue Ocean”. It has a good visual representation of all pipelines as shown below:

Jenkins Slave

A Slave is a Java executable file that runs on a remote machine. The following are the features of Jenkins Slaves:

  • Hear the requests from the Jenkins Master instance.
  • Slaves can run on different operating systems.
  • A slave’s job is to do as he is told, which involves carrying out tasks sent by the master.

You can configure a project to always run on a particular Slave machine or type of Slave machine, or you can just let Jenkins choose the next available Slave.

Refer to the diagram below for more better clarity:

Jenkins Master Slave Architecture

Example of Jenkins showing testing in different environment like MAC, windows etc.

The example above represents:

  • What happens is Jenkins periodically checks the Git repository for any changes to the source code.
  • Each build requires a different test environment, which is not possible for a single Jenkins server. To run tests in different environments, Jenkins uses different Slaves as shown in the diagram.
  • Jenkins Master requires these Slaves to run tests and generate test reports.

How does Jenkins Master and Slave Architecture work?

Step 1. Click on “manage jenkins” and scroll to section of “manage nodes” section.

Step 2. Click on “New Node” in the left panel.

Step 3. Name the Node, select the “Permanent Agent” option and click on Ok.

Step 4. Enter the details of the node slave machine. Number of jobs that this slave can perform in parallel. Here we have kept it at 2. Labels whose name is entered as “Slave1” can be used to configure jobs to use this slave machine.

Select Use to use this node as much as possible. For the boot method, we select the option “Start agent by connecting it to the master”. If not visible, go to the Jenkins home page -> Manage Jenkins -> Configure global security.

Here, in the Agents section, click on Random and save it. You will now find the option you want. Enter the Custom WorkDir path as the slave node working space. Under Availability, select “Keep this agent online as long as possible” and Click on the Save.

provide slave machine details

After completing the above steps, the new node computer will initially be offline, but will come back online if all settings are entered correctly in the previous screen. You can disconnect the node slave machine whenever necessary.

Jenkins Architecture with Diagrams slave is operational

Step 5. Now that your slave is operational, you can run a task on the slave. For this I already have an existing job and I will run this job on this slave.

Open this job and click Configure. Now, in the “General” section, click on “Restrict where this project can run”. Enter here the slave name in Label Expression and save it.

Now click on Build now and watch the output of this job. If everything is correct, you will see the output as Success.

Thank you for reading Jenkins Architecture with Diagrams Tutorial (Explained). 

Jenkins Architecture with Diagrams Tutorial (Explained) Conclusion

To summarize Jenkins architecture diagram is very simple and easy to understand. It only shows the key components of Jenkins, their relationship with each other, and how they work together.

It looks like a tree structure, but it’s not totally a tree structure. This makes it a little complicated to understand for the beginners.

So I have tried my best to explain each and every diagram and component with easy words for the beginners as well as advanced users also.

Avatar for Hitesh Jethva
Hitesh Jethva

I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x