Traefik & KV Stores
Routing Configuration
Keys
Keys are case-insensitive.
Routers
The character @
is not authorized in the router name <router_name>
.
traefik/http/routers/<router_name>/rule
See rule for more information.
Key (Path)
Value
traefik/http/routers/myrouter/rule
Host(`example.com`)
traefik/http/routers/<router_name>/ruleSyntax
See rule for more information.
Key (Path)
Value
traefik/http/routers/myrouter/ruleSyntax
v3
traefik/http/routers/<router_name>/entrypoints
See entry points for more information.
Key (Path)
Value
traefik/http/routers/myrouter/entrypoints/0
web
traefik/http/routers/myrouter/entrypoints/1
websecure
traefik/http/routers/<router_name>/middlewares
See middlewares overview for more information.
Key (Path)
Value
traefik/http/routers/myrouter/middlewares/0
auth
traefik/http/routers/myrouter/middlewares/1
prefix
traefik/http/routers/myrouter/middlewares/2
cb
traefik/http/routers/<router_name>/service
See service for more information.
Key (Path)
Value
traefik/http/routers/myrouter/service
myservice
traefik/http/routers/<router_name>/tls
See tls for more information.
Key (Path)
Value
traefik/http/routers/myrouter/tls
true
traefik/http/routers/<router_name>/tls/certresolver
See certResolver for more information.
Key (Path)
Value
traefik/http/routers/myrouter/tls/certresolver
myresolver
traefik/http/routers/<router_name>/tls/domains/<n>/main
See domains for more information.
Key (Path)
Value
traefik/http/routers/myrouter/tls/domains/0/main
example.org
traefik/http/routers/<router_name>/tls/domains/<n>/sans/<n>
See domains for more information.
Key (Path)
Value
traefik/http/routers/myrouter/tls/domains/0/sans/0
test.example.org
traefik/http/routers/myrouter/tls/domains/0/sans/1
dev.example.org
traefik/http/routers/<router_name>/tls/options
See TLS for more information.
Key (Path)
Value
traefik/http/routers/myrouter/tls/options
foobar
traefik/http/routers/<router_name>/observability/accesslogs
The accessLogs option controls whether the router will produce access-logs.
Key (Path)
Value
traefik/http/routers/myrouter/observability/accesslogs
true
traefik/http/routers/<router_name>/observability/metrics
The metrics option controls whether the router will produce metrics.
Key (Path)
Value
traefik/http/routers/myrouter/observability/metrics
true
traefik/http/routers/<router_name>/observability/tracing
The tracing option controls whether the router will produce traces.
Key (Path)
Value
traefik/http/routers/myrouter/observability/tracing
true
traefik/http/routers/<router_name>/priority
See domains for more information.
Key (Path)
Value
traefik/http/routers/myrouter/priority
42
Services
The character @
is not authorized in the service name <service_name>
.
traefik/http/services/<service_name>/loadbalancer/servers/<n>/url
See servers for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/servers/0/url
http://<ip-server-1>:<port-server-1>/
traefik/http/services/<service_name>/loadbalancer/servers/<n>/preservePath
See servers for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/servers/0/preservePath
true
traefik/http/services/<service_name>/loadbalancer/servers/<n>/weight
See servers for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/servers/0/weight
1
traefik/http/services/<service_name>/loadbalancer/serverstransport
Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See serverstransport for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/serverstransport
foobar@file
traefik/http/services/<service_name>/loadbalancer/passhostheader
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/passhostheader
true
traefik/http/services/<service_name>/loadbalancer/healthcheck/headers/<header_name>
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/headers/X-Foo
foobar
traefik/http/services/<service_name>/loadbalancer/healthcheck/hostname
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/hostname
example.org
traefik/http/services/<service_name>/loadbalancer/healthcheck/interval
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/interval
10
traefik/http/services/<service_name>/loadbalancer/healthcheck/path
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/path
/foo
traefik/http/services/<service_name>/loadbalancer/healthcheck/method
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/method
foobar
traefik/http/services/<service_name>/loadbalancer/healthcheck/status
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/status
42
traefik/http/services/<service_name>/loadbalancer/healthcheck/port
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/port
42
traefik/http/services/<service_name>/loadbalancer/healthcheck/scheme
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/scheme
http
traefik/http/services/<service_name>/loadbalancer/healthcheck/timeout
See health check for more information.
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/healthcheck/timeout
10
traefik/http/services/<service_name>/loadbalancer/sticky
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/sticky
true
traefik/http/services/<service_name>/loadbalancer/sticky/cookie/httponly
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/sticky/cookie/httponly
true
traefik/http/services/<service_name>/loadbalancer/sticky/cookie/name
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/sticky/cookie/name
foobar
traefik/http/services/<service_name>/loadbalancer/sticky/cookie/path
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/sticky/cookie/path
/foobar
traefik/http/services/<service_name>/loadbalancer/sticky/cookie/secure
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/sticky/cookie/secure
true
traefik/http/services/<service_name>/loadbalancer/sticky/cookie/samesite
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/sticky/cookie/samesite
none
traefik/http/services/<service_name>/loadbalancer/sticky/cookie/maxage
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/sticky/cookie/maxage
42
traefik/http/services/<service_name>/loadbalancer/responseforwarding/flushinterval
Key (Path)
Value
traefik/http/services/myservice/loadbalancer/responseforwarding/flushinterval
10
traefik/http/services/<service_name>/mirroring/service
Key (Path)
Value
traefik/http/services/<service_name>/mirroring/service
foobar
traefik/http/services/<service_name>/mirroring/mirrors/<n>/name
Key (Path)
Value
traefik/http/services/<service_name>/mirroring/mirrors/<n>/name
foobar
traefik/http/services/<service_name>/mirroring/mirrors/<n>/percent
Key (Path)
Value
traefik/http/services/<service_name>/mirroring/mirrors/<n>/percent
42
traefik/http/services/<service_name>/weighted/services/<n>/name
Key (Path)
Value
traefik/http/services/<service_name>/weighted/services/<n>/name
foobar
traefik/http/services/<service_name>/weighted/services/<n>/weight
Key (Path)
Value
traefik/http/services/<service_name>/weighted/services/<n>/weight
42
traefik/http/services/<service_name>/weighted/sticky/cookie/name
Key (Path)
Value
traefik/http/services/<service_name>/weighted/sticky/cookie/name
foobar
traefik/http/services/<service_name>/weighted/sticky/cookie/secure
Key (Path)
Value
traefik/http/services/<service_name>/weighted/sticky/cookie/secure
true
traefik/http/services/<service_name>/weighted/sticky/cookie/samesite
Key (Path)
Value
traefik/http/services/<service_name>/weighted/sticky/cookie/samesite
none
traefik/http/services/<service_name>/weighted/sticky/cookie/httpOnly
Key (Path)
Value
traefik/http/services/<service_name>/weighted/sticky/cookie/httpOnly
true
traefik/http/services/<service_name>/weighted/sticky/cookie/maxage
Key (Path)
Value
traefik/http/services/<service_name>/weighted/sticky/cookie/maxage
42
traefik/http/services/<service_name>/failover/fallback
See Failover for more information
Key (Path)
Value
traefik/http/services/<service_name>/failover/fallback
backup
traefik/http/services/<service_name>/failover/healthcheck
See Failover for more information
Key (Path)
Value
traefik/http/services/<service_name>/failover/healthcheck
{}
traefik/http/services/<service_name>/failover/service
See Failover for more information
Key (Path)
Value
traefik/http/services/<service_name>/failover/service
main
Middleware
More information about available middlewares in the dedicated middlewares section .
The character @
is not authorized in the middleware name.
Conflicts in Declaration
If you declare multiple middleware with the same name but with different parameters, the middleware fails to be declared.
TCP
You can declare TCP Routers and/or Services using KV.
TCP Routers
traefik/tcp/routers/<router_name>/entrypoints
See entry points for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/entrypoints/0
ep1
traefik/tcp/routers/mytcprouter/entrypoints/1
ep2
traefik/tcp/routers/<router_name>/rule
See entry points for more information.
Key (Path)
Value
traefik/tcp/routers/my-router/rule
HostSNI(`example.com`)
traefik/tcp/routers/<router_name>/service
See service for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/service
myservice
traefik/tcp/routers/<router_name>/tls
See TLS for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/tls
true
traefik/tcp/routers/<router_name>/tls/certresolver
See certResolver for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/tls/certresolver
myresolver
traefik/tcp/routers/<router_name>/tls/domains/<n>/main
See TLS for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/tls/domains/0/main
example.org
traefik/tcp/routers/<router_name>/tls/domains/<n>/sans
See TLS for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/tls/domains/0/sans/0
test.example.org
traefik/tcp/routers/mytcprouter/tls/domains/0/sans/1
dev.example.org
traefik/tcp/routers/<router_name>/tls/options
See TLS for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/tls/options
foobar
traefik/tcp/routers/<router_name>/tls/passthrough
See TLS for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/tls/passthrough
true
traefik/tcp/routers/<router_name>/priority
See priority for more information.
Key (Path)
Value
traefik/tcp/routers/mytcprouter/priority
42
TCP Services
traefik/tcp/services/<service_name>/loadbalancer/servers/<n>/address
See servers for more information.
Key (Path)
Value
traefik/tcp/services/mytcpservice/loadbalancer/servers/0/address
xx.xx.xx.xx:xx
traefik/tcp/services/<service_name>/loadbalancer/servers/<n>/tls
See servers for more information.
Key (Path)
Value
traefik/tcp/services/mytcpservice/loadbalancer/servers/0/tls
true
traefik/tcp/services/<service_name>/loadbalancer/proxyprotocol/version
See PROXY protocol for more information.
Key (Path)
Value
traefik/tcp/services/mytcpservice/loadbalancer/proxyprotocol/version
1
traefik/tcp/services/<service_name>/loadbalancer/serverstransport
Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See serverstransport for more information.
Key (Path)
Value
traefik/tcp/services/myservice/loadbalancer/serverstransport
foobar@file
traefik/tcp/services/<service_name>/weighted/services/<n>/name
Key (Path)
Value
traefik/tcp/services/<service_name>/weighted/services/0/name
foobar
traefik/tcp/services/<service_name>/weighted/services/<n>/weight
Key (Path)
Value
traefik/tcp/services/<service_name>/weighted/services/0/weight
42
TCP Middleware
You can declare pieces of middleware using tags starting with traefik/tcp/middlewares/{name-of-your-choice}.
, followed by the middleware type/options.
For example, to declare a middleware InFlightConn
named test-inflightconn
, you'd write traefik/tcp/middlewares/test-inflightconn/inflightconn/amount=10
.
More information about available middlewares in the dedicated middlewares section .
Declaring and Referencing a Middleware
# ...
# Declaring a middleware
traefik/tcp/middlewares/test-inflightconn/amount=10
# Referencing a middleware
traefik/tcp/routers.my-service/middlewares=test-inflightconn
Conflicts in Declaration
If you declare multiple middleware with the same name but with different parameters, the middleware fails to be declared.
UDP
You can declare UDP Routers and/or Services using KV.
UDP Routers
traefik/udp/routers/<router-name>/entrypoints/<n>
Key (Path)
Value
traefik/udp/routers/myudprouter/entrypoints/0
foobar
traefik/udp/routers/<router-name>/service
Key (Path)
Value
traefik/udp/routers/myudprouter/service
foobar
UDP Services
traefik/udp/services/loadBalancer/servers/<n>/address
Key (Path)
Value
traefik/udp/services/loadBalancer/servers/<n>/address
foobar
traefik/udp/services/weighted/services/<n>/name
Key (Path)
Value
traefik/udp/services/weighted/services/0/name
foobar
traefik/udp/services/weighted/services/<n>/name
Key (Path)
Value
traefik/udp/services/weighted/servers/0/weight
42
TLS
TLS Options
With the KV provider, you configure some parameters of the TLS connection using the tls/options
key. For example, you can define a basic setup like this:
Key (Path)
Value
traefik/tls/options/Options0/alpnProtocols/0
foobar
traefik/tls/options/Options0/cipherSuites/0
foobar
traefik/tls/options/Options0/clientAuth/caFiles/0
foobar
For more information on the available TLS options that can be configured, please refer to the TLS Options page.
TLS Default Generated Certificates
You can configure Traefik to use an ACME provider (like Let's Encrypt) to generate the default certificate. The configuration to resolve the default certificate should be defined in a TLS store:
Key (Path)
Value
traefik/tls/stores/Store0/defaultGeneratedCert/domain/main
foobar
traefik/tls/stores/Store0/defaultGeneratedCert/domain/sans/0
foobar
traefik/tls/stores/Store0/defaultGeneratedCert/domain/sans/1
foobar
traefik/tls/stores/Store0/defaultGeneratedCert/resolver
foobar