ArgoCD has quickly become one of the defacto tools for GitOps within Kubernetes. I recently learnt about a lesser advertised feature that provides an incredible capability to aid in bootstrapping new Kubernetes cluster from scratch.

When implemented, this allows you to deploy multiple helm-charts and manifest repositories from existing sources upon the spawning of the cluster in a big-bang style setup that can be phased with the power of sync-wave to create a set of pipelines ready to go.

This article is an explanation and demonstration of how you can use ArgoCD to bootstrap Kubernetes services out of the box either locally or on a remote cluster that’s been freshly provisioned.

The Concept

Often overlooked in the ArgoCD documentation are the example repositories. Within these, there is a demonstration of a particular paradigm of wrapping ArgoCD CRD’s (Custom Resource Definitions) of the type Application into a Helm Chart. This means that you can point ArgoCD at this chart and hey presto it will read it’s Application resources and dog-food those as new charts.

The Application CRD is the Kubernetes resource object representing a deployed application instance in an environment. It is defined by two key pieces of information: source reference to the desired state in Git (repository, revision, path, environment) destination reference to the target cluster and namespace.

This paradigm of leveraging declarative resources is a powerful way to associate back to charts and/or repository sources directory and give you an out of the box experience.

You can extend this capability even further by making the bootstrap Application itself part of the initial deployment when ArgoCD is installed.

Giving a real win for simplicity and Developer Experience.