Skip to content

feat: move the ingress layer from ingress-nginx to Traefik - #27

Merged
vthwang merged 1 commit into
mainfrom
feat/traefik-ingress
Aug 17, 2026
Merged

feat: move the ingress layer from ingress-nginx to Traefik#27
vthwang merged 1 commit into
mainfrom
feat/traefik-ingress

Conversation

@vthwang

@vthwang vthwang commented Aug 17, 2026

Copy link
Copy Markdown
Member

Resolved #26

The dids daemon warn-logs every request that claims a forwarded host from a
peer outside its trusted-CIDR set, and an ingress puts X-Forwarded-Host on
every request — so it logged one warning per request, forever. Trusting the
ingress CIDR would have silenced it by granting host control to every pod on a
flat network, which is exactly what the daemon's gate exists to prevent.

Stripping the header at the ingress is impossible under ingress-nginx: snippet
annotations are disabled cluster-wide (the admission webhook refuses them), and
even enabled, the snippet renders after the controller's own
`proxy_set_header X-Forwarded-Host $best_http_host` in the same location, where
nginx sends both values rather than letting the later one win. Traefik writes
the X-Forwarded-* set at the entrypoint, before middlewares run, so a headers
middleware with an empty value actually removes it — verified against v3.3, and
the dids Ingress now carries one per user namespace.

The controller swap subsumes the rest:

- ingressClassName is Traefik's, hardcoded in k8s.IngressClass. A different
  controller needs different entrypoint settings, default certificate and ACME
  solver class too, so one env var could never carry the switch.
- The Ingresses lose every annotation. HTTP→HTTPS is now an entrypoint redirect
  and the wildcard certificate comes from the `default` TLSStore, so there is
  nothing left for them to say. The wildcard moves to kube-system because a
  TLSStore can only reference a Secret in its own namespace.
- The HTTP-01 solver names the traefik class; Let's Encrypt follows the
  entrypoint redirect and does not validate the certificate it lands on.

scripts/migrate-ingress-to-traefik.sh repoints Ingresses that already exist —
this API only ever creates them, so without it they keep the nginx class and
Traefik never adopts them. Dry-run by default, and it reports the chart-managed
Ingresses it deliberately does not touch rather than editing a chart's output.

Two things the dev migration taught, both recorded where they will be read:
Helm accepts a values path that is one level off without complaining, so the
entrypoint keys must be verified against the rendered args and not this file;
and managed hostnames are proxied through Cloudflare, so verification has to
pin the node IP or it reports Cloudflare's certificate instead of ours.

Signed-off-by: vthwang <vthwang.work@gmail.com>
@vthwang vthwang self-assigned this Aug 17, 2026
@vthwang vthwang added the enhancement New feature or request label Aug 17, 2026
@vthwang
vthwang merged commit c97bb64 into main Aug 17, 2026
1 check passed
@vthwang
vthwang deleted the feat/traefik-ingress branch August 17, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear X-Forwarded-Host at the ingress to remove log noise

1 participant