GitOps Cookbook

Book description

Why are so many companies adopting GitOps for their DevOps and cloud native strategy? This reliable framework is quickly becoming the standard method for deploying apps to Kubernetes. With this practical, developer-oriented book, DevOps engineers, developers, IT architects, and SREs will learn the most useful recipes and examples for following GitOps practices.

Through their years of experience in application modernization, CI/CD, and automation, authors Alex Soto Bueno and Natale Vinto from Red Hat walk you through all the steps necessary for successful hands-on application development and deployment with GitOps. Once you start using the recipes in this book, you'll have a head start in development cycles on Kubernetes following the GitOps approach.

You'll learn how to:

  • Develop and deploy applications on Kubernetes
  • Understand the basics of CI/CD and automation on Kubernetes, and apply GitOps practices to
  • implement development cycles on the platform
  • Prepare the app for deployment on multiple environments and/or multiple Kubernetes clusters
  • Deploy apps for either multiple environments using GitOps and Argo CD, or for Kubernetes clusters
  • Create Kubernetes-native pipelines with Tekton
  • Provide and extend DevOps skills for the team working on Kubernetes
  • Use progressive delivery to put your applications into production

Publisher resources

View/Submit Errata

Table of contents

  1. Foreword
  2. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. O’Reilly Online Learning
    4. How to Contact Us
    5. Acknowledgments
  3. 1. Introduction
    1. 1.1. What Is GitOps?
    2. 1.2. Why GitOps?
    3. 1.3. Kubernetes CI/CD
    4. 1.4. App Deployment with GitOps on Kubernetes
    5. 1.5. DevOps and Agility
  4. 2. Requirements
    1. 2.1. Registering for a Container Registry
    2. 2.2. Registering for a Git Repository
    3. 2.3. Creating a Local Kubernetes Cluster
  5. 3. Containers
    1. 3.1. Building a Container Using Docker
    2. 3.2. Building a Container Using Dockerless Jib
    3. 3.3. Building a Container Using Buildah
    4. 3.4. Building a Container with Buildpacks
    5. 3.5. Building a Container Using Shipwright and kaniko in Kubernetes
    6. 3.6. Final Thoughts
  6. 4. Kustomize
    1. 4.1. Using Kustomize to Deploy Kubernetes Resources
    2. 4.2. Updating the Container Image in Kustomize
    3. 4.3. Updating Any Kubernetes Field in Kustomize
    4. 4.4. Deploying to Multiple Environments
    5. 4.5. Generating ConfigMaps in Kustomize
    6. 4.6. Final Thoughts
  7. 5. Helm
    1. 5.1. Creating a Helm Project
    2. 5.2. Reusing Statements Between Templates
    3. 5.3. Updating a Container Image in Helm
    4. 5.4. Packaging and Distributing a Helm Chart
    5. 5.5. Deploying a Chart from a Repository
    6. 5.6. Deploying a Chart with a Dependency
    7. 5.7. Triggering a Rolling Update Automatically
    8. 5.8. Final Thoughts
  8. 6. Cloud Native CI/CD
    1. 6.1. Install Tekton
    2. 6.2. Create a Hello World Task
    3. 6.3. Create a Task to Compile and Package an App from Git
    4. 6.4. Create a Task to Compile and Package an App from Private Git
    5. 6.5. Containerize an Application Using a Tekton Task and Buildah
    6. 6.6. Deploy an Application to Kubernetes Using a Tekton Task
    7. 6.7. Create a Tekton Pipeline to Build and Deploy an App to Kubernetes
    8. 6.8. Using Tekton Triggers to Compile and Package an Application Automatically When a Change Occurs on Git
    9. 6.9. Update a Kubernetes Resource Using Kustomize and Push the Change to Git
    10. 6.10. Update a Kubernetes Resource Using Helm and Create a Pull Request
    11. 6.11. Use Drone to Create a Pipeline for Kubernetes
    12. 6.12. Use GitHub Actions for CI
  9. 7. Argo CD
    1. 7.1. Deploy an Application Using Argo CD
    2. 7.2. Automatic Synchronization
    3. 7.3. Kustomize Integration
    4. 7.4. Helm Integration
    5. 7.5. Image Updater
    6. 7.6. Deploy from a Private Git Repository
    7. 7.7. Order Kubernetes Manifests
    8. 7.8. Define Synchronization Windows
  10. 8. Advanced Topics
    1. 8.1. Encrypt Sensitive Data (Sealed Secrets)
    2. 8.2. Encrypt Secrets with ArgoCD (ArgoCD + HashiCorp Vault + External Secret)
    3. 8.3. Trigger the Deployment of an Application Automatically (Argo CD Webhooks)
    4. 8.4. Deploy to Multiple Clusters
    5. 8.5. Deploy a Pull Request to a Cluster
    6. 8.6. Use Advanced Deployment Techniques
  11. Index
  12. About the Authors

Product information

  • Title: GitOps Cookbook
  • Author(s): Natale Vinto, Alex Soto Bueno
  • Release date: January 2023
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781492097471