Skip to content

hupiper/cluster-config-old

Repository files navigation

I cloned this from Gerald Nunn's repository - I suggest you check it out. Great stuff! I try to keep up with the changes he and the RH Canada team make to their repos: https://github.com/hupiper/cluster-config and https://github.com/redhat-canada-gitops/catalog

From Gerald's Repo:

GitOps Cluster Configuration

This repo contains the cluster configuration I use for my personal OpenShift clusters. Like my other GitOps repos it leverages ArgoCD heavily. This repo originally followed the folder structure defined in the Standards repository but there has been some tweaks that need to be reflected back in that document.

Structure

Similar to standards document, the repo consists of three high level folders:

  • bootstrap - the minimal yaml needed to bootstrap the cluster-config into argocd. It deploys a known sealed-secret private key along with an "app of app" cluster-config-manager that deploys the entirety of the cluster configuration.
  • components - a base set of kustomize manifests and yaml for applications, operators, configuration and ArgoCD app/project definitions. Everything is inherited from here
  • clusters - Cluster specific configuration, this inherits and kustomizes from the components folder and uses an identical structure.

alt text

Usage

Cluster specific configuration is stored in the bootstrap/overlays folder. To deploy the cluster configuration, simply do a oc apply -k bootstrap/overlays/{clustername}. Under the hood this kustomize does the following:

  • Creates a sealedsecrets project and deploys a known private key into the namespace. This is done so I can re-use an existing key since my clusters are ephemeral and constantly being deployed. Creating new keys would mean re-encrypting all my secrets which is out of scope for demos.
  • Creates an ArgoCD AppProject called cluster-config
  • Deploys a single application, cluster-config-manager, using the app-of-app pattern to deploy everything else.

Sequence

This repo uses Argo CD sync waves to configure the configuration in an ordered manner. The following waves are used:

  1. Sealed Secrets
  2. Lets Encrypt for wildcard routes
  3. Storage (iscsi storageclass and PVs)
  4. Cluster Configuration (Authentication, AlertManager, etc)
  5. Operators (Pipelines, CSO, Compliance, Namespace Operator, etc)

ArgoCD App Generation

In my original version of this repo I was storing individual ArgoCD applications in the components (then manifests) directory and then patching these as needed to support cluster specific variations. This proved to be a lot of a yaml to maintain so with ApplicationSets being available in the gitops-operator I was excited about simplfying things.

Unfortunately ApplicationSets does not currently support sync waves which I am relying on here to deploy things like sealed-secrets and certificates before everything else. However at it's core ApplicationSets is simply a templating pattern and I opted to just replicate this on the client side. In each cluster overlay you will see a set of Argo CD applications, i.e. clusters/home/argocd/apps/base. These are generated using a bash script called generate-argocd-apps.sh with the goal to reduce the overhead of managing ArgoCD applications.

Once ApplicationSets support sync waves I plan on revisiting this.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published