O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The DevOps 2.0 Toolkit

Book Description

Automating the Continuous Deployment Pipeline with Containerized Microservices

About This Book

  • First principles of devops, Ansible, Docker, Kubernetes, microservices
  • Architect your software in a better and more efficient way with microservices packed as immutable containers
  • Practical guide describing an extremely modern and advanced devops toolchain that can be improved continuously

Who This Book Is For

If you are an intermediate-level developer who wants to master the whole microservices development and deployment lifecycle using some of the latest and greatest practices and tools, this is the book for you. Familiarity with the basics of Devops and Continuous Deployment will be useful.

What You Will Learn

  • Get to grips with the fundamentals of Devops
  • Architect efficient software in a better and more efficient way with the help of microservices
  • Use Docker, Kubernetes, Ansible, Ubuntu, Docker Swarm and more
  • Implement fast, reliable and continuous deployments with zero-downtime and ability to roll-back
  • Learn about centralized logging and monitoring of your cluster
  • Design self-healing systems capable of recovery from both hardware and software failures

In Detail

Building a complete modern devops toolchain requires not only the whole microservices development and a complete deployment lifecycle, but also the latest and greatest practices and tools. Victor Farcic argues from first principles how to build a devops toolchain. This book shows you how to chain together Docker, Kubernetes, Ansible, Ubuntu, and other tools to build the complete devops toolkit.

Style and approach

