Book Image

DevOps Bootcamp

By : Mitesh Soni
Book Image

DevOps Bootcamp

By: Mitesh Soni

Overview of this book

DevOps Bootcamp delivers practical learning modules in manageable chunks. Each chunk is delivered in a day, and each day is a productive one. Each day builds your competency in DevOps. You will be able to take the task you learn every day and apply it to cultivate the DevOps culture. Each chapter presents core concepts and key takeaways about a topic in DevOps and provides a series of hands-on exercises. You will not only learn the importance of basic concepts or practices of DevOps but also how to use different tools to automate application lifecycle management. We will start off by building the foundation of the DevOps concepts. On day two, we will perform Continuous Integration using Jenkins and VSTS both by configuring Maven-based JEE Web Application?. We will also integrate Jenkins and Sonar qube for Static Code Analysis. Further, on day three, we will focus on Docker containers where we will install and configure Docker and also create a Tomcat Container to deploy our Java based web application. On day four, we will create and configure the environment for application deployment in AWS and Microsoft Azure Cloud for which we will use Infrastructure as a Service and Open Source Configuration Management tool Chef. For day five, our focus would be on Continuous Delivery. We will automate application deployment in Docker container using Jenkins Plugin, AWS EC2 using Script, AWS Elastic Beanstalk using Jenkins Plugin, Microsoft Azure VM using script, and Microsoft Azure App Services Using Jenkins. We will also configure Continuous Delivery using VSTS. We will then learn the concept of Automated Testing on day six using Apache JMeter and URL-based tests in VSTS. Further, on day seven, we will explore various ways to automate application lifecycle management using orchestration. We will see how Pipeline can be created in Jenkins and VSTS, so the moment Continuous? Integration is completed successfully, Continuous Delivery will start and application will be deployed. On the final day, our focus would be on Security access to Jenkins and Monitoring of CI resources, and cloud-based resources in AWS and Microsoft Azure Platform as a Service.
Table of Contents (9 chapters)

How can DevOps culture evolve?

Inefficient estimation, a long time to market, and other issues led to a change in the waterfall model, resulting in the agile model. Evolving a culture is not a time-bound or overnight process. It can be a step-by-step and stagewise process that can be achieved without dependencies on the other stages.

We can achieve continuous integration without Cloud Provisioning. We can achieve Cloud Provisioning without Configuration Management. We can achieve Continuous Testing without any other DevOps practices. The following are different stages to achieve DevOps practices:

Agile development

Agile development or agile-based methodologies are useful for building an application by empowering individuals and encouraging interactions, giving importance to working software, customer collaboration—using feedback for improvement in subsequent steps—and responding to change in an efficient manner.

One of the most attractive benefits of agile development is continuous delivery in short time frames or, in agile terms, sprints. Thus, the agile approach of application development, improvement in technology, and disruptive innovations and approaches have created a gap between the development and operations teams.

DevOps

DevOps attempts to fill these gaps by developing a partnership between the development and operations teams. The DevOps movement emphasizes communication, collaboration, and integration between software developers and IT operations.

DevOps promotes collaboration, and collaboration is facilitated by automation and orchestration in order to improve processes. In other words, DevOps essentially extends the continuous development goals of the agile movement to continuous integration and release.

DevOps is a combination of agile practices and processes, leveraging the benefits of cloud solutions. Agile development and testing methodologies help us meet the goals of continuously integrating, developing, building, deploying, testing, and releasing applications.

Build automation

An automated build helps us create an application build using build automation tools such as Gradle, Apache Ant, and Apache Maven.

An automated build process includes activities such as compiling source code into class files or binary files, providing references to third-party library files, providing the path of configuration files, packaging class files or binary files into package files, executing automated test cases, deploying package files on local or remote machines, and reducing manual effort in creating the package file.

Continuous integration

In simple words, continuous integration or CI is a software engineering practice, where each check-in made by a developer is verified by either of the following:

  • Pull mechanism: executing an automated build at a scheduled time
  • Push mechanism: executing an automated build when changes are saved in the repository

This step is followed by executing a unit test against the latest changes available in the source code repository. Continuous integration is a popular DevOps practice that requires developers to integrate code into code repositories such as Git and SVN multiple times a day to verify the integrity of the code.

Each check-in is then verified by an automated build, allowing teams to detect problems early.

CI, and even CD, is the baseline for companies to even archive DevOps. We can’t do DevOps without good CI and CD implementations in your organization.

Cloud provisioning

We have already covered the basics of cloud computing earlier in the chapter. Cloud provisioning has opened the door to treat Infrastructure as Code (IAC), and that makes the entire process extremely efficient and effective, as we are automating a process which involved manual intervention to a huge extent.

The pay-as-you-go billing model has made the required resources more affordable to not only large organizations, but also to mid and small scale organizations, as well as individuals.

It helps to go for improvements and innovations, as earlier resource constraints were blocking organizations from going the extra mile because of cost and maintenance. Once we have agility in infrastructure resources, we can then think of automating the installation and configuration of packages that are required to run the application.

Configuration management

Configuration management (CM) manages changes in the system or, to be more specific, the server runtime environment. There are many tools available in the market with which we can achieve configuration management. The popular tools are Chef, Puppet, Ansible, Salt, and so on.

Let's consider an example where we need to manage multiple servers with the same kind of configuration.

For example, we need to install Tomcat on each server. What if we need to change the port on all servers, update some packages, or provide rights to some users? Any kind of modification in this scenario is a manual and, if so, error-prone process. As the same configuration is being used for all the servers, automation can be useful here.

Continuous delivery

Continuous delivery and continuous deployment are used interchangeably. However, there is a small difference between them.

Continuous delivery is process of deploying an application in any environment in an automated fashion and providing continuous feedback to improve its quality.

An automated approach may not change in continuous delivery and continuous deployment. The approval process and some other minor things can change.

Continuous testing and deployment

Continuous testing is the very important phase of the end-to-end application life cycle management process. It involves functional testing, performance testing, security testing, and so on.

Selenium, Appium, Apache JMeter, and many other tools can be utilized for the same.

Continuous deployment, on the other hand, is all about deploying an application with the latest changes to the production environment.

Continuous monitoring

Continuous monitoring is a backbone of the end-to-end delivery pipeline, and open source monitoring tools are like toppings on an ice cream scoop.

It is desirable to have monitoring at almost every stage in order to have transparency about all the processes, as shown in the following diagram. It also helps us troubleshoot quickly. Monitoring should be a well thought-out implementation of a plan.

Let's try to depict the entire process as a continuous approach in the following diagram:

We need to understand here that it is a phased approach and it is not necessary to automate every phase of automation at once. It is more effective to take one DevOps practice at a time, implement it and realize its benefit before implementing another one.

This way we are safe enough to assess the improvements of changing the culture in the organization and remove manual efforts from the application life cycle management.