0% found this document useful (0 votes)
70 views11 pages

Devops

Chef is a configuration management tool that manages infrastructure by writing code rather than manual processes, allowing automation, testing, and easy deployment. It uses a client-server architecture and supports platforms like Windows, Linux, and cloud services. Chef defines the desired state of systems and infrastructure and converges actual systems to match.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views11 pages

Devops

Chef is a configuration management tool that manages infrastructure by writing code rather than manual processes, allowing automation, testing, and easy deployment. It uses a client-server architecture and supports platforms like Windows, Linux, and cloud services. Chef defines the desired state of systems and infrastructure and converges actual systems to match.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Chef is a Configuration management tool that manages the infrastructure by writing code

rather than using a manual process so that it can be automated, tested and deployed very
easily. Chef has Client-server architecture and it supports multiple platforms like Windows,
Ubuntu, Centos, and Solaris etc. It can also be integrated with cloud platform like AWS,
Google Cloud Platform, and Open Stack etc. Before getting into Chef deeply let us
understand Configuration Management.

Let us take an example, suppose you are a system engineer in an organization and you want
to deploy or update software or an operating system on more than hundreds of systems in
your organization in one day. This can be done manually but still, it causes multiple errors,
some software’s may crash while updating and we won’t be able to revert back to the
previous version. To solve such kind of issues we use Configuration management.

Configuration Management keeps track of all the software and hardware related information
of an organization and it also repairs, deploys and updates the entire application with its
automated procedures. Configuration management does the work of multiple System
Administrators and developers who manage hundreds of server and application. Some tools
used for Configuration management are Chef, Puppet, Ansible, CF Engine, and SaltStack etc.

Why Chef?
Let us take a scenario, suppose you have shifted your office into a different environment and
you wanted your system administrator to install, update and deploy software on hundreds of
system overnight. When the system engineer does this task manually it may cause Human
errors and some software’s may not function properly. At this stage, we use Chef which is a
powerful automated tool which transfers infrastructure into code.

Benefits of Chef
i. Accelerating software delivery, when your infrastructure is automated all the software
requirements like testing, creating new environments for software deployments etc.
becomes faster.

ii. Increased service Resiliency, by making the infrastructure automated it monitors for
bugs and errors before they occur it can also recover from errors more quickly.

iii. Risk Management, chef lowers risk and improves compliance at all stages of
deployment. It reduces the conflicts during the development and production
environment.

iv. Cloud Adoption, Chef can be easily adapted to a cloud environment and the servers
and infrastructure can be easily configured, installed and managed automatically by
Chef.

v. Managing Data Centers and Cloud Environments, as discussed earlier Chef can run
on different platforms, under chef you can manage all your cloud and on-premise
platforms including servers.

vi. Streamlined IT operation and Workflow, Chef provides a pipeline for continuous
deployment starting from building to testing and all the way through delivery,
monitoring, and troubleshooting.
Features of Chef
i. Easily manage hundreds of server with a handful of employees.
ii. It can be easily managed using operating systems such as Linux, Windows, FreeBSD,
and
iii. It maintains a blueprint of the entire infrastructure.
iv. It integrates with all major cloud service providers.
v. Centralized management, i.e., a single Chef server can be used as the center for
deploying the policies.

Pros of Chef
i. One of the most flexible solutions for OS and middleware management.
ii. Designed for programmers.
iii. Chef offers hybrid and SaaS solutions for Chef Servers
iv. Sequential execution order
v. Very stable, reliable and mature, especially for large deployments in both public and
private environments.

Cons of Chef
i. Requires steep learning curve
ii. Initial setup is complicated.
iii. Lacks push, so no immediate actions on change. The pull process follows a specified
schedule.

How Chef Works?


Chef basically consists of three components, Chef Server, workstations and Nodes. The chef
server is center hubs of all the operations were changes are stored. The workstation is the
place all the codes are created or changed. Nodes are a machine that is managed by chef.

