Skip to content

Per-cluster Applications from the clusters appset (T6)#40

Merged
stxkxs merged 1 commit into
mainfrom
feat-per-cluster-appset
Jun 13, 2026
Merged

Per-cluster Applications from the clusters appset (T6)#40
stxkxs merged 1 commit into
mainfrom
feat-per-cluster-appset

Conversation

@stxkxs

@stxkxs stxkxs commented Jun 13, 2026

Copy link
Copy Markdown
Member

Master plan target #6 / eks-gitops#39 — the prerequisite for portal T7 (honest per-cluster ArgoCD status).

Switches the clusters ApplicationSet from a git directory generator to a git files generator over clusters/*/*.yaml, so the hub's ArgoCD produces one Application per cluster instead of one per environment directory.

Why. The directory generator named one Application per env dir (clusters-<env>), reconciling every cluster in that env as a unit — so clusters-production: Synced only means the whole env reconciled, a sibling's malformed CR taints every good vend, and a stale Synced reads green before a specific CR is picked up. Portal can't honestly answer "did ArgoCD apply my cluster's CR" against that. The appset's own header had flagged this direction.

What. Each Application sources exactly one CR file (directory.include scopes the source), so its sync/health reflects exactly one cluster. Portal's T7 lookup Gets the Application by a deterministic name:

cluster-<environment>-<name>     e.g. cluster-production-spazeks

<environment> = file's parent dir (.path.basename), <name> = the CR's metadata.name (== file stem). The singular cluster- prefix never collides with the old clusters-<env> rollup space.

Safety. The template sets no resources-finalizer, so the ApplicationSet controller removing a generated Application (including on this generator change) deletes only the Application object, not the Cluster CR — switching generators can't trigger a teardown; only removing a cluster file does. There are no live cluster CRs today (clusters/.gitkeep only), so nothing to orphan. repoURL / project / hub destination / prune+selfHeal+SSA unchanged.

The clusters-repo placeholder doc is updated to the per-cluster contract in a companion change. Static-validated (task validate: yamllint + all overlays build); live validation is the rung-1-via-portal runbook's job on the hub.

Closes #39.

Switch the clusters ApplicationSet from a git directory generator to a git
FILES generator over clusters/*/*.yaml, so the hub's ArgoCD produces one
Application PER CLUSTER instead of one per environment directory.

─── Why ───

The directory generator named one Application per env dir
(clusters-<env>, reconciling every cluster in that env as a unit). That makes a
per-cluster verdict impossible: clusters-production: Synced only means the whole
environment reconciled, a sibling's malformed CR taints every good vend in the
env, and a stale Synced reads green before a specific CR is even picked up. The
appset's own header had flagged the files-generator direction as the fix.

─── What ───

Each generated Application sources exactly one CR file — directory.include scopes
the source to that file — so its sync/health reflects exactly one cluster. The
portal's per-cluster ArgoCD lookup Gets the Application by a deterministic name:

  cluster-<environment>-<name>     e.g. cluster-production-spazeks

where <environment> is the file's parent directory (.path.basename) and <name>
is the CR's metadata.name (== the file stem). The singular "cluster-" prefix is
distinct from the old env-rollup name space, so the two never collide during a
rollout.

The template sets no resources-finalizer, so when the ApplicationSet controller
removes a generated Application (including on this generator change) it deletes
only the Application object, not the Cluster CR it managed — switching generators
can't itself trigger a teardown; only removing a cluster file does. repoURL,
project, in-cluster (hub) destination, and prune/selfHeal/SSA syncPolicy are
unchanged.

Static-validated (yamllint + all kustomize overlays build); the rung-1-via-portal
runbook applies this on the hub for live validation.
@github-actions

Copy link
Copy Markdown

CI Results

Check Status
YAML Lint
Environment Kustomize Build
dev
staging
production

All validations passed.

@stxkxs stxkxs merged commit dc431ca into main Jun 13, 2026
5 checks passed
@stxkxs stxkxs deleted the feat-per-cluster-appset branch June 13, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-cluster ArgoCD appset (files generator) — prereq for portal per-cluster vend status

1 participant