At its very simplest, Argo CD is an open-source GitOps continuous delivery tool. It monitors your cluster and your declaratively-defined infrastructure stored in a Git repository and resolves differences between the two — effectively automating an application deployment.
You may have also heard of it as a Kubernetes controller. Kubernetes helped change how infrastructure is managed, but it also added complexity for developers and system administrators by introducing new concepts like kubernetes manifests, kubernetes resources, and other various Kuberentes specific concepts. As the GitOps movement starts to walk back some of that complexity and abstract it under a layer of automation, Argo CD (“CD” of course being shorthand for “continuous delivery”) is one of the primary tools that makes this automation possible.
Without Argo CD, GitOps remains “ClickOps.” Your CI/CD tool may be able to roll out infrastructure changes, but it can’t monitor diffs, and thus infrastructure remains mostly manual.
In this article, we explain what Argo CD does, how it works, and an example of how to get started with it.
What Does Argo CD Do?
Argo CD is a declarative, GitOps continuous delivery tool built by the team at the financial software giant Intuit. After moving to the public cloud, having to manage containerization tools and infrastructure interfered with Intuit’s goal to realize the maximum benefits of the cloud. The Intuit team developed Argo CD to achieve maximum release speed and velocity gains. They wanted to apply a pane of automation that would eliminate some of that manual work, so they created the controller — Argo CD — and they open-sourced it.
Argo CD is now maintained by the community as a part of the Argo Project, and embedded in lots of GitOps tools that you’re probably familiar with as a delivery tool for Kubernetes native continuous deployment. (Harness’ own GitOps solution is built on top of it.)
Why Argo CD?
As a GitOps continuous delivery tool, Argo CD continuously monitors your running infrastructure (the actual state) to compare it to declaratively-defined code (the desired state or target state) to determine whether they are out of sync, which helps to remediate configuration drift.
Argo CD automatically deploys new configurations and new version code to the target environment. Depending on how you’ve configured Argo CD to work, it’ll either notify you that things are out of sync after a new git commit, or take action. If you’ve set it up to automatically enforce changes, it’ll overwrite the production configuration with what’s stored in your immutable, versioned Git repository. The tool is great for complex application rollouts.
Furthermore, Argo CD is essential when your developer team is working in version-controlled environments. By automating lifecycle management and application deployment, Argo CD proactively monitors your application configuration for any potential syncing issues before it reaches your production environment.
Argo CD Core Concepts
To set up and begin using Argo CD and Kubernetes, you’ll need a working familiarity with:
- Containers, virtual machines, and probably, the containerization tool Docker
- A container orchestration system like Kubernetes (though there are alternatives)
- Continuous deployment and integration tools like Harness
- (Possibly) Managing Kubernetes clusters and manifests in YAML, Helm Charts, or Kustomize
If you’re familiar with the items above, you know that to reduce the amount of manual effort needed to provision infrastructure, it’s helpful to deploy in containers, orchestrate those deployments, and abstract those deployments into code. That’s the core premise of GitOps being declarative and version controlled — moving everything into a Git repo where you can bring the full force of source control and automation to bear.
Argo CD offers the actual monitoring and syncing between the Git-defined infrastructure and your container orchestration tools. It has five primary components:
1. The Argo CD user interface (UI)
Within the web UI, you can create applications, though advanced folks interested in automation will want more control and will do this declaratively in Git. You can also manage connected Git repositories, certificates for access to those repositories, your clusters, and projects directly in the web UI. (Projects let you structure your applications to create useful silos around each team’s work.)
One of the more useful components of the Argo CD interface is you can view a visual pipeline of your infrastructure deployments, and your various applications’ services and clusters. If an application is in a crash loop, this lets you see all the events, as well as the manifest and configuration values, so you can visualize deployment issues and debug. (It will also hide your secrets.)
2. Both API and command line interface (CLI)
Users need not touch the Argocd login page because you can either manage Argo CD through APIs or create YAML resource definitions (or use Kustomize or Helm Charts to help manage Kubernetes resources). Once set up, developers don’t need to understand all the intricacies of the infrastructure they’re deploying. They just need the application definitions to include in their pull requests or merge requests.
3. Custom resource definitions (CRD)
Argo CD creates its own namespace within your Kubernetes (or similar) cluster (kubectl create namespace argocd). There, it stores the Argo CD CRDs.
4. Repository service
Argo CD caches your Git repo locally and stores application manifest files.
5. Application controller
Once you download the Argo CD application controller onto your repository server, it can invoke hooks defined by software development lifecycle events. (E.g. PreSync, Sync, PostSync.)
To download Argo CD, visit the project’s “Getting started” page.