Bootstrapping ArgoCD With Terraform
Overview Kubernetes has lot of flexibility and features. But, in order to make use of it to the full potential, it requires us to install some essentials tools in it. One of the example of the most used tools in industry right now is ArgoCD. ArgoCD allows us to manage the applications inside the Kubernetes cluster. This post written to help you on how to bootstrapping the Kubernetes cluster. What is Bootstrapping? Bootstrapping is to make your system ready by ensuring it loads your essential components In Kubernetes, we have options to bootstrap the cluster with several examples: Having ingress controller, prometheus operator, and telemetry collector Having applications management / delivery tools installed like ArgoCD or FluxCD In this case we want to bootstrap ArgoCD to the cluster, so that for all the remaining components can be managed using Application or ApplicationSet in ArgoCD Why Bootstrapping? Bootstrapping will only contains the minimum essentials tools get installed This will make the cluster management less painful We can manage the essentials tools altogether with cluster provisioning definition We can separate the other essentials tools management into different layer (for ArgoCD, using Application or ApplicationSet) How to Bootstrapping Kubernetes Cluster? Terraform widely known tools to provisioning Kubernetes cluster It has Helm provider support Helm chart is versioned and more easier than dealing with plain manifests (especially if we have it already in artifacthub, haha) We can leverage Terraform and Helm to bootstrap the cluster So we can manage the cluster provisioning (using whatever your cloud platform is), and manage the essentials components (in this case ArgoCD) See below Terraform snippet to bootstrapping the ArgoCD with the cluster. The snippet assuming that the kubeconfig is there locally. So if you want to have it together with your cluster definition, you might need to adjust the kubernetes and helm provider in order to authenticate to the cluster. ...