Skip to content

The deploy never applies infra/k8s cluster objects, so a new cluster is born without them #927

Closed

Description

@athvin

Raised by the owner while reviewing #906 (PR #925): why is this a hand-run make target rather than part of the chart or the deploy? The chart half has a real answer. The deploy half does not.

The chart cannot hold them, and that part is settled

er-platform installs once per namespace — one release per developer plus one for ci. Cluster-scoped objects in a per-namespace chart would mean every install racing for the same object, and a helm uninstall of one developer namespace deleting the NodePools every other namespace runs on. batch-orchestration-design.md already states this for the three PriorityClasses: "Cluster-scoped objects ... cannot live in a per-namespace chart."

The deploy has no excuse

deploy.yml already does every prerequisite:

  • aws eks update-kubeconfig --name "$CLUSTER" (line ~164)
  • bash scripts/ci/install-helm.sh
  • bash scripts/obs_up.sh — a non-chart, cluster-level installer, run from CI with the comment "the same script a human runs"
  • and its push trigger paths already include infra/k8s/**

So a commit touching infra/k8s/nodepools/ fires a deploy that then ignores those files. Nothing applies them, and nothing reports that nothing applied them. The Makefile comment admits the surrounding gap in its own words: "infra.yml does not even trigger on these paths, so there is no drift gate either."

What it cost

Measured 2026-11-08 on er-prod, nine days after the cluster was created: no app, runner-sm or runner-l NodePool, no er-task-* PriorityClass, and no amazon-vpc-cni ConfigMap — so every NetworkPolicy object in that cluster enforced nothing, which is §8.5's silent failure and silent precisely because the policies exist and read as healthy. A prod deploy would additionally have sat Pending with no pool to land on.

Scope

Apply infra/k8s/nodepools/, infra/k8s/nodepools/<env>/, infra/k8s/priorityclasses/ and infra/k8s/network-policy-controller.yaml from the deploy, per environment — the same set make cluster-objects ER_ENV=<env> applies, so the script and the human command stay one thing rather than two that can disagree (the obs_up.sh precedent).

Open questions worth deciding rather than defaulting:

  • Which workflow. deploy.yml is triggered by images completing, and cluster objects do not depend on an image — so it would run them on a trigger that has nothing to do with them. A separate workflow on push: main with a paths: filter is cleaner and is allowed here precisely because it would not be a required check (the no-paths: rule applies only to required workflows).
  • Credentials for prod. The dev deploy role has a cluster-admin access entry (envs/dev/eks.tf). Prod needs the equivalent, which Prod deploy path #556 is adding anyway — hence doing this alongside it.
  • Whether applying is enough. kubectl apply converges but never deletes, so a NodePool removed from the tree lingers in the cluster. A drift report (--dry-run=server and diff) is the cheap version; pruning is the expensive, dangerous version. Pick one deliberately.

Acceptance

  • a commit touching only infra/k8s/nodepools/prod/app.yaml results in that pool being applied to er-prod without anyone running a command
  • the same code path is what make cluster-objects runs, so the two cannot drift
  • a cluster missing the CNI ConfigMap is reported, not silently converged past — this is the failure that motivated the ticket
  • the NetworkPolicy probe from Prod app NodePool, and a per-environment cluster-objects target #906 (no policy → SERVED, default-deny → DENIED) is re-run after the pipeline applies it, since enforcement is the thing being protected

Activity

  1. added
    mvp
    ci-backlog
    followup
    on Nov 8, 2026
  2. self-assigned this
    on Nov 8, 2026
  3. athvin commented on Nov 8, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #931 (draft). Closing that PR releases the claim. The three open questions are decided there: separate non-required workflow on push:main with a paths filter; the per-env deploy roles carry the credentials (prod's arrives with #930); apply + report, never prune.

  4. athvin commented on Nov 9, 2026

    @athvin
    OwnerAuthor

    Landed: #931 (squash 13358a06) + its first-run fix #940 (2ce11b33).

    Acceptance:

    • a commit touching only infra/k8s/... results in the objects applied without anyone running a command — the merge of ci(cluster): apply infra/k8s cluster objects from CI, one code path with make (#927) #931 itself fired cluster-objects.yml (its own file + the script are in its paths); green run on both legs after the alias fix: https://github.com/athvin/entity-resolution-engine/actions/runs/42539710868 — prod leg applied the NodePools/PriorityClasses/CNI ConfigMap, presence verified, zero drift reported.
    • the same code path is what make cluster-objects runs — both call scripts/cluster_objects.sh <env>; the Makefile target is a one-line wrapper.
    • a cluster missing the CNI ConfigMap is reported, not silently converged past — the script now applies it AND presence-verifies every applied surface (kubectl get -f fails the run if anything is missing), plus a post-apply convergence diff and report-only deletion drift. On top: the same gap class bit harder than the ticket knew — er-prod also had no ESO controller (hand-installed on dev in task 1.6, never captured; the first prod deploy failed its hooks on it). cluster_objects.sh now installs ESO pinned at 2.12.0 + the ClusterSecretStore on both clusters.
    • the Prod app NodePool, and a per-environment cluster-objects target #906 NetworkPolicy probe re-run after the pipeline applied the ConfigMap — re-run 2026-11-08: no policy → SERVED (200); cross-namespace into app's default-deny on er-api:8000 → DENIED (timeout); the allow-alb-to-web hole correctly admits er-web:3000 (200). Probe namespace deleted.

    The three open questions, as decided: separate non-required workflow (with the comment marking why it must never become required without dropping the paths filter); the per-env deploy roles carry the credentials; apply + report, never prune.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ci-backlogfollowupmvp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions