Argo CD
Terraform module for Kubernetes

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.

This Terraform module provisions Argo CD on Kubernetes. It fully integrates the Kubernetes resources into the Terraform workflow and allows configuring Argo CD using native Terraform syntax.

The Argo CD module is continuously updated and tested when new upstream versions are released.

TL;DR:

  • Call the module once per desired target cluster.
  • The provider alias you pass into the module determines the cluster.
  • Customize the Kubernetes resources per environment using Terraform syntax.

Use the module

To provision the Argo CD Terraform module on a Kubernetes cluster, call the module, set source and version, and pass an aliased kustomization provider into the module. The provider configuration determines what cluster the Kuberneters resources are provisioned on. Framework documentation includes a complete example of how the kubeconfig output of a cluster module can be used to configure a kustomization provider alias.

module "eks_zero_argo_cd" {
providers = {
kustomization = kustomization.eks_zero
}
source = "kbst.xyz/catalog/argo-cd/kustomization"
version = "2.0.3-kbst.0"
}
module "aks_zero_argo_cd" {
providers = {
kustomization = kustomization.aks_zero
}
source = "kbst.xyz/catalog/argo-cd/kustomization"
version = "2.0.3-kbst.0"
}
module "gke_zero_argo_cd" {
providers = {
kustomization = kustomization.gke_zero
}
source = "kbst.xyz/catalog/argo-cd/kustomization"
version = "2.0.3-kbst.0"
}

Customize resources

All Kubestack cluster service modules support the same module attributes and per environment configuration. The module configuration is a Kustomization set in the per environment configuration map following Kubestack's inheritance model.

This example overwrites the metadata.namespace of all Kubernetes resources provisioned by the Argo CD module using a Terraform variable.

module "example_argo_cd" {
providers = {
kustomization = kustomization.example
}
source = "kbst.xyz/catalog/argo-cd/kustomization"
version = "2.0.3-kbst.0"
configuration = {
apps = {
namespace = var.example_argo_cd_namespace
}
ops = {}
loc = {}
}
}

Full documentation how to customize a module's Kubernetes resources is available in the cluster service module configuration section of the framework documentation.

Argo CD Variants

Argo CD upstream provides manifests for normal and HA configurations. And each is available as either cluster wide or namespaced.

These are available as four variants in the Kubestack module.

  1. ha (default)
  2. ha-namespaced
  3. normal
  4. normal-namespaced

By default, the ArgoCD module provisions the HA variant which provisions 3 replicas of all Argo CD components. You can configure the desired variant per environment. Below example uses the HA variant for the apps and ops environments. But the normal variant for the local development environment to use less memory and CPU.

configuration = {
apps = {}
ops = {}
loc = {
variant = "normal"
}
}

Getting started

After installing Argo CD from the catalog follow the getting started with Argo CD guide continuing with step 2.

For configuring access to the Argo CD API, consider the Ingress option using the Nginx ingress controller and Cert-manager from the catalog.