{# Managed by Ansible (roles/k3s_traefik) — do not edit on the node. A HelmChartConfig, not a HelmChart, because this is the one chart on the cluster this repo doesn't install: k3s installs Traefik itself, rewriting /var/lib/rancher/k3s/server/manifests/traefik.yaml on every server start and overwriting whatever is in it. A HelmChartConfig carrying the same name and namespace as that HelmChart is the supported way in — k3s's helm-controller merges its valuesContent over the chart's values on the next reconcile. Editing traefik.yaml directly works until the next restart, and then silently doesn't. Hence also the filename this renders to (traefik-config.yaml): anything called traefik.yaml here belongs to k3s and would be reclaimed. -#} apiVersion: helm.cattle.io/v1 kind: HelmChartConfig metadata: name: traefik namespace: {{ k3s_traefik_namespace }} spec: valuesContent: |- ingressRoute: dashboard: # Traefik builds the dashboard either way — `api.dashboard` is on by # default. What the chart stopped shipping in v28 is the router that # reaches it, which is why a stock k3s answers 404 to # :9000/dashboard/ while :9000/ping happily returns 200. This puts # that router back, on Traefik's internal `traefik` entrypoint # (9000), which isn't published on the Service — so it is reachable # by `kubectl port-forward` and nothing else. See defaults/main.yml # for why that stays true even once the dashboard is also exposed on # a hostname. enabled: {{ k3s_traefik_dashboard_enabled | bool | lower }}