Devops
Devops
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.
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.
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.
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.
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.
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
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.
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 −
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.
Extensible, with the ability to easily write plugins in Java or scripting languages.
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.
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.
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 −
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.
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.
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.
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.
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.
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.