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]>
This commit is contained in:
jakman85andClaude Opus 4.8 committed 2026-08-17 01:06:23 -05:00
1 parent c04aea85aa
commit ca982864fc
9 files changed
+107 -14

No files matched your search

+3 -2
View File
@@ -12,9 +12,10 @@ spec:
timeout: 5m
prune: true
wait: true
# Ordering: platform (CNI, storage, TLS, DNS, gateway, identity) must be healthy first.
# Ordering: the full platform (controllers + their configs) must be healthy first.
# platform-config dependsOn platform, so depending on platform-config transitively waits for both.
dependsOn:
- name: platform
- name: platform-config
sourceRef:
kind: GitRepository
name: flux-system
+3 -2
View File
@@ -5,6 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- flux-system.yaml # GitRepository (reconciliation source)
- platform.yaml # Flux Kustomization -> ./platform
- apps.yaml # Flux Kustomization -> ./apps (dependsOn platform)
- platform.yaml # Flux Kustomization -> ./platform (CONTROLLERS: HelmReleases / CRDs)
- platform-config.yaml # Flux Kustomization -> ./platform-config (CONFIGS: CRs; dependsOn platform)
- apps.yaml # Flux Kustomization -> ./apps (dependsOn platform-config)
- cluster-vars.yaml # overlay knob surface (base defaults)
+29
View File
@@ -0,0 +1,29 @@
---
# Flux Kustomization: PLATFORM CONFIGS — the custom resources (cert-manager ClusterIssuers, the
# wildcard Certificate + Gateway, Kyverno ClusterPolicies, Cilium L2 IP-pool/announcement) that
# depend on CRDs registered by the `platform` CONTROLLERS. Split out per the flux2 controllers/
# configs pattern so the CRDs exist BEFORE these apply — otherwise the single platform apply fails
# atomically with "no matches for kind ClusterIssuer" and nothing installs (see DECISIONS-LOG).
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: platform-config
namespace: flux-system
spec:
interval: 10m
retryInterval: 2m
timeout: 5m
prune: true
wait: true
dependsOn:
- name: platform # controllers (which register the CRDs) must be healthy first
sourceRef:
kind: GitRepository
name: flux-system
path: ./platform-config
# No decryption: platform-config carries no SOPS-encrypted content (the encrypted Secrets live in
# ./platform and are applied by the `platform` Kustomization).
postBuild:
substituteFrom:
- kind: ConfigMap
name: cluster-vars # ACME_CLUSTER_ISSUER, KYVERNO_VALIDATION_ACTION, …