The user can interact with chef and chef server through Chef Workstation. Knife and Chef
command line tools are used for interacting with Chef Server. Chef node is a virtual or a
cloud machine managed by chef and each node is configured by Chef-Client installed on it.
Chef server stores all part of the configuration. It ensures all the elements are in right place
and are working as expected.

Chef Components
Chef has major components such as Workstation, Cookbook, Node, Chef-Client, and Chef-
Server. Let us see the entire major component in detail.

Chef Server
Chef server contains all configuration data and it stores cookbooks, recipes, and metadata that
describe each node in the Chef-Client. Configuration details are given to node through Chef-
Client. Any changes made must pass through the Chef server to be deployed. Prior to pushing
the changes, it verifies that the nodes and workstation are paired with the server through the
use of authorization keys, and then allow for communication between workstations and
nodes.

Workstation
The workstation is used to interact with Chef-server and also to interact with Chef-nodes. It is
also used to create Cookbooks. Workstation is a place where all the interaction takes place
where Cookbooks are created, tested and deployed, and in workstation, codes are tested.
Workstation is also used for defining roles and environments based on the development and
production environment. Some components of workstation are

Development Kit it contains all the packages requires for using Chef

Chef Command line tool is a place where cookbooks are created, tested and deployed and
through this policies are uploaded to Chef Server.

Knife is used for interacting with Chef Nodes.

Test Kitchen is for validating Chef Code

Chef-Repo is a repository in which cookbooks are created, tested and maintained though
Chef Command line tool.
Cookbooks are created using Ruby language and Domain Specific languages are used for
specific resources. A cookbook contains recipes which specify resources to be used and in
which order it is to be used. The cookbook contains all the details regarding the work and it
changes the configuration of the Chef-Node.

Attributes are used for overriding default setting in a node.

Files are for transferring files from sub directory to a specific path in chef-client.

Libraries are written in Ruby and it’s used for configuring custom resources and recipes.

Metadata contains information for deploying the cookbooks to each node.

Recipes are a configuration element that is stored in a cookbook. Recipes can also be
included in other recipes and executed based on the run list. Recipes are created using Ruby
language.

Nodes
Nodes are managed by Chef and each node is configured by installing Chef-Client on it.
Chef-Nodes are a machine such as physical, virtual cloud etc.

Nodes
Chief-Client is for registering and authenticating node, building node objects and for
configuration of the nodes. Chief-client runs locally on every node to configure the node.

Ohai
Ohai is used for determining the system state at beginning of Chef run in Chef-Client. It
Collects. All the system configuration data.
What Is Ansible?
Ansible is a popular IT automation engine that automates tasks that are either cumbersome or
repetitive or complex like configuration management, cloud provisioning, software
deployment, and intra-service orchestration.

Ansible is used for the multi-tier deployments and it models all of IT infrastructure into one
deployment instead of handling each one separately. There are no agents and no custom
security architecture is required to be used in the Ansible architecture. The deployment is
simple plain English like language that is used in Ansible called YAML which stands for
“YAML Ain’t Markup Language.”

To work with Ansible is very easy; it pushes out small programs called “Ansible Modules” to
your nodes to connect. It can deploy and connect using the SSH agent to execute the modules
and then removes it when finished. There are no servers, daemons or databases required these
modules can reside anywhere in the machines. You need to work with any text editor or
terminal programs and along with a version control system to manage the changes in the
content. Ansible has over 750 modules built into it.

In Ansible the passwords are supported, However, you can use SSH keys with the ssh-agents
as one of the methods to work with Ansible. You can create any user account and the root
user is required. To configure what machines can access which hosts there is a module called
"authorized_key".

You can add machines to the Ansible in a simple text format and manage your inventory. It
can use the inventory and variable information from other sources such as Rackspace, EC2,
and Openstack, etc.

If you need to write your code then also you can use Ansible in languages such as Python,
Ruby, and Bash, etc which return JSON. You can write your modules, API, and Plugins.

Playbooks are the simple and powerful automation language used to orchestrate multiple
infrastructures in one goes. This can be done in Ansible.

