Skip to content

feat(k8s): add Flux toolkit + Flux Operator CRDs (K8s::Flux::*) - #992

Merged
lex00 merged 1 commit into
mainfrom
feat/k8s-flux-crds
Jul 21, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/k8s-flux-crds

Conversation

@lex00

@lex00 lex00 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Closes #858.

What

Adds the Flux GitOps Toolkit (flux2 v2.9.1) and the Flux Operator (v0.54.1) to the k8s lexicon's CRD_SOURCES, generating 17 typed K8s::Flux::* classes with serializer, LSP, and MCP support — same machinery as Deployment and the existing Argo CD CRDs.

Controller Kinds GVK
source-controller GitRepository, OCIRepository, HelmRepository, HelmChart, Bucket source.toolkit.fluxcd.io/v1
kustomize-controller Kustomization kustomize.toolkit.fluxcd.io/v1
helm-controller HelmRelease helm.toolkit.fluxcd.io/**v2**
notification-controller Provider, Alert notification.toolkit.fluxcd.io/**v1beta3**
notification-controller Receiver notification.toolkit.fluxcd.io/v1
image-*-controller ImagePolicy, ImageRepository, ImageUpdateAutomation image.toolkit.fluxcd.io/v1
flux-operator FluxInstance, FluxReport, ResourceSet, ResourceSetInputProvider fluxcd.controlplane.io/v1

All six groups collapse to a single Flux namespace via GROUP_NAMESPACE_OVERRIDES (mirroring the argoproj.io → Argo precedent).

How

  • GROUP_NAMESPACE_OVERRIDES — six new entries → Flux.
  • CRD_SOURCES — two entries pointing at the pinned release install.yaml bundles (deterministic, and trivial to bump from the self-upgrade cron: two version constants).
  • New kinds?: string[] allowlist on CRDSource — a release install.yaml is a multi-doc bundle of controllers + RBAC + CRDs; the parser already keeps only CRD docs, and the allowlist narrows those to the intended kinds. The flux2 bundle also carries the experimental ExternalArtifact and ArtifactGenerator (a 7th group), both intentionally excluded — matching the issue's out-of-scope note. The primitive also serves the Crossplane support via k8s CRD import + semantic lint (not a new lexicon) #823 user-appended-bundle direction.

Verification

The storage-version gotcha (parser.ts emits each CRD's storage: true version) was confirmed against the real upstream YAML — for all 17 kinds the storage version equals the served version the issue specified, so no per-source version pinning was needed. Codegen produces exactly the 17 kinds with correct per-group GVK (HelmRelease→v2, Provider/Alert→v1beta3, Receiver→v1, rest→v1, operator→v1).

  • ✅ npm run generate → 17 K8s::Flux::* classes, correct apiVersion/kind, no out-of-scope kinds
  • ✅ npm run build -w @intentius/chant-lexicon-k8s (CI "Generate lexicon artifacts" gate)
  • ✅ vitest run lexicons/k8s — 820 passed, 1 skipped
    • serializer round-trip test asserts GitRepository / Kustomization / HelmRelease(v2) / FluxInstance GVKs
    • parser test asserts all six groups → Flux
    • loader test covers the kinds allowlist (keep-subset and no-filter paths)
  • ✅ crd-classes.mdx gains a Flux section (kinds table, install commands, example) + the source-as-truth vs chant-lifecycle note

Out of scope (per issue)

ExternalArtifact, ArtifactGenerator, and Flagger (flagger.app) — trackable separately if wanted.

Pin flux2 v2.9.1 and flux-operator v0.54.1 release bundles as CRD
sources, generating 17 typed K8s::Flux::* classes across the five
*.toolkit.fluxcd.io groups plus fluxcd.controlplane.io. All six groups
collapse to a single Flux namespace via GROUP_NAMESPACE_OVERRIDES.

Add an optional 'kinds' allowlist to CRDSource so a multi-doc install
bundle generates only the intended kinds — the flux2 install.yaml also
carries experimental ExternalArtifact/ArtifactGenerator, left out.

Serializer round-trip test covers GitRepository, Kustomization,
HelmRelease (v2), and FluxInstance GVKs; crd-classes docs gain a Flux
section.

Closes #858
@lex00
lex00 merged commit b9f8373 into main Jul 21, 2026
6 checks passed
@lex00
lex00 deleted the feat/k8s-flux-crds branch July 21, 2026 15:46
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.

feat(k8s): add Flux toolkit + Flux Operator CRD sources (K8s::Flux::*)

1 participant