traefik/traefik
Glossary
Terms used throughout the codebase and the official documentation. The glossary leans on the configuration vocabulary defined in pkg/config/dynamic and pkg/config/static.
Routing concepts
- Entry point — a network listener with a port, protocol, and TLS configuration. Defined statically in
pkg/config/static/entrypoints.go. Each entry point can carry HTTP, HTTP/2, HTTP/3, TCP, or UDP traffic. - Router — a rule plus a list of middlewares plus a target service. HTTP routers live in
pkg/config/dynamic/http_config.go(Router); TCP and UDP variants live intcp_config.goandudp_config.go. - Rule — the predicate string a router matches against (e.g.
Host(\api.example.com`) && PathPrefix(`/v1`)). Parsed bypkg/rules/parser.go`. - Service — the destination of a router. Most commonly a load-balanced set of upstream URLs. Mirroring, weighted, and failover services exist too. See
pkg/config/dynamic/http_config.go(Service) andpkg/server/service/service.go. - Middleware — a request transformer attached to a router. Each middleware type has its own implementation under
pkg/middlewares/<name>and a config struct inpkg/config/dynamic/middlewares.go. - Provider — a source of dynamic configuration. Implements
provider.Providerinpkg/provider/provider.go. Examples: Docker, Kubernetes (CRD/Ingress/Gateway), file, Consul KV, Nomad. - TLS option — a named TLS configuration template (cipher suites, min version, mTLS settings, ALPN). Live in
pkg/tls/tls.go. - Certificate resolver — an entity that obtains TLS certificates dynamically, most often via ACME (
pkg/provider/acme). Tailscale resolvers also exist (pkg/provider/tailscale).
Configuration vocabulary
- Static configuration — settings frozen at startup. Schema in
pkg/config/static/static_config.go. - Dynamic configuration — settings that can change at runtime via providers. Top-level type is
dynamic.Configurationinpkg/config/dynamic/http_config.go. - Runtime configuration — the in-memory dynamic configuration with attached status (used by the dashboard). Lives in
pkg/config/runtime. - Constraint — a label selector applied to provider-discovered objects to include or exclude them. Implemented in
pkg/provider/constraints/. - Default rule — a Go template (per provider) used to build a router rule when none is defined on the discovered service. Set on the provider config.
Networking and protocols
- HTTP/3 — QUIC-based HTTP. Supported by entry points via
pkg/server/server_entrypoint_tcp_http3.go. - HTTP/2 — supported on TCP entry points, including HTTP/2 Cleartext (h2c).
- gRPC / gRPC-Web — gRPC works natively over HTTP/2; gRPC-Web is bridged by
pkg/middlewares/grpcweb. - WebSocket — supported transparently by the HTTP reverse proxies in
pkg/proxy/fastandpkg/proxy/httputil. - PROXY protocol — supported on TCP entry points; trusted networks live in entry-point configuration.
- SNI / ALPN — used by
pkg/muxer/tcpto multiplex TLS, HTTP, and raw TCP on the same port.
Load balancing and health
- WRR — weighted round robin. Implementation in
pkg/server/service/loadbalancer/wrr. - P2C — power-of-two-choices. Implementation in
pkg/server/service/loadbalancer/p2c. - HRW — highest random weight (rendezvous hashing). Implementation in
pkg/server/service/loadbalancer/hrw. - Mirror — duplicates traffic across services. Implementation in
pkg/server/service/loadbalancer/mirror. - Failover — primary/fallback service. Implementation in
pkg/server/service/loadbalancer/failover. - Sticky session — cookie-based affinity. Implementation in
pkg/server/service/loadbalancer/sticky.goand the cookie helper inpkg/server/cookie. - Health check — periodic probe against an upstream URL. Server-side logic in
pkg/healthcheckandpkg/server/service/loadbalancer/healthcheck.go(per-LB).
Observability
- Access log — per-request log line. Implemented in
pkg/middlewares/accesslog. Supports CLF and JSON formats. - Capture middleware — internal middleware that records latency, byte counts, and status for downstream observability middlewares (
pkg/middlewares/capture). - Metrics registry — typed metrics interface (
pkg/observability/metrics/metrics.go) with backends for Prometheus, OTLP, Datadog, StatsD, InfluxDB 2. - Tracer — OpenTelemetry tracer wired in
pkg/observability/tracing. - Hub — Traefik Hub integration hooks. Some hooks live in this open-source repo (
pkg/provider/aggregator/aggregator.gomentions hub providers); the actual integration is shipped separately.
ACME / TLS
- ACME challenge — HTTP-01 (
pkg/provider/acme/challenge_http.go) or TLS-ALPN-01 (pkg/provider/acme/challenge_tls.go) or DNS-01 (provided bygo-acme/legoplugins). - Resolver — a named ACME or external resolver in static config. Routers reference resolvers by name to request certificates.
- OCSP stapling — implemented in
pkg/tls/ocsp.go. Enabled by theOCSPstatic-config block. - SPIFFE / SVID — workload identity integration via
github.com/spiffe/go-spiffe/v2. Wired incmd/traefik/traefik.go.
Plugins
- Yaegi plugin — a Go middleware loaded at runtime via the Yaegi interpreter. See
pkg/plugins/middlewareyaegi.go. - Wasm plugin — a WebAssembly middleware loaded via Wazero. See
pkg/plugins/middlewarewasm.go. - Plugin manifest —
.traefik.ymlshipped with each plugin; parsed bypkg/plugins/manager.go.
Process model
- Routines pool — a
safe.Pool(pkg/safe) of context-aware goroutines used for provider polling and configuration application. - Server — the top-level lifecycle owner in
pkg/server/server.go. Owns the entry points, the watcher, the observability manager, and the routines pool. - Configuration watcher —
pkg/server/configurationwatcher.go. Receives, deduplicates, transforms, and dispatches dynamic configurations. - Router factory —
pkg/server/routerfactory.go. Builds the live router tree from adynamic.Configurationssnapshot. - Aggregator —
pkg/provider/aggregator/aggregator.go. Multiplexes multiple providers behind a singleprovider.Providerinterface.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.