Ansible for DevOps


Ansible is the most preferred DevOps tool for orchestration, automation, configuration, and
managing the IT Infrastructure. The benefits of Ansible in DevOps is to respond and scale in
pace with the demand. The following are the benefits of Ansible in DevOps,

The feedback loop is accelerated at a faster rate


The bugs are found sooner and not wait till the end
Risk due to lack of sufficient knowledge is mitigated
The deployments are reliable
The IT infrastructure is coordinated
The deployments are faster
Need for automation
Version control and configuration management
Orchestration of the IT Infrastructure.
Do we need Ansible? Why
Ansible is very useful and you would appreciate it with the example when there are 4 or 5
web servers to be configured and deployed, and when there are more than 4 database servers
to be configured and deployed. There are applications in the web servers and it connects the
database servers at the backend. Now the traditional situation demands that you separately
configure these servers and manage them.

However, these servers will have various application updates. Even a system admin cannot
handle if there are more servers and their configurations will not be identical. These tasks are
complex to do and to manage the number of servers without putting a lot of effort into system
admin as well as by developers who are developing the applications. Just imagine other
servers which the organization has such as DNS, NTP, AD, Email, etc

This is where Ansible comes into the picture. Infrastructure automation and orchestrations
can be done by Ansible. All the similar servers can be handled and managed in one go by
Ansible.

DevOps Training

Uses of Ansible
The use cases of Ansible are listed below

Infrastructure Provisioning
Configuration Management
IT automation
Continuous deployment
Application Development
Network Automation
Security Automation
Infrastructure Orchestration

Top 10 benefits of using Ansible


Agentless –There are no agents or software deployed on the clients/servers to work with
Ansible. The connection can be done through the SSH or using the Python.
English Like Language – To use the Ansible, configure, and deploy the infrastructure is very
simple and it is English like the language used called YAML.
Modular – The Ansible uses modules to automate, configure, deploy, and orchestrate the IT
Infrastructure. There are around 750 + modules built-in Ansible.
Efficient – There are no servers, daemons, or databases required for Ansible to work.
Features – Ansible comes with a whole lot of features and can be used to manage the
Operating systems, IT Infrastructure, the networks, the servers, and services in very less time.
Secure and consistent – Since the Ansible uses SSH and Python it is very secure and the
operations are flawless.
Reliable – The Ansible Playbook can be used to write programs or the modules and can be
used to manage the IT without any downside.
Performance- The Ansible’s performance is excellent and has very little latency.
Low Overhead – As it is agentless and does not require any servers, daemons, or databases it
can provide a lot of space in the systems and has low overhead in terms of deployment.
Simple – It is very simple to use and is supported by YAML
What Ansible Can Do?
Configuration Management - The enterprise hardware and software information is recorded
and updated in detail, thus maintaining the consistency of the product performance.
Application Deployment - The applications can be managed in Ansible from Development to
Production when you define and manage the applications using Ansible.
Orchestration - To manage as a whole and how the configurations interact.
Security and Compliance - Wide security policy can be deployed across the infrastructure
when the policy is defined in Ansible
Provisioning - Helps to automate and manage the process
Ansible Architecture an overview
The Ansible architecture is shown below in the diagram.

The Ansible Orchestration engine is the center of the Ansible tool.


It consists of an Inventory table, API, Plugins, and modules written to configure, manage,
automate, and orchestrate the process.
It can get the inputs from the Playbook software, public/private cloud, and configuration
management databases to do the networking manage the hosts or the servers, operating
systems, and manage security.

What is Maven?
Maven is a project management and comprehension tool that provides developers a complete
build lifecycle framework. Development team can automate the project's build infrastructure
in almost no time as Maven uses a standard directory layout and a default build lifecycle.

In case of multiple development teams environment, Maven can set-up the way to work as
per standards in a very short time. As most of the project setups are simple and reusable,
Maven makes life of developer easy while creating reports, checks, build and testing
automation setups.

Maven provides developers ways to manage the following −

