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. 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
  2. 2. Requirements
    1. 2.1. Registering for a container registry
    2. 2.2. Registering for a Git registry
    3. 2.3. Creating a local Kubernetes Cluster
  3. 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
  4. 4. Kustomize
    1. 4.1. Using Kustomize to deploy Kubernetes resources
    2. 4.2. Updating 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
  5. 5. Helm
    1. 5.1. Creating a Helm project
    2. 5.2. Reusing statements between templates
    3. 5.3. Updating 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. Rolling Update automatically when a ConfigMap changes
    8. 5.8. Final Thoughts
  6. 6. Cloud Native CI/CD
    1. 6.1. Install Tekton
    2. 6.2. Create an 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. Using Tekton Triggers to compile and package an application automatically when a change occurs on Git
    6. 6.6. Containerize an application using a Tekton Task and buildah
    7. 6.7. Containerize an application using a Tekton task and Shipwright
    8. 6.8. Create a Tekton Pipeline to build and deploy an app to Kubernetes
    9. 6.9. Use Pipeline as code to compile and run tests for a new Pull Request
    10. 6.10. Update a Kubernetes resource using Kustomize and push the change to Git
    11. 6.11. Update a Kubernetes resource using Helm and create a Pull Request
    12. 6.12. Visualize the logs of Tekton Tasks and Pipelines
    13. 6.13. Use Drone to create a pipeline to compile and deploy an app to Kubernetes
  7. 7. Argo CD
    1. 7.1. Deploy application using Argo CD
    2. 7.2. Automatic Sychornization
    3. 7.3. Kustomize Integration
    4. 7.4. Helm Integration
    5. 7.5. Deploy from private Git repository
    6. 7.6. Order Kubernetes manifests
    7. 7.7. Define Synchronization Windows
  8. About the Authors

Product information

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