This repo has my gitOps configuration for the PoshCode Kubernetes cluster.
The actual cluster is an AKS cluster deployed with my Azure Bicep templates, which are kept in a separate repository to avoid extra reconciliation.
This is our GitOps repository, and it's all Kustomize yaml, and reconciled by Flux CD.
Three folders are important:
- The actual cluster applications are in
apps
- The
system
folder containscrds
andservices
(stuff like cert-manager, prometheus, etc) - The
clusters
folder has a subfolder for each cluster ...
We follow the bases and overlays pattern for Kustomize, so both "apps" and "services" have a bases
folder with the common configuration, and then a folder for each cluster with the specific configuration. To simplify setup, the clusters
folder has a subfolder for each cluster, and each of those has flux kustomization to deploy the crds, services, and apps (for that specific cluster) as nested kustomizations.
In other words, each cluster only needs a single Flux Kustomization that points at a subfolder of clusters
, and the rest of the configuration for the cluster is in this repository.
In general, each application or service has a helm chart, so the base configuration is a folder in apps/bases
that just contains the helm repository
and release
, and perhaps the http-route or shared secrets.
For each kubernetes cluster, there's then an overlay folder like apps/production
that specifies the version of the chart and the value overrides to use.
A lot of what you'll see here is based on these two Flux examples, which are both simpler and more documented than this repository.