Repository navigation
Description
Part of #1318 · one of four CRD gaps blocking a Fountain production deployment.
Repo/where. INTENTIUS/chant, k8s lexicon at lexicons/k8s/. Design rule: spec-true — type the real upstream API.
Goal. Code-generate typed Traefik proxy CRDs through the existing CRD codegen pipeline.
Why
Traefik is one of the two or three ingress controllers people actually run, and its IngressRoute is not a networking.k8s.io Ingress — it is a distinct CRD with its own matcher grammar. chant can express an Ingress today and cannot express a Traefik route at all, so any estate fronted by Traefik has an unmodellable edge.
BinaryBourbon/fountain's k8s/ingressroute.yaml is the concrete case: two IngressRoute objects, one on the websecure entrypoint with tls.secretName, one on web that references a cross-namespace redirect-https middleware:
routes:
- match: "Host(`fountain.inevitable.fyi`)"
kind: Rule
middlewares:
- name: redirect-https
namespace: default
services:
- name: fountain
port: 80The cross-namespace middleware ref is the part worth typing — it is easy to get wrong by hand and invisible until traffic hits it.
Scope — traefik.io only
The Traefik helm chart's crds/ directory also ships hub.traefik.io_* (Traefik Hub, the commercial control plane) and a vendored copy of the Gateway API. Take neither:
hub.traefik.io_*is a different product, ~12 kinds, no known consumer.- Gateway API is already generated from the upstream repo (
GATEWAY_API_CRD_BASE); a second copy would collide.
Take the nine traefik.io_* kinds: IngressRoute, IngressRouteTCP, IngressRouteUDP, Middleware, MiddlewareTCP, ServersTransport, ServersTransportTCP, TLSOption, TLSStore, TraefikService. That is the whole proxy surface and it is bounded — this is the "add the specific kinds a project uses, or scope by resource group; never point at an operator's entire CRD bundle" rule from crd-sources.ts applied literally.
Files to touch
lexicons/k8s/src/crd/crd-sources.ts— add aTRAEFIK_CHART_VERSIONconst, aTRAEFIK_CRD_BASE, a doc comment listing the kinds and the install command, and oneCRD_SOURCESentry pertraefik.io_*file.lexicons/k8s/src/crd/parser.ts— no override needed. The first-segment rule mapstraefik.io→Traefik, which is already what we want (K8s::Traefik::IngressRoute). Confirm rather than assume.
Verified source
https://raw.githubusercontent.com/traefik/traefik-helm-chart/v34.1.0/traefik/crds/traefik.io_ingressroutes.yaml returns 200; the sibling traefik.io_*.yaml files are in the same directory.
Chart v34.1.0 is verified above; latest is v41.1.0. Pin deliberately and record which Traefik minor it corresponds to — the chart version and the proxy version are not the same number, which is a footgun worth a comment.
Steps
- Add the version const + base URL with the doc comment.
- Add the nine entries to
CRD_SOURCES. - From
lexicons/k8s/:npm run generate, thennpm run build -w @intentius/chant-lexicon-k8s.
Definition of done
K8s::Traefik::IngressRouteand::Middlewareimport from the generated barrel and serialize to valid YAML.- Fountain's
k8s/ingressroute.yaml— both routes, thetls.secretName, and the cross-namespace middleware ref — is reproducible from typed chant source. - Chart version recorded in
crd-sources.tswith the install command. npm run generate && npm run build -w @intentius/chant-lexicon-k8sclean; codegen tests pass.
Notes
- fix(k8s): CRD-generated classes have no metadata when the schema declares only spec #1309 does not block this.
IngressRouteandMiddlewaredeclaremetadataat the top level of their schemas (verified). - The
matchfield is a Traefik matcher expression in a string. Typing it as a string is spec-true and correct; a parser for the matcher grammar would be a separate, much larger conversation. src/generated/**is generator output — never hand-edit.
Activity
lex00 commentedon Aug 3, 2026
Pin decided: traefik-helm-chart
v37.1.2(verified 200). Traefik v3 CRDs.Scope stays the nine
traefik.io_*kinds. Nothub.traefik.io_*(different product, commercial) and not the chart's vendored Gateway API copy — that group is already generated from upstream and a second copy would collide.feat(k8s): Traefik proxy CRDs (#1320)
feat(k8s): Traefik proxy CRDs (#1320) (#1380)
feat(k8s): k3s bundled-controller CRDs (K8s::K3s::HelmChart/HelmChart…