1
0
Fork 0

Migration guide: pathprefixstrip migration

This commit is contained in:
Damien Duportal 2019-10-14 17:26:05 +02:00 committed by Traefiker Bot
parent 0048156379
commit 8492a702b2

View file

@ -3,13 +3,13 @@
How to Migrate from Traefik v1 to Traefik v2. How to Migrate from Traefik v1 to Traefik v2.
{: .subtitle } {: .subtitle }
The version 2 of Traefik introduces a number of breaking changes, The version 2 of Traefik introduces a number of breaking changes,
which require one to update their configuration when they migrate from v1 to v2. which require one to update their configuration when they migrate from v1 to v2.
The goal of this page is to recapitulate all of these changes, and in particular to give examples, The goal of this page is to recapitulate all of these changes, and in particular to give examples,
feature by feature, of how the configuration looked like in v1, and how it now looks like in v2. feature by feature, of how the configuration looked like in v1, and how it now looks like in v2.
!!! info "Migration Helper" !!! info "Migration Helper"
We created a tool to help during the migration: [traefik-migration-tool](https://github.com/containous/traefik-migration-tool) We created a tool to help during the migration: [traefik-migration-tool](https://github.com/containous/traefik-migration-tool)
This tool allows to: This tool allows to:
@ -32,7 +32,7 @@ Then any router can refer to an instance of the wanted middleware.
!!! example "One frontend with basic auth and one backend, become one router, one service, and one basic auth middleware." !!! example "One frontend with basic auth and one backend, become one router, one service, and one basic auth middleware."
!!! info "v1" !!! info "v1"
```yaml tab="Docker" ```yaml tab="Docker"
labels: labels:
- "traefik.frontend.rule=Host:test.localhost;PathPrefix:/test" - "traefik.frontend.rule=Host:test.localhost;PathPrefix:/test"
@ -92,9 +92,9 @@ Then any router can refer to an instance of the wanted middleware.
[backends.backend1.loadBalancer] [backends.backend1.loadBalancer]
method = "wrr" method = "wrr"
``` ```
!!! info "v2" !!! info "v2"
```yaml tab="Docker" ```yaml tab="Docker"
labels: labels:
- "traefik.http.routers.router0.rule=Host(`bar.com`) && PathPrefix(`/test`)" - "traefik.http.routers.router0.rule=Host(`bar.com`) && PathPrefix(`/test`)"
@ -103,7 +103,7 @@ Then any router can refer to an instance of the wanted middleware.
``` ```
```yaml tab="K8s IngressRoute" ```yaml tab="K8s IngressRoute"
# The definitions below require the definitions for the Middleware and IngressRoute kinds. # The definitions below require the definitions for the Middleware and IngressRoute kinds.
# https://docs.traefik.io/v2.0/providers/kubernetes-crd/#traefik-ingressroute-definition # https://docs.traefik.io/v2.0/providers/kubernetes-crd/#traefik-ingressroute-definition
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
kind: Middleware kind: Middleware
@ -155,7 +155,7 @@ Then any router can refer to an instance of the wanted middleware.
[http.middlewares] [http.middlewares]
[http.middlewares.auth.basicAuth] [http.middlewares.auth.basicAuth]
users = [ users = [
"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/", "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0", "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
] ]
``` ```
@ -184,7 +184,7 @@ Then any router can refer to an instance of the wanted middleware.
- "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0" - "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
``` ```
## TLS configuration is now dynamic, per router. ## TLS Configuration Is Now Dynamic, per Router.
TLS parameters used to be specified in the static configuration, as an entryPoint field. TLS parameters used to be specified in the static configuration, as an entryPoint field.
With Traefik v2, a new dynamic TLS section at the root contains all the desired TLS configurations. With Traefik v2, a new dynamic TLS section at the root contains all the desired TLS configurations.
@ -214,13 +214,13 @@ Then, a [router's TLS field](../routing/routers/index.md#tls) can refer to one o
certFile = "path/to/my.cert" certFile = "path/to/my.cert"
keyFile = "path/to/my.key" keyFile = "path/to/my.key"
``` ```
```bash tab="CLI" ```bash tab="CLI"
--entryPoints='Name:web-secure Address::443 TLS:path/to/my.cert,path/to/my.key TLS.MinVersion:VersionTLS12 TLS.CipherSuites:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256' --entryPoints='Name:web-secure Address::443 TLS:path/to/my.cert,path/to/my.key TLS.MinVersion:VersionTLS12 TLS.CipherSuites:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'
``` ```
!!! info "v2" !!! info "v2"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# dynamic configuration # dynamic configuration
[http.routers] [http.routers]
@ -250,7 +250,7 @@ Then, a [router's TLS field](../routing/routers/index.md#tls) can refer to one o
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
] ]
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
http: http:
routers: routers:
@ -275,9 +275,9 @@ Then, a [router's TLS field](../routing/routers/index.md#tls) can refer to one o
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
``` ```
```yaml tab="K8s IngressRoute" ```yaml tab="K8s IngressRoute"
# The definitions below require the definitions for the TLSOption and IngressRoute kinds. # The definitions below require the definitions for the TLSOption and IngressRoute kinds.
# https://docs.traefik.io/v2.0/providers/kubernetes-crd/#traefik-ingressroute-definition # https://docs.traefik.io/v2.0/providers/kubernetes-crd/#traefik-ingressroute-definition
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
kind: TLSOption kind: TLSOption
@ -310,11 +310,11 @@ Then, a [router's TLS field](../routing/routers/index.md#tls) can refer to one o
- name: whoami - name: whoami
port: 80 port: 80
tls: tls:
options: options:
name: mytlsoption name: mytlsoption
namespace: default namespace: default
``` ```
```yaml tab="Docker" ```yaml tab="Docker"
labels: labels:
# myTLSOptions must be defined by another provider, in this instance in the File Provider. # myTLSOptions must be defined by another provider, in this instance in the File Provider.
@ -322,7 +322,7 @@ Then, a [router's TLS field](../routing/routers/index.md#tls) can refer to one o
- "traefik.http.routers.router0.tls.options=myTLSOptions@file" - "traefik.http.routers.router0.tls.options=myTLSOptions@file"
``` ```
## HTTP to HTTPS Redirection is now configured on Routers ## HTTP to HTTPS Redirection Is Now Configured on Routers
Previously on Traefik v1, the redirection was applied on an entry point or on a frontend. Previously on Traefik v1, the redirection was applied on an entry point or on a frontend.
With Traefik v2 it is applied on a [Router](../routing/routers/index.md). With Traefik v2 it is applied on a [Router](../routing/routers/index.md).
@ -350,14 +350,14 @@ To apply a redirection, one of the redirect middlewares, [RedirectRegex](../midd
certFile = "examples/traefik.crt" certFile = "examples/traefik.crt"
keyFile = "examples/traefik.key" keyFile = "examples/traefik.key"
``` ```
```bash tab="CLI" ```bash tab="CLI"
--entrypoints=Name:web Address::80 Redirect.EntryPoint:web-secure --entrypoints=Name:web Address::80 Redirect.EntryPoint:web-secure
--entryPoints='Name:web-secure Address::443 TLS:path/to/my.cert,path/to/my.key' --entryPoints='Name:web-secure Address::443 TLS:path/to/my.cert,path/to/my.key'
``` ```
!!! info "v2" !!! info "v2"
```yaml tab="Docker" ```yaml tab="Docker"
labels: labels:
- traefik.http.routers.web.rule=Host(`foo.com`) - traefik.http.routers.web.rule=Host(`foo.com`)
@ -454,9 +454,9 @@ To apply a redirection, one of the redirect middlewares, [RedirectRegex](../midd
[[tls.certificates]] [[tls.certificates]]
certFile = "/path/to/domain.cert" certFile = "/path/to/domain.cert"
keyFile = "/path/to/domain.key" keyFile = "/path/to/domain.key"
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
## static configuration ## static configuration
# traefik.yml # traefik.yml
@ -506,7 +506,138 @@ To apply a redirection, one of the redirect middlewares, [RedirectRegex](../midd
certificates: certificates:
- certFile: /app/certs/server/server.pem - certFile: /app/certs/server/server.pem
keyFile: /app/certs/server/server.pem keyFile: /app/certs/server/server.pem
``` ```
## Strip and Rewrite Path Prefixes
With the new core notions of v2 (introduced earlier in the section
["Frontends and Backends Are Dead... Long Live Routers, Middlewares, and Services"](#frontends-and-backends-are-dead-long-live-routers-middlewares-and-services)),
transforming the URL path prefix of incoming requests is configured with [middlewares](../../middlewares/overview/),
after the routing step with [router rule `PathPrefix`](https://docs.traefik.io/v2.0/routing/routers/#rule).
Use Case: Incoming requests to `http://company.org/admin` are forwarded to the webapplication "admin",
with the path `/admin` stripped, e.g. to `http://<IP>:<port>/`. In this case, you must:
* First, configure a router named `admin` with a rule matching at least the path prefix with the `PathPrefix` keyword,
* Then, define a middlware of type [`stripprefix`](../../middlewares/stripprefix/), which remove the prefix `/admin`, associated to the router `admin`.
!!! example "Strip Path Prefix When Forwarding to Backend"
!!! info "v1"
```yaml tab="Docker"
labels:
- "traefik.frontend.rule=Host:company.org;PathPrefixStrip:/admin"
```
```yaml tab="Kubernetes Ingress"
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: traefik
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip
spec:
rules:
- host: company.org
http:
paths:
- path: /admin
backend:
serviceName: admin-svc
servicePort: admin
```
```toml tab="File (TOML)"
[frontends.admin]
[frontends.admin.routes.admin_1]
rule = "Host:company.org;PathPrefixStrip:/admin"
```
!!! info "v2"
```yaml tab="Docker"
labels:
- "traefik.http.routers.admin.rule=Host(`company.org`) && PathPrefix(`/admin`)"
- "traefik.http.middlewares.admin-stripprefix.stripprefix.prefixes=/admin"
- "traefik.http.routers.web.middlewares=admin-stripprefix@docker"
```
```yaml tab="Kubernetes IngressRoute"
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: http-redirect-ingressRoute
namespace: admin-web
spec:
entryPoints:
- web
routes:
- match: Host(`company.org`) && PathPrefix(`/admin`)
kind: Rule
services:
- name: admin-svc
port: admin
middlewares:
- name: admin-stripprefix
---
kind: Middleware
metadata:
name: admin-stripprefix
spec:
stripPrefix:
prefixes:
- /admin
```
```toml tab="File (TOML)"
## Dynamic configuration
# dynamic-conf.toml
[http.routers.router1]
rule = "Host(`company.org`) && PathPrefix(`/admin`)"
service = "admin-svc"
entrypoints = ["web"]
middlewares = ["admin-stripprefix"]
[http.middlewares]
[http.middlewares.admin-stripprefix.stripPrefix]
prefixes = ["/admin"]
# ...
```
```yaml tab="File (YAML)"
## Dynamic Configuration
# dynamic-conf.yml
# As YAML Configuration File
http:
routers:
admin:
service: admin-svc
middlewares:
- "admin-stripprefix"
rule: "Host(`company.org`) && PathPrefix(`/admin`)"
middlewares:
admin-stripprefix:
addPrefix:
prefix: "/admin"
# ...
```
??? question "What About Other Path Transformations?"
Instead of removing the path prefix with the [`stripprefix` middleware](../../middlewares/stripprefix/), you can also:
* Add a path prefix with the [`addprefix` middleware](../../middlewares/addprefix/)
* Replace the complete path of the request with the [`replacepath` middleware](../../middlewares/replacepath/)
* ReplaceRewrite path using Regexp with the [`replacepathregex` middleware](../../middlewares/replacepathregex/)
* And a lot more on the [`middlewares` page](../../middlewares/overview/)
## ACME (LetsEncrypt) ## ACME (LetsEncrypt)
@ -536,7 +667,7 @@ To apply a redirection, one of the redirect middlewares, [RedirectRegex](../midd
[acme.httpChallenge] [acme.httpChallenge]
entryPoint = "web" entryPoint = "web"
``` ```
```bash tab="CLI" ```bash tab="CLI"
--defaultentrypoints=web-secure,web --defaultentrypoints=web-secure,web
--entryPoints=Name:web Address::80 Redirect.EntryPoint:web-secure --entryPoints=Name:web Address::80 Redirect.EntryPoint:web-secure
@ -547,9 +678,9 @@ To apply a redirection, one of the redirect middlewares, [RedirectRegex](../midd
--acme.onHostRule=true --acme.onHostRule=true
--acme.httpchallenge.entrypoint=http --acme.httpchallenge.entrypoint=http
``` ```
!!! info "v2" !!! info "v2"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
[entryPoints] [entryPoints]
@ -566,7 +697,7 @@ To apply a redirection, one of the redirect middlewares, [RedirectRegex](../midd
# used during the challenge # used during the challenge
entryPoint = "web" entryPoint = "web"
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
entryPoints: entryPoints:
web: web:
@ -583,8 +714,8 @@ To apply a redirection, one of the redirect middlewares, [RedirectRegex](../midd
httpChallenge: httpChallenge:
# used during the challenge # used during the challenge
entryPoint: web entryPoint: web
``` ```
```bash tab="CLI" ```bash tab="CLI"
--entryPoints.web.address=":80" --entryPoints.web.address=":80"
--entryPoints.websecure.address=":443" --entryPoints.websecure.address=":443"
@ -601,7 +732,7 @@ There is no more log configuration at the root level.
!!! example "Simple log configuration" !!! example "Simple log configuration"
!!! info "v1" !!! info "v1"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
logLevel = "DEBUG" logLevel = "DEBUG"
@ -610,15 +741,15 @@ There is no more log configuration at the root level.
filePath = "/path/to/traefik.log" filePath = "/path/to/traefik.log"
format = "json" format = "json"
``` ```
```bash tab="CLI" ```bash tab="CLI"
--logLevel="DEBUG" --logLevel="DEBUG"
--traefikLog.filePath="/path/to/traefik.log" --traefikLog.filePath="/path/to/traefik.log"
--traefikLog.format="json" --traefikLog.format="json"
``` ```
!!! info "v2" !!! info "v2"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
[log] [log]
@ -626,15 +757,15 @@ There is no more log configuration at the root level.
filePath = "/path/to/log-file.log" filePath = "/path/to/log-file.log"
format = "json" format = "json"
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
# static configuration # static configuration
log: log:
level: DEBUG level: DEBUG
filePath: /path/to/log-file.log filePath: /path/to/log-file.log
format: json format: json
``` ```
```bash tab="CLI" ```bash tab="CLI"
--log.level="DEBUG" --log.level="DEBUG"
--log.filePath="/path/to/traefik.log" --log.filePath="/path/to/traefik.log"
@ -644,11 +775,11 @@ There is no more log configuration at the root level.
## Tracing ## Tracing
Traefik v2 retains OpenTracing support. The `backend` root option from the v1 is gone, you just have to set your [tracing configuration](../observability/tracing/overview.md). Traefik v2 retains OpenTracing support. The `backend` root option from the v1 is gone, you just have to set your [tracing configuration](../observability/tracing/overview.md).
!!! example "Simple Jaeger tracing configuration" !!! example "Simple Jaeger tracing configuration"
!!! info "v1" !!! info "v1"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
[tracing] [tracing]
@ -660,18 +791,18 @@ Traefik v2 retains OpenTracing support. The `backend` root option from the v1 is
samplingType = "const" samplingType = "const"
localAgentHostPort = "12.0.0.1:6831" localAgentHostPort = "12.0.0.1:6831"
``` ```
```bash tab="CLI" ```bash tab="CLI"
--tracing.backend="jaeger" --tracing.backend="jaeger"
--tracing.servicename="tracing" --tracing.servicename="tracing"
--tracing.jaeger.localagenthostport="12.0.0.1:6831" --tracing.jaeger.localagenthostport="12.0.0.1:6831"
--tracing.jaeger.samplingparam="1.0" --tracing.jaeger.samplingparam="1.0"
--tracing.jaeger.samplingserverurl="http://12.0.0.1:5778/sampling" --tracing.jaeger.samplingserverurl="http://12.0.0.1:5778/sampling"
--tracing.jaeger.samplingtype="const" --tracing.jaeger.samplingtype="const"
``` ```
!!! info "v2" !!! info "v2"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
[tracing] [tracing]
@ -682,7 +813,7 @@ Traefik v2 retains OpenTracing support. The `backend` root option from the v1 is
samplingType = "const" samplingType = "const"
localAgentHostPort = "12.0.0.1:6831" localAgentHostPort = "12.0.0.1:6831"
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
# static configuration # static configuration
tracing: tracing:
@ -692,8 +823,8 @@ Traefik v2 retains OpenTracing support. The `backend` root option from the v1 is
samplingServerURL: 'http://12.0.0.1:5778/sampling' samplingServerURL: 'http://12.0.0.1:5778/sampling'
samplingType: const samplingType: const
localAgentHostPort: '12.0.0.1:6831' localAgentHostPort: '12.0.0.1:6831'
``` ```
```bash tab="CLI" ```bash tab="CLI"
--tracing.servicename="tracing" --tracing.servicename="tracing"
--tracing.jaeger.localagenthostport="12.0.0.1:6831" --tracing.jaeger.localagenthostport="12.0.0.1:6831"
@ -705,33 +836,33 @@ Traefik v2 retains OpenTracing support. The `backend` root option from the v1 is
## Metrics ## Metrics
The v2 retains metrics tools and allows metrics to be configured for the entrypoints and/or services. The v2 retains metrics tools and allows metrics to be configured for the entrypoints and/or services.
For a basic configuration, the [metrics configuration](../observability/metrics/overview.md) remains the same. For a basic configuration, the [metrics configuration](../observability/metrics/overview.md) remains the same.
!!! example "Simple Prometheus metrics configuration" !!! example "Simple Prometheus metrics configuration"
!!! info "v1" !!! info "v1"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
[metrics.prometheus] [metrics.prometheus]
buckets = [0.1,0.3,1.2,5.0] buckets = [0.1,0.3,1.2,5.0]
entryPoint = "traefik" entryPoint = "traefik"
``` ```
```bash tab="CLI" ```bash tab="CLI"
--metrics.prometheus.buckets=[0.1,0.3,1.2,5.0] --metrics.prometheus.buckets=[0.1,0.3,1.2,5.0]
--metrics.prometheus.entrypoint="traefik" --metrics.prometheus.entrypoint="traefik"
``` ```
!!! info "v2" !!! info "v2"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
[metrics.prometheus] [metrics.prometheus]
buckets = [0.1,0.3,1.2,5.0] buckets = [0.1,0.3,1.2,5.0]
entryPoint = "metrics" entryPoint = "metrics"
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
# static configuration # static configuration
metrics: metrics:
@ -742,22 +873,22 @@ For a basic configuration, the [metrics configuration](../observability/metrics/
- 1.2 - 1.2
- 5 - 5
entryPoint: metrics entryPoint: metrics
``` ```
```bash tab="CLI" ```bash tab="CLI"
--metrics.prometheus.buckets=[0.1,0.3,1.2,5.0] --metrics.prometheus.buckets=[0.1,0.3,1.2,5.0]
--metrics.prometheus.entrypoint="metrics" --metrics.prometheus.entrypoint="metrics"
``` ```
## No more root level key/values ## No More Root Level Key/Values
To avoid any source of confusion, there are no more configuration at the root level. To avoid any source of confusion, there are no more configuration at the root level.
Each root item has been moved to a related section or removed. Each root item has been moved to a related section or removed.
!!! example "From root to dedicated section" !!! example "From root to dedicated section"
!!! info "v1" !!! info "v1"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
checkNewVersion = false checkNewVersion = false
@ -772,7 +903,7 @@ Each root item has been moved to a related section or removed.
defaultEntryPoints = ["web", "web-secure"] defaultEntryPoints = ["web", "web-secure"]
keepTrailingSlash = false keepTrailingSlash = false
``` ```
```bash tab="CLI" ```bash tab="CLI"
--checknewversion=false --checknewversion=false
--sendanonymoususage=true --sendanonymoususage=true
@ -786,9 +917,9 @@ Each root item has been moved to a related section or removed.
--defaultentrypoints="web","web-secure" --defaultentrypoints="web","web-secure"
--keeptrailingslash=true --keeptrailingslash=true
``` ```
!!! info "v2" !!! info "v2"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
# static configuration # static configuration
[global] [global]
@ -804,9 +935,9 @@ Each root item has been moved to a related section or removed.
maxIdleConnsPerHost = 42 maxIdleConnsPerHost = 42
[providers] [providers]
providersThrottleDuration = 42 providersThrottleDuration = 42
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
# static configuration # static configuration
global: global:
@ -824,8 +955,8 @@ Each root item has been moved to a related section or removed.
providers: providers:
providersThrottleDuration: 42 providersThrottleDuration: 42
``` ```
```bash tab="CLI" ```bash tab="CLI"
--global.checknewversion=true --global.checknewversion=true
--global.sendanonymoususage=true --global.sendanonymoususage=true
@ -835,7 +966,7 @@ Each root item has been moved to a related section or removed.
--serverstransport.maxidleconnsperhost=42 --serverstransport.maxidleconnsperhost=42
--providers.providersthrottleduration=42 --providers.providersthrottleduration=42
``` ```
## Dashboard ## Dashboard
You need to activate the API to access the [dashboard](../operations/dashboard.md). You need to activate the API to access the [dashboard](../operations/dashboard.md).
@ -847,11 +978,11 @@ As the dashboard access is now secured by default you can either:
!!! info "Dashboard with k8s and dedicated router" !!! info "Dashboard with k8s and dedicated router"
As `api@internal` is not a Kubernetes service, you have to use the file provider or the `insecure` API option. As `api@internal` is not a Kubernetes service, you have to use the file provider or the `insecure` API option.
!!! example "Activate and access the dashboard" !!! example "Activate and access the dashboard"
!!! info "v1" !!! info "v1"
```toml tab="File (TOML)" ```toml tab="File (TOML)"
## static configuration ## static configuration
# traefik.toml # traefik.toml
@ -868,14 +999,14 @@ As the dashboard access is now secured by default you can either:
[api] [api]
entryPoint = "web-secure" entryPoint = "web-secure"
``` ```
```bash tab="CLI" ```bash tab="CLI"
--entryPoints='Name:web-secure Address::443 TLS Auth.Basic.Users:test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/' --entryPoints='Name:web-secure Address::443 TLS Auth.Basic.Users:test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/'
--api --api
``` ```
!!! info "v2" !!! info "v2"
```yaml tab="Docker" ```yaml tab="Docker"
# dynamic configuration # dynamic configuration
labels: labels:
@ -916,7 +1047,7 @@ As the dashboard access is now secured by default you can either:
"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/" "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
] ]
``` ```
```yaml tab="File (YAML)" ```yaml tab="File (YAML)"
## static configuration ## static configuration
# traefik.yaml # traefik.yaml
@ -952,8 +1083,8 @@ As the dashboard access is now secured by default you can either:
basicAuth: basicAuth:
users: users:
- 'test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/' - 'test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/'
``` ```
## Providers ## Providers
Supported [providers](../providers/overview.md), for now: Supported [providers](../providers/overview.md), for now:
@ -976,7 +1107,7 @@ Supported [providers](../providers/overview.md), for now:
* [x] Rest * [x] Rest
* [ ] Zookeeper * [ ] Zookeeper
## Some Tips You Should Known ## Some Tips You Should Know
* Different sources of static configuration (file, CLI flags, ...) cannot be [mixed](../getting-started/configuration-overview.md#the-static-configuration). * Different sources of static configuration (file, CLI flags, ...) cannot be [mixed](../getting-started/configuration-overview.md#the-static-configuration).
* Now, configuration elements can be referenced between different providers by using the provider namespace notation: `@<provider>`. * Now, configuration elements can be referenced between different providers by using the provider namespace notation: `@<provider>`.