Chapter 18. GitOps and Deployment

In this chapter, we will discuss GitOps and how it can be used to deploy and manage applications on Kubernetes. We will deep dive into best practices of setting up a GitOps workflow and how to utilize the different tools available to achieve this.

GitOps is a way to do Kubernetes application deployment. It works by utilizing Git as a single source of truth for your Kubernetes resources. With Git at the center of your deployment pipelines, developers and operators can make pull requests to accelerate and simplify application deployments and operations tasks in Kubernetes. This allows you to utilize the same practices for managing Kubernetes resources as you do for managing application code. Developers will be very familiar with the workflow, as they can utilize the same tools they use to work with application code.

We cover the following topics in this chapter:

  • What is GitOps?

  • Why utilize GitOps?

  • GitOps compared to other deployment methods

  • Patterns and best practices

  • GitOps tooling

We also go through an example GitOps workflow consisting of the following tasks:

  • Setting up a GitOps agent with Flux

  • Connecting Flux agent to a Git repository

  • Syncing resources to a Kubernetes cluster

  • Deploying an application to the cluster

What Is GitOps?

GitOps was popularized by the folks at Weaveworks, and the idea and fundamentals were based on their experience of running Kubernetes in production. GitOps takes the concepts of the software ...

Get Kubernetes Best Practices, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.