Skip to content

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

Closed

Description

@lex00

Summary

The k8s lexicon curates first-party CRD sources (Gateway API, cert-manager, Argo CD, KubeRay, Prometheus Operator, CockroachDB operator) but has zero Flux coverage. Grep across the whole repo confirms no *.toolkit.fluxcd.io or fluxcd.controlplane.io groups anywhere. Flux is the most on-brand gap — the Flux Operator team's own schema catalog (schemas.fluxoperator.dev, 113 projects) exists precisely to index these CRDs.

Add the Flux GitOps Toolkit + Flux Operator CRDs to CRD_SOURCES so they become first-class typed K8s::* classes with serializer, LSP, and MCP support — the same as Deployment.

Scope: kinds to generate

Pin to a flux2 release (catalog currently indexes fluxcd/flux2 v2.9.1) and the flux-operator release (v0.54.1). CRD apiVersion/kind from the catalog's backing index.json:

Controller Kind Group Served version
source-controller GitRepository source.toolkit.fluxcd.io v1
source-controller OCIRepository source.toolkit.fluxcd.io v1
source-controller HelmRepository source.toolkit.fluxcd.io v1
source-controller HelmChart source.toolkit.fluxcd.io v1
source-controller 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 notification.toolkit.fluxcd.io v1beta3
notification-controller Alert notification.toolkit.fluxcd.io v1beta3
notification-controller Receiver notification.toolkit.fluxcd.io v1
image-reflector-controller ImagePolicy image.toolkit.fluxcd.io v1
image-reflector-controller ImageRepository image.toolkit.fluxcd.io v1
image-automation-controller ImageUpdateAutomation image.toolkit.fluxcd.io v1

Flux Operator (all fluxcd.controlplane.io/v1):

Kind Group Version
FluxInstance fluxcd.controlplane.io v1
FluxReport fluxcd.controlplane.io v1
ResourceSet fluxcd.controlplane.io v1
ResourceSetInputProvider fluxcd.controlplane.io v1

Out of scope (note for later): Flagger (flagger.app: Canary, MetricTemplate, AlertProvider), source.extensions.fluxcd.io/ArtifactGenerator, ExternalArtifact. Track separately if wanted.

Namespace mapping decision

The default first-segment rule in crd/parser.ts would scatter these across five namespaces (Source, Kustomize, Helm, Notification, Image) plus Fluxcd for the operator — and helm.toolkit.fluxcd.io → Helm reads confusingly next to the separate helm lexicon.

Add GROUP_NAMESPACE_OVERRIDES entries so all Flux groups collapse under a single Flux namespace:

source.toolkit.fluxcd.io        -> Flux    // K8s::Flux::GitRepository
kustomize.toolkit.fluxcd.io     -> Flux    // K8s::Flux::Kustomization
helm.toolkit.fluxcd.io          -> Flux    // K8s::Flux::HelmRelease
notification.toolkit.fluxcd.io  -> Flux    // K8s::Flux::Alert
image.toolkit.fluxcd.io         -> Flux    // K8s::Flux::ImagePolicy
fluxcd.controlplane.io          -> Flux    // K8s::Flux::FluxInstance

This mirrors the existing argoproj.io -> Argo override precedent.

Acceptance criteria

  • CRD_SOURCES in lexicons/k8s/src/crd/crd-sources.ts gains pinned entries for the Flux toolkit CRDs and the Flux Operator CRDs, each with a doc comment block matching the existing entries (produced classes + operator/controller install command).
  • Versions pinned in the URL (vX.Y.Z), never main — codegen stays deterministic.
  • GROUP_NAMESPACE_OVERRIDES maps every Flux group to Flux.
  • cd lexicons/k8s && npm run generate produces K8s::Flux::* classes for all 17 kinds above; HelmRelease serializes to apiVersion: helm.toolkit.fluxcd.io/v2, notification Provider/Alert to v1beta3, the rest to v1.
  • npm run build -w @intentius/chant-lexicon-k8s passes (CI "Generate lexicon artifacts" gate).
  • A serializer round-trip test asserts at least GitRepository, Kustomization, HelmRelease, and FluxInstance emit correct apiVersion/kind.
  • crd-classes.mdx gains a Flux section (kinds table + install commands), matching the Gateway API / cert-manager sections.

Non-goal

Do not vendor the whole schemas.fluxoperator.dev catalog (113 projects / 6,657 kinds). Chant generates typed classes + composites per kind, which does not scale to thousands of rarely-used CRDs the way Flux's read-only JSON Schemas do. The long-tail path is on-demand per-project generation via user-appended CRD_SOURCES — see #823 for the CRD-import direction.

Activity

  1. added a commit that references this issue on Jul 21, 2026
    b9f8373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions