Skip to content

feat(k8s): Traefik proxy CRDs (#1320) - #1380

Merged
lex00 merged 1 commit into
mainfrom
feat/1320-traefik-crds
Aug 3, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/1320-traefik-crds

Conversation

@lex00

@lex00 lex00 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Closes #1320. Part of #1318.

Adds the ten traefik.io/v1alpha1 kinds: IngressRoute, IngressRouteTCP, IngressRouteUDP, Middleware, MiddlewareTCP, ServersTransport, ServersTransportTCP, TLSOption, TLSStore, TraefikService.

Scope

traefik.io only, as the issue specified. The chart's crds/ directory also ships:

  • hub.traefik.io_* — Traefik Hub, a different commercial product, ~12 kinds, no known consumer.
  • A vendored copy of the Gateway API — already generated here from GATEWAY_API_CRD_BASE, so a second copy would collide.

Neither is taken.

No parser override

The issue asked to confirm rather than assume: the first-segment rule maps traefik.io → Traefik, which is already K8s::Traefik::IngressRoute. Nothing to add. Also verified no duplicate export names in the generated barrel — Middleware, TLSStore and TraefikService are generic enough to be worth checking.

Pin

Chart v41.1.0, which ships Traefik v3.7.9. The issue flagged that the chart version and the proxy version are different numbers and asked for both to be recorded — they're in the crd-sources.ts doc comment and in the docs page.

The issue verified v34.1.0 (Traefik v3.3.2); I went to latest since, unlike CNPG, no consumer pins a version here — fountain's manifests just say traefik.io/v1alpha1. All ten traefik.io_*.yaml files verified 200 at v41.1.0.

Acceptance test

Reproduces fountain's k8s/ingressroute.yaml — both routes. Two assertions exist because the failure mode is silent:

  • The cross-namespace middleware ref. redirect-https lives in default, the route in fountain. Drop the namespace qualifier and Traefik looks in the route's own namespace, finds nothing, applies no middleware, and serves the route anyway — plain HTTP keeps working instead of redirecting, with no error.
  • The matcher grammar. The backticks in Host(`fountain.inevitable.fyi`) are part of Traefik's matcher language, not YAML quoting. Anything that strips or re-quotes them yields a rule that parses and matches nothing.

Verification

npm run --prefix lexicons/k8s prepack   # clean
npx vitest run lexicons/k8s             # 1101 passed | 1 skipped

239 → 249 resources. No snapshot drift.

🤖 Generated with Claude Code

https://claude.ai/code/session_017jrdX8yZWxFayQpbpFFj1B

Adds the ten traefik.io/v1alpha1 kinds -- IngressRoute, IngressRouteTCP,
IngressRouteUDP, Middleware, MiddlewareTCP, ServersTransport,
ServersTransportTCP, TLSOption, TLSStore, TraefikService.

An IngressRoute is not a networking.k8s.io Ingress with annotations; it is
a separate CRD with its own matcher grammar. Before this, an estate fronted
by Traefik had an edge chant could not express at all.

Scoped to the traefik.io group only. The chart's crds/ also ships
hub.traefik.io_* (Traefik Hub -- different product, no known consumer) and
a vendored Gateway API copy, which is already generated from its own
upstream and would collide.

No parser override: the first-segment rule already yields `Traefik`.
Confirmed rather than assumed.

Pinned to chart v41.1.0 == Traefik v3.7.9. The chart version is not the
proxy version, so the doc comment records both.

The test reproduces fountain's k8s/ingressroute.yaml, including the
cross-namespace middleware ref -- one key that is easy to omit and whose
omission applies cleanly and silently stops redirecting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017jrdX8yZWxFayQpbpFFj1B
@lex00
lex00 force-pushed the feat/1320-traefik-crds branch from 25f1648 to 7e6ebc0 Compare August 3, 2026 02:39
@lex00
lex00 merged commit 2fbd3cb into main Aug 3, 2026
6 checks passed
@lex00
lex00 deleted the feat/1320-traefik-crds branch August 3, 2026 02:49
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.

k8s: Traefik CRD codegen (IngressRoute, Middleware, and the traefik.io proxy surface)

1 participant