This book follows a unique, hands-on approach familiarizing you to the Devops 2.0 toolkit in a very practical manner. Although there will be a lot of theory, you won't be able to complete this book by reading it in a metro on a way to work. You'll need to be in front of your computer and get your hands dirty.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. The DevOps 2.0 Toolkit
    1. Table of Contents
    2. The DevOps 2.0 Toolkit
    3. Credits
    4. About the Author
    5. www.PacktPub.com
      1. eBooks, discount offers, and more
        1. Why subscribe?
    6. Preface
      1. Overview
      2. Audience
    7. 1. The DevOps Ideal
      1. Continuous Integration, Delivery, and Deployment
        1. Architecture
        2. Deployments
        3. Orchestration
      2. The Light at the End of the Deployment pipeline
    8. 2. The Implementation Breakthrough – Continuous Deployment, Microservices, and Containers
      1. Continuous Integration
        1. Pushing to the Code repository
        2. Static analysis
        3. Pre-Deployment testing
        4. Packaging and Deployment to the Test environment
        5. Post-Deployment testing
      2. Continuous Delivery and Deployment
        1. Microservices
        2. Containers
      3. The Three Musketeers – Synergy of Continuous Deployment, Microservices, and Containers
    9. 3. System Architecture
      1. Monolithic Applications
        1. Services Split Horizontally
        2. Microservices
      2. Monolithic Applications and Microservices Compared
        1. Operational and Deployment Complexity
        2. Remote Process Calls
        3. Scaling
        4. Innovation
        5. Size
        6. Deployment, Rollback, and Fault Isolation
        7. Commitment Term
        8. Deployment Strategies
        9. Mutable Monster Server
          1. Immutable Server and Reverse Proxy
          2. Immutable Microservices
      3. Microservices Best Practices
        1. Containers
      4. Proxy Microservices or API Gateway
        1. Reverse Proxy
        2. Minimalist Approach
        3. Configuration Management
        4. Cross-Functional Teams
        5. API Versioning
        6. Final Thoughts
    10. 4. Setting Up the Development Environment with Vagrant and Docker
      1. Combining Microservice Architecture and Container Technology
        1. Vagrant and Docker
      2. Development Environment Setup
        1. Vagrant
        2. Docker
        3. Development Environment Usage
    11. 5. Implementation of the Deployment Pipeline – Initial Stages
      1. Spinning Up the Continuous Deployment Virtual Machine
      2. Deployment Pipeline Steps
          1. Checking Out the Code
        1. Running Pre – Deployment Tests, Compiling, and Packaging the Code
        2. Building Docker Containers
          1. Running Containers
          2. Pushing Containers to the Registry
          3. The Checklist
    12. 6. Configuration Management in the Docker World
      1. CFEngine
        1. Puppet
        2. Chef
          1. Ansible
        3. Final Thoughts
        4. Configuring the Production Environment
        5. Setting Up the Ansible Playbook
    13. 7. Implementation of the Deployment Pipeline – Intermediate Stages
      1. Deploying Containers to the Production Server
        1. Docker UI
        2. The Checklist
    14. 8. Service Discovery – The Key to Distributed Services
      1. Service Registry
        1. Service Registration
        2. Self-Registration
        3. Registration Service
        4. Service Discovery
          1. Self-Discovery
          2. Proxy Service
        5. Service Discovery Tools
        6. Manual Configuration
        7. Zookeeper
        8. etcd
          1. Setting Up etcd
          2. Setting Up Registrator
          3. Setting Up confd
          4. Combining etcd, Registrator, and confd
        9. Consul
          1. Setting Up Consul
        10. Setting Up Registrator
          1. Setting Up Consul Template
        11. Consul Health Checks, Web UI, and Data Centers
          1. Combining Consul, Registrator, Template, Health Checks and WEB UI
      2. Service Discovery Tools Compared
    15. 9. Proxy Services
      1. Reverse Proxy Service
        1. How can Proxy Service help our project?
        2. nginx
          1. Setting Up nginx
          2. Living without a Proxy
          3. Manually Configuring nginx
          4. Automatically Configuring nginx
        3. HAProxy
          1. Manually Configuring HAProxy
          2. Automatically Configuring HAProxy
      2. Proxy Tools Compared
    16. 10. Implementation of the Deployment Pipeline – The Late Stages
      1. Starting the Containers
      2. Integrating the Service
      3. Running Post-Deployment Tests
      4. Pushing the Tests Container to the Registry
      5. The Checklist
    17. 11. Automating Implementation of the Deployment Pipeline
      1. Deployment Pipeline Steps
        1. The Playbook and the Role
        2. Pre-Deployment tasks
        3. Deployment tasks
        4. Post-Deployment tasks
      2. Running the Automated Deployment Pipeline
    18. 12. Continuous Integration, Delivery and Deployment Tools
      1. CI/CD Tools Compared
        1. The Short History of CI/CD Tools
        2. Jenkins
          1. Setting Up Jenkins
          2. Setting Up Jenkins with Ansible
          3. Running Jenkins Jobs
          4. Setting Up Jenkins Workflow Jobs
          5. Setting Up Jenkins Multibranch Workflow and Jenkinsfile
        3. Final Thoughts
    19. 13. Blue-Green Deployment
      1. The blue-green deployment process
      2. Manually running the blue-green deployment
        1. Deploying the blue release
        2. Integrating the blue release
        3. Deploying the green release
        4. Integrating the green release
        5. Removing the blue release
        6. Discovering which release to deploy and rolling back
      3. Automating the blue-green deployment with Jenkins workflow
        1. Blue-green deployment role
        2. Running the blue-green deployment
    20. 14. Clustering and Scaling Services
      1. Scalability
        1. Axis scaling
          1. X-Axis scaling
          2. Y-Axis scaling
          3. Z-Axis scaling
        2. Clustering
        3. Docker Clustering Tools Compared – Kubernetes versus Docker Swarm versus Mesos
          1. Kubernetes
          2. Docker Swarm
          3. Apache Mesos
        4. Setting It Up
        5. Running Containers
        6. The Choice
      2. Docker Swarm walkthrough
      3. Setting Up Docker Swarm
        1. Deploying with Docker Swarm
        2. Deploying with Docker Swarm without Links
        3. Deploying with Docker Swarm and Docker Networking
        4. Scaling Services with Docker Swarm
        5. Scheduling Containers Depending on Reserved CPUs and Memory
      4. Automating Deployment with Docker Swarm and Ansible
        1. Examining the Swarm Deployment Playbook
          1. Running the Swarm Jenkins Workflow
          2. The Second Run of the Swarm Deployment Playbook
          3. Cleaning Up
    21. 15. Self-Healing Systems
      1. Self-Healing Levels and Types
        1. Self-Healing on the Application Level
        2. Self-Healing on the System Level
          1. Time-To-Live
          2. Pinging
        3. Self-Healing on the Hardware Level
        4. Reactive healing
        5. Preventive healing
      2. Self-Healing Architecture
      3. Self-Healing with Docker, Consul Watches, and Jenkins
        1. Setting Up the Environments
          1. Setting Up Consul Health Checks and Watches for Monitoring Hardware
      4. Automatically Setting Up Consul Health Checks and Watches for Monitoring Hardware
          1. Setting Up Consul Health Checks and Watches for Monitoring Services
      5. Preventive Healing through Scheduled Scaling and Descaling
        1. Reactive Healing with Docker Restart Policies
        2. Combining On-Premise with Cloud Nodes
      6. Self-Healing Summary (So Far)
    22. 16. Centralized Logging and Monitoring
      1. The Need for Centralized Logging
      2. Sending Log Entries to ElasticSearch
        1. Parsing Log Entries
        2. Sending Log Entries to a Central LogStash Instance
        3. Sending Docker Log Entries to a Central LogStash Instance
      3. Self-Healing Based on Software Data
        1. Logging Hardware Status
        2. Self-Healing Based on Hardware Data
        3. Final Thoughts
    23. 17. Farewell
    24. A. Docker Flow
      1. The Background
        1. The Standard Setup
        2. The Problems
          1. Deploying Without Downtime
          2. Scaling Containers using Relative Numbers
          3. Proxy Reconfiguration after the New Release Is Tested
          4. Solving The Problems
        3. Docker Flow Walkthrough
          1. Setting it up
          2. Reconfiguring Proxy after Deployment
        4. Deploying a New Release without Downtime
          1. Scaling the service
          2. Testing Deployments to Production
    25. Index