Manifest CI¶
Every pull request in Skatzi/platform runs the CI Manifests workflow
(.gitea/workflows/ci-manifests.yaml). Its job, render-and-validate, proves that the manifests
render and validate, and posts the rendered diff to the pull request. The Renovate ADR asks for it
as the pre-merge gate for platform upgrades
(§10).
The job name stays render-and-validate, so branch protection can require it as a status check.
What it checks¶
- Render.
scripts/render-manifests.pyrenders everycluster/<name>/path the way Flux applies it:kustomize buildof the cluster root, then of every FluxKustomizationit finds there and in what those render, with theirspec.patches;- Flux
postBuildvariable substitution:substitutevalues, and placeholder values for thecluster-configConfigMap, which Terraform creates. Resources annotatedkustomize.toolkit.fluxcd.io/substitute: disabledare left alone,$varis not substituted and$${var}gives${var}, as in Flux; - a Flux
Kustomization'sspec.targetNamespace, set on every namespaced resource it renders (overriding any namespace already there), while cluster-scoped kinds are left alone; helm templateof everyHelmRelease, at its chart version, with its values, CRDs included. The chart is downloaded first withhelm pull, tried 3 times (waiting 5 s, then 10 s), because chart hosts such ashelm.goharbor.iosometimes drop the connection. A host that stays down still fails the render with its error.
- Validate.
kubeconform -strictchecks everything the render produced. Custom resources are checked against the CRDs in the render itself, so they match the CRD versions the pull request deploys. Kinds that no rendered CRD defines fall back to the Kubernetes schemas and the datreeio CRDs catalog. The CRD objects themselves are not schema-checked: no upstream schema exists for them. - Gate Job inputs.
scripts/check-gate-inputs.pyreads the render. For every FluxKustomizationwhosehealthChecksname a Job (a pre-upgrade backup gate, a smoke check), each ConfigMap and Secret the Job mounts (volumes,envFrom,valueFrom) must be applied by that sameKustomizationor by one itdependsOn, transitively. An object applied by aKustomizationthat depends on the gate reaches the cluster only after the gate has run, so the gate runs with the old copy (incident 2026-10-24). A Job named inhealthChecksthat theKustomizationdoes not render is an error too. AnExternalSecretorClusterExternalSecretcounts as applying its Secret. A reference the Job marksoptional: trueand that cannot come first (a Secret synced from OpenBao for the OpenBao gate, a ConfigMap another Job writes) is listed with a one-line reason inEXCEPTIONSat the top of the script. A gate whose source is aGitRepositoryoutside this repository (the image gates of Taskbase and Emiliero,taskbase-<env>-preupgradeandemiliero-preupgrade) is not rendered, so it is listed as not checked: its Job and the inputs it mounts are in that repository. Its unit tests,scripts/test_check_gate_inputs.py, run in the same step. - OpenBao images.
scripts/check-openbao-images.pyreads the render. In a cluster that runs OpenBao, everyquay.io/openbao/openbaoimage in a pod template in theopenbaoandopenbao-drillnamespaces, and everyTARGET_IMAGEthere, must equal the server image of the renderedopenbao/openbaoStatefulSet, which is the chart'sappVersion(see Upgrading OpenBao). Its unit tests,scripts/test_check_openbao_images.py, run in the same step. - Diff. The base branch (the merge base) is rendered by the same script, and the diff per cluster path is posted as one pull-request comment, which every push updates. CRD changes get their own diff. Long diffs are cut in the comment; the full diff is in the job log.
The check fails when a render, validation, gate input or OpenBao image check fails. It does not fail on a diff.
What it does not cover¶
- Flux
Kustomizations whose source is another repository (Taskbase, Emiliero, Botyard). The render notes in the comment list them as skipped. HelmReleasevaluesFrom,postRenderersother than kustomizepatchesandimages, andsubstituteFromother thancluster-config: the script stops with an error when it meets one, so support can be added when it is first used. Kustomize post-renderers are applied in order to the rendered chart, as helm-controller does (OpenBao's, #3377), but here also to the chart'scrds/, which helm-controller leaves out.- Chart versions given as a range (such as
>=65.0.0) render the newest matching chart, so the diff can change when upstream releases one. - Secret values, and the
checksum/secret*annotations computed from them, are shown asREDACTED: some charts generate random secrets, which would otherwise change every render.
Placeholder values¶
The placeholder cluster-config values live in the CLUSTERS table at the top of
scripts/render-manifests.py, with whether the cluster's bootstrap Kustomization substitutes the
root path. A new cluster/<name>/ directory fails the render until it has an entry there. A
variable that is neither set nor a placeholder fails the render of that Kustomization, naming the
variable, the resource and the Kustomization path, unless it has a default (${var:=}) or is
escaped ($${var}). Flux 2.9 does the same (StrictPostBuildSubstitutions): it fails the
reconciliation instead of substituting an empty string.
Running it locally¶
You need Python 3 with PyYAML, kustomize, helm and kubeconform (the versions are pinned at
the top of the workflow). The agent-runner chart is private in Harbor. For a local render without
a prior Helm login, use a kubectl context with permission to read the harbor-pull-secret in
the management cluster's agent-runners namespace (see Kubernetes access):
The helper reads the existing cluster pull secret, passes its password to helm registry login
on standard input, renders with scripts/render-manifests.py, and removes its temporary Helm
registry config afterward. It never prints the secret or writes credentials into this repository.
If you already have a Harbor login in Helm, run scripts/render-manifests.py directly instead.
With either method, validate the render:
curl -sSfLO https://raw.githubusercontent.com/yannh/kubeconform/v0.6.7/scripts/openapi2jsonschema.py
mkdir -p /tmp/render/schemas
(cd /tmp/render/schemas && FILENAME_FORMAT='{fullgroup}-{kind}_{version}' \
python3 "$OLDPWD/openapi2jsonschema.py" /tmp/render/head/*/crds/*.yaml > /dev/null)
# Match CI: remove the invalid `additionalProperties` flag nested inside a CRD field named `properties`.
python3 - /tmp/render/schemas <<'PY'
import glob, json, sys
def fix(node, in_props=False):
if isinstance(node, dict):
if in_props and node.get("additionalProperties") is False:
del node["additionalProperties"]
for key, value in node.items():
fix(value, key == "properties")
elif isinstance(node, list):
for value in node:
fix(value)
for path in glob.glob(sys.argv[1] + "/*.json"):
with open(path) as f:
schema = json.load(f)
fix(schema)
with open(path, "w") as f:
json.dump(schema, f)
PY
kubeconform -strict -summary -skip CustomResourceDefinition \
-schema-location '/tmp/render/schemas/{{.Group}}-{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
-schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
/tmp/render/head
# Diff against main
git worktree add /tmp/render/base-tree "$(git merge-base HEAD origin/main)"
python3 scripts/render-manifests-local.py /tmp/render/base-tree /tmp/render/base
diff -ruN /tmp/render/base /tmp/render/head
# Gate Job inputs
python3 scripts/check-gate-inputs.py /tmp/render/head
# OpenBao images
python3 scripts/check-openbao-images.py /tmp/render/head
The output has one file per Flux Kustomization: <cluster>/<kustomization>.yaml with its
manifests and rendered charts, and <cluster>/crds/<kustomization>.yaml with its CRDs.