Example repository: a Flux tenant repository with overlays and .generated
Find a file
Sander van Thillo d0920b7936
All checks were successful
CI / manifests (push) Successful in 26s
feat: example repository for flux with CI
2026-11-13 21:29:52 +01:00
.forgejo feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
.generated/apps/podinfo/overlays/digikluster feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
apps/podinfo feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
bin feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
.editorconfig feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
.gitignore feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
.mise.toml feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
.pre-commit-config.yaml feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
README.md feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00
renovate.json feat: example repository for flux with CI 2026-11-13 21:29:52 +01:00

$REPO_OWNER/$REPO_NAME

A Flux tenant repository. Flux applies each overlay in apps/ to the cluster. The core repository holds the Flux Kustomization that points to an overlay of this repository.

Layout

apps/<app>/base/                    The app: a HelmRepository and a HelmRelease
apps/<app>/overlays/<cluster>/      The app on one cluster: namespace, name prefix, patches
.generated/apps/<app>/overlays/...  The output of kustomize build for each overlay, one file for each object
bin/generate-manifests.sh           Writes .generated

.generated is in git. A reviewer sees in the diff of .generated what changes in the cluster. Do not change .generated by hand.

Start

You need mise. It installs kustomize, kubectl-slice and pre-commit from .mise.toml.

mise install
pre-commit install          # runs bin/generate-manifests.sh before each commit

Change an overlay or a base, then commit. The pre-commit hook updates .generated. Without pre-commit, run bin/generate-manifests.sh and commit .generated with the change.

Add an app

  1. Copy apps/podinfo to apps/<app>.
  2. Change the chart in base/ and the values in overlays/digikluster/patches/.
  3. Set namespace and namePrefix in overlays/digikluster/kustomization.yaml.
  4. Run bin/generate-manifests.sh.
  5. Ask the platform team to add the Flux Kustomization for the overlay in the core repository.

Pipeline

.forgejo/workflows/ci.yml builds each overlay, and fails when .generated does not match. It runs on the label default, without root.

Renovate updates the chart versions in apps/, and then runs bin/generate-manifests.sh so that .generated stays correct.

Files

File Purpose
.mise.toml The versions of kustomize, kubectl-slice and pre-commit
.pre-commit-config.yaml Runs bin/generate-manifests.sh before each commit
renovate.json The shared Renovate presets; chart updates also update .generated
.forgejo/template The files in which Forgejo fills in the name of a new repository