Architecture overview¶
The cluster is a GitOps monorepo: everything that runs is declared in Git, and Flux reconciles it
onto Talos Linux nodes. There is no manual kubectl apply in normal operation.
GitOps flow¶
The top-level Kustomization (kubernetes/flux/cluster/ks.yaml) recursively discovers every app under
kubernetes/apps/ and applies default patches to each child, notably postBuild.substituteFrom
injecting both the cluster-secrets Secret and the cluster-settings ConfigMap
(kubernetes/components/global-vars/cluster-settings.yaml), and the HelmRelease
install/upgrade/rollback defaults.
Repository layout¶
kubernetes/
apps/<namespace>/<app>/ # ks.yaml (Flux entry point) + app/ (HelmRelease, sources, routes)
components/ # reusable Kustomize components (global-vars, alerts, volsync, homepage, …)
flux/cluster/ # core Flux bootstrap (root Kustomization with global patches)
bootstrap/ # cluster bootstrap (just tasks + helmfile)
talos/ # Talos machine config (talconfig.yaml + patches)
App anatomy¶
Every app follows the same shape:
ks.yamlis the Flux entry point. It uses YAML anchors (&app,&namespace,*app), setstargetNamespace, and lists anycomponents(volsync,alerts,homepage) plus theirpostBuild.substitutevalues. (Gatus monitoring is automatic: the gatus-sidecar chart auto-discovers HTTPRoutes, so there is no per-appgatus/guardedcomponent anymore.)- Inside
app/: a per-app chart source (ocirepository.yamlpointing at the bjw-sapp-templatefor most apps), ahelmrelease.yaml, an optionalexternalsecret.yaml, and usually an inlineroute:in the HelmRelease values rather than a standalonehttproute.yaml.
Key conventions¶
- Namespace
kustomization.yamlfiles list apps (generally in alphabetical order) and reference the namespace's components. - ConfigMaps set
metadata.namespaceexplicitly (Checkov CKV_K8S_21 scans raw YAML before Flux appliestargetNamespace). - Flux
postBuildreplaces${VAR}againstcluster-secrets/cluster-settings; undefined vars become empty strings, so any literal${VAR}you want preserved must be escaped as$${VAR}. - GPU workloads set
runtimeClassName: nvidia. - This repository is public: internal addresses, node and device hostnames, and MACs are kept out of Git (a CI guard enforces this; see Secrets).