Bootstrapping EKS with Argo CD
Now that we have created the cluster, we need to evolve our Terraform scripts a bit more so that for every new cluster we create, we set it up to be ready with Argo CD and manage the configuration so that we can follow GitOps practices for Argo CD too. As we mentioned in Chapter 2, Getting Started with ArgoCD, Argo CD syncs and manages itself.
Preparing Argo CD Terraform
We will use the Terraform provider for kustomize
and install Argo CD in the cluster. First, we will create kustomization.yaml
, which will install Argo CD and, in parallel, create the K8s resources for Argo CD, such as the name and the related ConfigMap
. Here is kustomization.yaml
:
apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: argocd bases: - https://raw.githubusercontent.com/argoproj/argo-cd/v2.1.7/manifests/install.yaml resources: - namespace.yaml patchesStrategicMerge: - argocd-cm.yaml
With the preceding kustomization...