Builds
Documentation
Reporting
Dependencies
SCMs
Releases
Distribution
Mailing list
To summarize, Maven simplifies and standardizes the project build process. It handles
compilation, distribution, documentation, team collaboration and other tasks seamlessly.
Maven increases reusability and takes care of most of the build related tasks.

Maven Evolution
Maven was originally designed to simplify building processes in Jakarta Turbine project.
There were several projects and each project contained slightly different ANT build files.
JARs were checked into CVS.
Apache group then developed Maven which can build multiple projects together, publish
projects information, deploy projects, share JARs across several projects and help in
collaboration of teams.

Objective
The primary goal of Maven is to provide developer with the following −

A comprehensive model for projects, which is reusable, maintainable, and easier to


comprehend.

Plugins or tools that interact with this declarative model.

Maven project structure and contents are declared in an xml file, pom.xml, referred as Project
Object Model (POM), which is the fundamental unit of the entire Maven system. In later
chapters, we will explain POM in detail.
Features of Maven
Simple project setup that follows best practices.

Consistent usage across all projects.

Dependency management including automatic updating.

A large and growing repository of libraries.

Extensible, with the ability to easily write plugins in Java or scripting languages.

Instant access to new features with little or no extra configuration.

Model-based builds − Maven is able to build any number of projects into predefined output
types such as jar, war, metadata.

Coherent site of project information − Using the same metadata as per the build process,
maven is able to generate a website and a PDF including complete documentation.

Release management and distribution publication − Without additional configuration, maven


will integrate with your source control system such as CVS and manages the release of a
project.

Backward Compatibility − You can easily port the multiple modules of a project into Maven
3 from older versions of Maven. It can support the older versions also.

Automatic parent versioning − No need to specify the parent in the sub module for
maintenance.

Parallel builds − It analyzes the project dependency graph and enables you to build schedule
modules in parallel. Using this, you can achieve the performance improvements of 20-50%.

Better Error and Integrity Reporting − Maven improved error reporting, and it provides you
with a link to the Maven wiki page where you will get full description of the error.
What is Continuous Monitoring
Continuous monitoring starts when the deployment is done on the production servers. From
then on, this stage is responsible to monitor everything happening. This stage is very crucial
for the business productivity.

There are several benefits of using Continuous monitoring −

It detects all the server and network problems.


It finds the root cause of the failure.
It helps in reducing the maintenance cost.
It helps in troubleshooting the performance issues.
It helps in updating infrastructure before it gets outdated.
It can fix problems automatically when detected.
It makes sure the servers, services, applications, network is always up and running.
It monitors complete infrastructure every second.
What is Nagios
Nagios is an open source continuous monitoring tool which monitors network, applications
and servers. It can find and repair problems detected in the infrastructure, and stop future
issues before they affect the end users. It gives the complete status of your IT infrastructure
and its performance.

Why Nagios
Nagios offers the following features making it usable by a large group of user community −

It can monitor Database servers such as SQL Server, Oracle, Mysql, Postgres
It gives application level information (Apache, Postfix, LDAP, Citrix etc.).
Provides active development.
Has excellent support form huge active community.
Nagios runs on any operating system.
It can ping to see if host is reachable.
Benefits of Nagios
Nagios offers the following benefits for the users −

It helps in getting rid of periodic testing.


It detects split-second failures when the wrist strap is still in the “intermittent” stage.
It reduces maintenance cost without sacrificing performance.
It provides timely notification to the management of control and breakdown.
Nagios Architecture
The following points are worth notable about Nagios architecture −

Nagios has server-agent architecture.

Nagios server is installed on the host and plugins are installed on the remote hosts/servers
which are to be monitored.

Nagios sends a signal through a process scheduler to run the plugins on the local/remote
hosts/servers.

Plugins collect the data (CPU usage, memory usage etc.) and sends it back to the scheduler.
Then the process schedules send the notifications to the admin/s and updates Nagios GUI.

Development Before Jenkins


