Book Image

Learning DevOps - Second Edition

By : Mikael Krief
Book Image

Learning DevOps - Second Edition

By: Mikael Krief

Overview of this book

In the implementation of DevOps processes, the choice of tools is crucial to the sustainability of projects and collaboration between developers and ops. This book presents the different patterns and tools for provisioning and configuring an infrastructure in the cloud, covering mostly open source tools with a large community contribution, such as Terraform, Ansible, and Packer, which are assets for automation. This DevOps book will show you how to containerize your applications with Docker and Kubernetes and walk you through the construction of DevOps pipelines in Jenkins as well as Azure pipelines before covering the tools and importance of testing. You'll find a complete chapter on DevOps practices and tooling for open source projects before getting to grips with security integration in DevOps using Inspec, Hashicorp Vault, and Azure Secure DevOps kit. You'll also learn about the reduction of downtime with blue-green deployment and feature flags techniques before finally covering common DevOps best practices for all your projects. By the end of this book, you'll have built a solid foundation in DevOps and developed the skills necessary to enhance a traditional software delivery process using modern software delivery tools and techniques.
Table of Contents (25 chapters)
1
Section 1: DevOps and Infrastructure as Code
7
Section 2: DevOps CI/CD Pipeline
11
Section 3: Containerized Microservices with Docker and Kubernetes
14
Section 4: Testing Your Application
18
Section 5: Taking DevOps Further/More on DevOps

What this book covers

Chapter 1, The DevOps Culture and Infrastructure as Code Practices, explains the objectives of the DevOps culture and details the different DevOps practices – IaC and CI/CD pipelines – that will be seen throughout this book.

Chapter 2, Provisioning Cloud Infrastructure with Terraform, details provisioning cloud infrastructure with IaC using Terraform, including its installation, its command line, its life cycle, practical usage for provisioning a sample of Azure infrastructure, and the protection of Terraform state files with remote backends.

Chapter 3, Using Ansible for Configuring IaaS Infrastructure, concerns the configuration of VMs with Ansible, including Ansible's installation, command lines, setting up roles for an inventory and a playbook, its use in configuring VMs in Azure, data protection with Ansible Vault, and the use of a dynamic inventory.

Chapter 4, Optimizing Infrastructure Deployment with Packer, covers the use of Packer to create VM images, including its installation and how it is used for creating images in Azure.

Chapter 5, Authoring the Development Environment with Vagrant, explains how to build a local development environment using IaC and Vagrant.

Chapter 6, Managing Your Source Code with Git, explores the use of Git, including its installation, its principal command lines, its workflow, an overview of the branch system, and an example of a workflow with GitFlow.

Chapter 7, Continuous Integration and Continuous Delivery, shows the creation of an end-to-end CI/CD pipeline using three different tools: Jenkins, GitLab CI, and Azure Pipelines. For each of these tools, we will explain their characteristics in detail.

Chapter 8, Deploying Infrastructure as Code with a CI/CD Pipeline, discusses the usage of CI/CD pipelines with Azure Pipelines to automatically execute Packer, Terraform, and Ansible.

Chapter 9, Containerizing Your Application with Docker, covers the use of Docker, including its local installation, an overview of the Docker Hub registry, writing a Dockerfile, and a demonstration of how it can be used. An example of an application will be containerized, executed locally, and then deployed in an Azure container instance via a CI/CD pipeline.

Chapter 10, Managing Containers Effectively with Kubernetes, explains the basic use of Kubernetes, including its local installation and application deployment, and then an example of Kubernetes managed with Azure Kubernetes Services.

Chapter 11, Testing APIs with Postman, details the use of Postman to test an example of an API, including its local use and automation in a CI/CD pipeline with Newman and Azure Pipelines.

Chapter 12, Static Code Analysis with SonarQube, explains the use of SonarQube to analyze static code in an application, including its installation, real-time analysis with the SonarLint tool, and the integration of SonarQube into a CI pipeline in Azure Pipelines.

Chapter 13, Security and Performance Tests, discusses the security and performance of web applications, including demonstrations of how to use the ZAP tool to test OWASP rules and Postman to test API performance.

Chapter 14, Security in the DevOps Process with DevSecOps, explains how to use security integration in the DevOps process through testing compliance of the infrastructure with Inspec, and the usage of Vault for protecting sensitive data.

Chapter 15, Reducing Deployment Downtime, presents the reduction of deployment downtime with Terraform, the concepts and patterns of blue-green deployment, and how to apply them in Azure. Significant focus is also given to the use of feature flags within an application.

Chapter 16, DevOps for Open Source Projects, is dedicated to open source. It details the tools, processes, and practices for open source projects with collaboration in GitHub, pull requests, changelog files, binary sharing in GitHub releases, and an end-to-end example of a CI pipeline in Travis CI and in GitHub Actions. Open source code analysis and security are also discussed with SonarCloud and WhiteSource Bolt.

Chapter 17, DevOps Best Practices, reviews a DevOps list of good practices regarding automation, IaC, CI/CD pipelines, testing, security, monitoring, and project management.