Skip to content

feat(deployment): add traefikVersion toggle for v2/v3#6292

Draft
theosanderson-agent wants to merge 1 commit intomainfrom
feat/traefik-v2-v3-toggle
Draft

feat(deployment): add traefikVersion toggle for v2/v3#6292
theosanderson-agent wants to merge 1 commit intomainfrom
feat/traefik-v2-v3-toggle

Conversation

@theosanderson-agent
Copy link
Copy Markdown
Collaborator

@theosanderson-agent theosanderson-agent commented Apr 17, 2026

Summary

Adds a traefikVersion Helm value (default 2) that selects the Middleware CRD apiVersion group used by the chart:

  • traefikVersion: 2traefik.containo.us/v1alpha1 (Traefik v2, unchanged default)
  • traefikVersion: 3traefik.io/v1alpha1 (Traefik v3)

The templates compute a single $traefikApiVersion variable via a ternary on the value, and every Middleware resource in templates/ingressroute.yaml and templates/lapis-ingress.yaml (compression, redirect-to-https, basic-auth, noindex-robots-header, redirect-www, cors-all-origins, strip-*-prefix, redirect-slash) renders with that group. values.schema.json declares traefikVersion as an integer with enum: [2, 3].

While in the area, this also changes the keycloak ingress path from /{+} to / with pathType: Prefix. The /{+} syntax causes 404s under Traefik v3; / achieves the same catch-all behavior using standard Ingress path semantics and works identically under v2.

This lets existing v2 deployments stay on their current defaults and lets operators migrate to Traefik v3 by flipping a single value — no chart fork or template patching required.

Test plan

  • helm lint kubernetes/loculus -f kubernetes/loculus/values.yaml passes
  • helm template kubernetes/loculus --set traefikVersion=2 emits only traefik.containo.us/v1alpha1 for Middleware resources
  • helm template kubernetes/loculus --set traefikVersion=3 emits only traefik.io/v1alpha1 for Middleware resources
  • Deploy against a Traefik v2 cluster with defaults — website, backend, keycloak, lapis, minio ingresses all route correctly
  • Deploy against a Traefik v3 cluster with traefikVersion: 3 — same
  • Verify keycloak login flow works under both versions (path / no longer 404s on v3)
  • Schema rejects values other than 2 or 3 for traefikVersion

🤖 Generated with Claude Code

🚀 Preview: Add preview label to enable

Adds a `traefikVersion` Helm value (default: 2) that controls the
apiVersion used for Traefik Middleware CRDs. When set to 2, the chart
uses `traefik.containo.us/v1alpha1` (Traefik v2). When set to 3, it
uses `traefik.io/v1alpha1` (Traefik v3).

Also swaps the keycloak ingress path from `/{+}` to `/` with
`pathType: Prefix`. The `/{+}` syntax causes 404s with Traefik v3;
`/` achieves the same catch-all behavior without Traefik-specific
path syntax and works on both versions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude claude bot added the deployment Code changes targetting the deployment infrastructure label Apr 17, 2026
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 17, 2026

This PR may be related to: #6014 (Support traefik v3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deployment Code changes targetting the deployment infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants