Files
home-network-k3s-impl/platform/kyverno/kustomization.yaml
jakman85andClaude Opus 4.8 ca982864fc fix(platform): controllers/configs split so CRDs precede their CRs
Un-suspend deadlocked: the single platform Kustomization applies HelmReleases
(which register CRDs) AND custom resources of those CRDs (ClusterIssuer,
Certificate, Kyverno ClusterPolicies) in ONE pass. Flux's server-side apply
fails atomically ('no matches for kind ClusterIssuer') → nothing installs, so
the CRD-registering HelmReleases never run either. Classic ordering deadlock.

Fix (flux2 controllers/configs pattern, applies to dev+prod equally — no
R-ENV-02 divergence): add a platform-config Flux Kustomization (dependsOn
platform, wait) carrying the CRs; platform keeps only the controllers.
- New clusters/base/platform-config.yaml (path ./platform-config, substituteFrom
  cluster-vars, no decryption — no SOPS content); wired into base + apps now
  dependsOn platform-config (transitively waits for platform).
- platform-config/ references the CR files IN PLACE via ../platform/... (Flux
  builds LoadRestrictionsNone; Kyverno policies must stay under platform/kyverno/
  for the CI L0  gate). CR resources dropped from the platform
  component kustomizations (cert-manager, gateway, kyverno).
- Authored the missing Cilium L2 resources (were only a TODO): CiliumLoadBalancerIPPool
  (dev NAT 10.73.0.240-.250) + CiliumL2AnnouncementPolicy (ens*), so Gateway
  LoadBalancer listeners get a VIP. Prod range must be parameterized later.

Verified: platform build has zero CRs; platform-config build has 2 ClusterIssuers,
6 ClusterPolicies, Certificate, Gateway, both Cilium L2 CRs; dev/prod build; gate PASS.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-17 01:06:23 -05:00

22 lines
1.2 KiB
YAML

# platform/kyverno — in-cluster ENFORCING bundle (Kyverno install + policies shared verbatim with
# the CI L0 gate; ADR-0011, docs/07 admission enforcement).
#
# Resources are listed with DOWNWARD paths only (no `../`) so this builds under default kustomize
# load restrictions. The admission/kustomization.yaml authored by WS-TEST uses `../policies` refs and
# is kept as reference; THIS file is the buildable render root.
#
# NOTE: not yet wired into platform/kustomization.yaml — admission enforcement is Phase 2 (T-2.7),
# which needs a cluster. Scaffolding is present and buildable now.
#
# CI-only artifacts (tests/, servicedefinition/ payloads, scripts/run-l0.sh) are intentionally NOT
# rendered into the cluster — they run in CI (.gitea/ + ci/).
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kyverno
resources:
- admission/namespace.yaml
- admission/helmrelease.yaml
# NOTE: the ClusterPolicies (policies/*.yaml) + admission/secret-provenance.yaml are kyverno.io CRs
# → applied by the platform-config Kustomization (dependsOn platform) so the Kyverno CRDs exist
# first. Files STAY here so the CI L0 gate (`kyverno test platform/kyverno/`) still discovers them.