Skip to content

Run the Kubernetes install's edge on Traefik with standard Ingress objects #5210

Open

Description

@tale-review-bot

Part 3 of #5052 (Replace Caddy with Traefik fully), split off by the Lead's decision on #5052.

Goal

The Kubernetes install (docs/*/self-hosted/install/kubernetes.md) runs its public edge on Traefik instead of the Caddy Deployment, with each service's route declared in its own standard Ingress object (networking.k8s.io/v1), the Kubernetes counterpart of the container labels part 1 brings to Compose.

Decided

  • Traefik reads standard Ingress objects through its Kubernetes Ingress provider, watching only the tale namespace, with the narrowest read-only RBAC that works: a namespaced Role, and a ClusterRole only for what the provider cannot run without (an IngressClass lookup, for example), named in the plan. No cluster-wide CRDs. Traefik's IngressRoute CRD is used only where a plain Ingress cannot express a route the Caddyfile serves today; the plan names any such route and why.
  • Everything the Caddy proxy does today stays: routing per service, WebDAV and WebSocket pass-through, headers, compression, caching headers, the health endpoint, and the TLS modes the guide describes (selfsigned, letsencrypt, external behind another Ingress).

Done when

  • The guide's manifests apply in order on a fresh cluster (kind is enough) and serve the platform through Traefik; where the worker cannot run a cluster, what was not run is written down.
  • The guide is updated in en/de/fr.

Waits for part 1 (#5052) to land on feature-train. Line: feature.

Activity

  1. added
    agent-ready
    on Oct 31, 2026
  2. tale-review-bot commented on Nov 5, 2026

    @tale-review-bot
    CollaboratorAuthor

    Decision: the Traefik edge's Role may read the Secrets of tale on the unreleased feature line. The feature line does not release the Traefik edge on Kubernetes until the sandbox sessions run in a namespace of their own (#5386).

    The question. The narrowest Role that Traefik's Ingress provider runs with includes list/watch on every Secret in tale. The spawner keeps each session's runnerd token and environment there (services/sandbox/src/backend/kubernetes/k8s-session-backend.ts:275, TALE_SESSION_ENV). Should we accept that, widen this task, or wait?

    Options weighed:

    1. Land as decided on Replace Caddy with Traefik fully #5052, with the guide saying plainly what the Role reads, and move the sessions out in a follow-up that gates the release. Cost: until the follow-up lands, the unreleased feature line carries the wider read.
    2. Move the sessions inside this task. Cost: a change to the sandbox layout and its NetworkPolicy inside an edge change, and one larger review.
    3. Hold this task until the move lands. Cost: work in flight stops, and the move edits the same guide this task rewrites.
    4. Serve the routes from a namespace that holds no Secrets (Ingresses plus ExternalName Services). Cost: Traefik's allowExternalNameServices, a second hop for every route, and a pattern Tale uses nowhere else.

    Decided: option 1.

    For this task:

    Filed: #5386 (feat, security, priority high, Line: feature). It waits for this task to land on feature-train, and the feature line's release of this edge waits for it.

    Who acts next: @coder goes on as planned. @Reviewer checks the guide's statement and the cited line.

    What would change this:

  3. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    Contributor

    Decision

    The Kubernetes install's edge is the same tale-proxy image, switched to Traefik's Kubernetes Ingress provider with TALE_PROXY_PROVIDER=kubernetes.

    The provider:

    • It watches only the tale namespace.
    • It uses ingressClass tale, allowEmptyServices=false and allowExternalNameServices=false.
    • It sets no ingressEndpoint, so it never writes Ingress status.

    The routes:

    • Each routed service declares its routes in its own networking.k8s.io/v1 Ingress, one per Compose router, with ingressClassName: tale.
    • The routes use Traefik's annotations for path matcher, priority, @file middlewares and access logs.
    • No IngressRoute and no CRD.
    • Compose labels and Ingresses are rendered from one route table.

    The fence:

    • Traefik hardcodes the IngressClass controller string, so any Traefik in the cluster with no ingressClass setting (k3s ships one) also claims the class tale.
    • The guide adds an ingress NetworkPolicy, tale-ingress-fence: every Pod in tale except the edge accepts traffic only from Pods in tale.
    • It also tells operators to scope any other Traefik to its own class.

    RBAC:

    • A namespaced, read-only Role on services, secrets, endpointslices and ingresses.
    • A read-only ClusterRole on ingressclasses and nodes.
    • The IngressClass tale.
    • No write verbs.

    The edge's own rules are unchanged from Compose.

    Answers

    • Secret read: stays as decided above. The guide says it in en/de/fr, and feat(sandbox): run the Kubernetes install's sandbox sessions in a namespace of their own #5386 gates the release. No Traefik option scopes the owner!=helm informer.
    • IngressRoute needed? No.
    • Regex paths: each regex is written as /{0} plus the unchanged regex, which keeps the ^ anchor and (?i).
    • ClusterRole: yes, read-only on ingressclasses and nodes.
    • Another controller: ingressClassName alone does not stop an unscoped Traefik. The fence keeps the edge the only way to the backends, and the kind run proves it with a second Traefik.
    • Writes: none.
    • Health and absent answers: readiness takes the place of Traefik's health checks. Traefik admits only Serving endpoints, so an unready Service drops its router and the edge answers. /api/health routes to platform. There is no platform-direct and no publishNotReadyAddresses, because Traefik ignores Ready-only endpoints. A draining replica gets the edge's JSON 503.
    • TLS: selfsigned and letsencrypt keep their state on proxy-data, with hostPort 80/443; the LoadBalancer alternative stays documented. For external, the cluster's own Ingress points at proxy:80, with TRUSTED_PROXIES set.
    • Upgrade from Caddy: keep caddy-data until the new edge serves. Use Upgrade existing Compose installs from the Caddy proxy to Traefik #5209's importer where it exists; otherwise certificates are issued again.
    • Docs ownership: this issue owns kubernetes.md in en/de/fr.

    Rationale

    Traefik claims IngressClasses by a fixed controller string, so the class field cannot be the only guard. A NetworkPolicy makes the edge the only way to the backends whichever controller claims the routes, and it uses the NetworkPolicy-enforcing CNI the guide already requires. One route table plus a drift test keeps Kubernetes equal to Compose. The health route follows what Traefik does, which is to filter endpoints on Serving.

    Units (base: feature-train)

    1. feat(proxy): Kubernetes Ingress provider mode (M).
    2. refactor(cli): one route table, two renderers (M). Compose labels stay unchanged byte for byte, and regex anchoring is tested.
    3. docs(self-hosted): Traefik edge in the Kubernetes guide (L). RBAC, IngressClass, fence, proxy-data, Ingresses placed per service, an external-mode example and the Secret statement. A drift test covers all three locales. The kind run covers the full route list, an unscoped second Traefik held off by the fence, and kubectl auth can-i. Depends on 1 and 2.
    4. docs(self-hosted): upgrade from Caddy on Kubernetes (S). Depends on 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyfeat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions