Book Image

Argo CD in Practice

By : Liviu Costea, Spiros Economakis
Book Image

Argo CD in Practice

By: Liviu Costea, Spiros Economakis

Overview of this book

GitOps follows the practices of infrastructure as code (IaC), allowing developers to use their day-to-day tools and practices such as source control and pull requests to manage apps. With this book, you’ll understand how to apply GitOps bootstrap clusters in a repeatable manner, build CD pipelines for cloud-native apps running on Kubernetes, and minimize the failure of deployments. You’ll start by installing Argo CD in a cluster, setting up user access using single sign-on, performing declarative configuration changes, and enabling observability and disaster recovery. Once you have a production-ready setup of Argo CD, you’ll explore how CD pipelines can be built using the pull method, how that increases security, and how the reconciliation process occurs when multi-cluster scenarios are involved. Next, you’ll go through the common troubleshooting scenarios, from installation to day-to-day operations, and learn how performance can be improved. Later, you’ll explore the tools that can be used to parse the YAML you write for deploying apps. You can then check if it is valid for new versions of Kubernetes, verify if it has any security or compliance misconfigurations, and that it follows the best practices for cloud-native apps running on Kubernetes. By the end of this book, you’ll be able to build a real-world CD pipeline using Argo CD.
Table of Contents (15 chapters)
1
Part 1: The Fundamentals of GitOps and Argo CD
4
Part 2: Argo CD as a Site Reliability Engineer
7
Part 3: Argo CD in Production

Initial setup

Almost all of the tutorials, blogs, and articles out there discuss installing Argo CD in the argocd namespace, and it does make sense as it is a specific namespace—it will not collide with other applications. But there are cases when that might not be possible—I am talking about when multiple instances of Argo CD are installed in the same Kubernetes cluster. This is a valid scenario when we want to split clusters that an Argo CD instance is managing, such as one that takes care of prod clusters and another the non-prod ones. Another scenario could be when they take care of the same clusters but only specific namespaces from it, so a model of an Argo CD instance per team. We will follow the scenario with prod and non-prod installations.

When we have two or more Argo CD installations in the same cluster, there are a couple of things we need to pay attention to. First is the fact that when we install it in the cluster, there are some Custom Resource Definitions...