infra/stacks/kyverno/modules/kyverno
Viktor Barzin 50d0f1affa kyverno: strip orphaned keel.sh/match-tag fleet-wide (image-swap fix)
The 2026-05-26 migration flipped the keel default force->patch and dropped
match-tag from the inject-keel-annotations patch, but Kyverno's add-only
mutate can't remove an annotation that's no longer listed -- 194 workloads
kept a stale keel.sh/match-tag=true. Under it Keel cross-assigned images in
multi-image pods: the blog's nginx<->nginx-exporter images were swapped and
the site was down 2026-05-26 -> 06-01 (nginx received the exporter's
-nginx.scrape-uri arg and CrashLoopBackOff'd); changedetection was silently
swapped (app lost its /datastore PVC + env, ran ephemeral for days).

- policy now sets keel.sh/match-tag=null (strips on admission, never re-added)
- swept the annotation off all 194 existing workloads (kubectl, no pod restart)
- AGENTS.md: documents the strip; post-mortem added

blog + changedetection un-swapped via kubectl set image (TF-ignored images);
both 2/2 and serving 200. Policy already applied via scripts/tg (Tier-1 PG
state authoritative). [ci skip]

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 19:50:41 +00:00
..
dependency-init-containers.tf kyverno(wave1): swap kubernetes_manifest → kubectl_manifest + flip 3 security policies to Enforce 2026-05-18 20:10:27 +00:00
keel-annotations.tf kyverno: strip orphaned keel.sh/match-tag fleet-wide (image-swap fix) 2026-06-01 19:50:41 +00:00
main.tf kyverno(wave1): swap kubernetes_manifest → kubectl_manifest + flip 3 security policies to Enforce 2026-05-18 20:10:27 +00:00
registry-credentials.tf kyverno(wave1): swap kubernetes_manifest → kubectl_manifest + flip 3 security policies to Enforce 2026-05-18 20:10:27 +00:00
resource-governance.tf kyverno: GPU priority mutate uses add (was replace) — fixes silent skip 2026-05-26 09:04:51 +00:00
security-policies.tf keel: re-enable with policy=patch (semver-bounded) + fix CI deny-privileged 2026-05-26 19:06:51 +00:00
tls-secret-sync.tf kyverno(wave1): swap kubernetes_manifest → kubectl_manifest + flip 3 security policies to Enforce 2026-05-18 20:10:27 +00:00
versions.tf kyverno(wave1): swap kubernetes_manifest → kubectl_manifest + flip 3 security policies to Enforce 2026-05-18 20:10:27 +00:00