Before the advent of Jenkins, developers had to complete code testing before they could
check for errors. Developers on teams, tending to work independently, each created large
segments of code to add to the base code. The entire source code would be checked for errors
- a time-consuming and challenging undertaking. Multiple developers would each send
commits to version control, increasing the time required to identify and fix bugs. There was
no iterative code improvement, and the software delivery process was slow.

What is Jenkins?
Jenkins to the rescue! As a Continuous Integration tool, Jenkins allows seamless, ongoing
development, testing, and deployment of newly created code. Continuous Integration is a
process wherein developers commit changes to source code from a shared repository, and all
the changes to the source code are built continuously. This can occur multiple times daily.
Each commit is continuously monitored by the CI Server, increasing the efficiency of code
builds and verification. This removes the testers' burdens, permitting quicker integration and
fewer wasted resources.

As you can see in the diagram provided above, on the left is the Remote source code
repository. The Jenkins server accesses the master environment on the left side and the
master environment can push down to multiple other Jenkins Slave environments to distribute
the workload.

That lets you run multiple builds, tests, and product environment across the entire
architecture. Jenkins Slaves can be running different build versions of the code for different
operating systems and the server Master controls how each of the builds operates.
Why Jenkins?
Jenkins is a software that allows continuous integration. Jenkins will be installed on a server
where the central build will take place. The following flowchart demonstrates a very simple
workflow of how Jenkins works.

Why Jenkins
Along with Jenkins, sometimes, one might also see the association of Hudson. Hudson is a
very popular open-source Java-based continuous integration tool developed by Sun
Microsystems which was later acquired by Oracle. After the acquisition of Sun by Oracle, a
fork was created from the Hudson source code, which brought about the introduction of
Jenkins.

What is Continuous Integration?


Continuous Integration is a development practice that requires developers to integrate code
into a shared repository at regular intervals. This concept was meant to remove the problem
of finding later occurrence of issues in the build lifecycle. Continuous integration requires the
developers to have frequent builds. The common practice is that whenever a code commit
occurs, a build should be triggered.

What are the Jenkins Features?


Jenkins offers many attractive features for developers:

Easy Installation
Jenkins is a platform-agnostic, self-contained Java-based program, ready to run with
packages for Windows, Mac OS, and Unix-like operating systems.
Easy Configuration
Jenkins is easily set up and configured using its web interface, featuring error checks and a
built-in help function.
Available Plugins
There are hundreds of plugins available in the Update Center, integrating with every tool in
the CI and CD toolchain.
Extensible
Jenkins can be extended by means of its plugin architecture, providing nearly endless
possibilities for what it can do.
Easy Distribution
Jenkins can easily distribute work across multiple machines for faster builds, tests, and
deployments across multiple platforms.
Free Open Source
Jenkins is an open-source resource backed by heavy community support.
As a part of our learning about what is Jenkins, let us next learn about the Jenkins
architecture.

Advantages of Using Jenkins


Jenkins is a powerful tool truly built and friendly for developers. Here are some of the most
significant advantages of using Jenkins:

1. Free to Use
Jenkins is fully open-source and free to use. Since its development in 2011, it is the most
preferred CI/CD tool used by developers in both early-stage startups and big organizations.

2. Rich Plugin Ecosystem


There are over a thousand different plugins that can be used to enhance the functionality of a
Jenkins environment and suit the specific needs of an organization.

3. Easy Integration
Jenkins can be easily integrated with a number of popular cloud platforms such as Google
Cloud, Digital Ocean, Amazon EC2 and more.

Disadvantages of Using Jenkins


Jenkins also has its own share of disadvantages. Here are some of the most common ones:

1. Developer Centric
Jenkins is more developer-centric and feature-driven. A person may need to have some sort
of developer experience to use Jenkins.

2. Setting Change Issues


There are some issues (such as Jenkins not starting up) that you may face when you change
the settings in Jenkins. These issues can come up when you install some plugins as well.
Fortunately, Jenkins has a large user base so you can search online for a solution whenever
you are faced with these issues.

You might also like