mirror of
https://github.com/containous/traefik.git
synced 2025-10-14 15:33:19 +03:00
Compare commits
214 Commits
v2.9.2
...
v3.0.0-bet
Author | SHA1 | Date | |
---|---|---|---|
|
52d2d959af | ||
|
0a35fa096a | ||
|
a7ef965412 | ||
|
0a861716d4 | ||
|
4fbe9b81ec | ||
|
5fd6913ee5 | ||
|
7741c68eaa | ||
|
18077ff69a | ||
|
fa555d0d29 | ||
|
0e5898b2f8 | ||
|
aae76408e2 | ||
|
9cc9ed6a0c | ||
|
fecaec7a4a | ||
|
e62fe64ec9 | ||
|
6885e410f0 | ||
|
68ed875966 | ||
|
d1bdeb3a92 | ||
|
878e7de56a | ||
|
27353d0740 | ||
|
606281a4a5 | ||
|
c5f23493ab | ||
|
db515195f0 | ||
|
9aa57f362b | ||
|
6977b68b72 | ||
|
8d8717d421 | ||
|
981ad74870 | ||
|
021f37ff71 | ||
|
511762cbf3 | ||
|
466d7461b7 | ||
|
1522afe2ec | ||
|
9c73c4c584 | ||
|
8f206ce319 | ||
|
65c59c9a09 | ||
|
e044e2b765 | ||
|
7805c683e3 | ||
|
e38c0c3969 | ||
|
2cebd0a083 | ||
|
c0e03ae17d | ||
|
9060522414 | ||
|
bb4eb32b1c | ||
|
30f991effa | ||
|
fc071a5ebe | ||
|
6082b22922 | ||
|
5635687a3e | ||
|
a3f1009170 | ||
|
79c5f34156 | ||
|
928db9bc42 | ||
|
c4bea197ab | ||
|
e8878fe6ac | ||
|
f344239bef | ||
|
4ed3964b35 | ||
|
11966c2098 | ||
|
0d1bb72306 | ||
|
4c9765b52d | ||
|
5f514b0d16 | ||
|
01f346f239 | ||
|
be1b1a6489 | ||
|
ae65d5ff78 | ||
|
7fc07c31a0 | ||
|
f2eda3aa6d | ||
|
ac9d88e5a2 | ||
|
598caf6f78 | ||
|
77509b0913 | ||
|
8b47c5adf7 | ||
|
a3bcf0f39e | ||
|
be702c2b61 | ||
|
54f6144ef2 | ||
|
a020ab640d | ||
|
7875826bd9 | ||
|
f7be1e97df | ||
|
48a2c8e41c | ||
|
358f47443e | ||
|
3b9e155807 | ||
|
2083e4bc16 | ||
|
c823879097 | ||
|
4bc2305ed3 | ||
|
99d779a546 | ||
|
6e460cd652 | ||
|
7c2af10bbd | ||
|
7af9d16208 | ||
|
598a257ae1 | ||
|
b3f162a8a6 | ||
|
4aa3496092 | ||
|
bbe6a5c07b | ||
|
20e47d9102 | ||
|
21c455cf20 | ||
|
667b2a4078 | ||
|
4ae07d91a4 | ||
|
7bdf13ebdc | ||
|
807feef176 | ||
|
7202038649 | ||
|
dd710dbeb7 | ||
|
f26e250648 | ||
|
80790cba17 | ||
|
2e6e5cbd03 | ||
|
241fb5093a | ||
|
ab36ea7844 | ||
|
cfef9d9df2 | ||
|
9ce69fbdef | ||
|
1a6dfe1f6b | ||
|
e053eb6f17 | ||
|
780936eff9 | ||
|
0503253cfe | ||
|
39331e41a8 | ||
|
044dc6a221 | ||
|
38f5024ed0 | ||
|
479878503d | ||
|
6f6c1f7fec | ||
|
e50bf21a84 | ||
|
d66875f903 | ||
|
707f84e2e4 | ||
|
f94298e867 | ||
|
b995a11d63 | ||
|
e1abf103c0 | ||
|
f01a668d53 | ||
|
8cd4923e72 | ||
|
cd90b9761a | ||
|
e82976e001 | ||
|
f0f5f41fb9 | ||
|
c9e9e8dee2 | ||
|
0861c47e54 | ||
|
8bf68b7efd | ||
|
e1e86763e3 | ||
|
b22aef7fff | ||
|
b9a175f5c2 | ||
|
a2016a2953 | ||
|
c38d405cfd | ||
|
8c98234c07 | ||
|
d046af2e91 | ||
|
943238faba | ||
|
2b67f1f66f | ||
|
943811fad6 | ||
|
2ad1fd725a | ||
|
7129f03dc9 | ||
|
29b8b6911e | ||
|
e7baf44a2e | ||
|
74ef79ea23 | ||
|
748254b6c5 | ||
|
a08a428787 | ||
|
3eeea2bb2b | ||
|
da93dab828 | ||
|
c2dac39da1 | ||
|
e54ee89330 | ||
|
fdd3f2abef | ||
|
517917cd7c | ||
|
d97d3a6726 | ||
|
6c75052a13 | ||
|
a8df674dcf | ||
|
abd569701f | ||
|
7e3fe48b80 | ||
|
8cf9385938 | ||
|
519ed8bde5 | ||
|
46a61ce9c8 | ||
|
778188ed34 | ||
|
88603810a8 | ||
|
c7647b4938 | ||
|
af71443b61 | ||
|
c57876c116 | ||
|
0d81fac3fc | ||
|
db287c4d31 | ||
|
4d86668af3 | ||
|
b93141992e | ||
|
18d66d7432 | ||
|
a3e4c85ec0 | ||
|
bee86b5ac7 | ||
|
0ba51d62fa | ||
|
268d1edc8f | ||
|
580e7fa774 | ||
|
7c72780820 | ||
|
46c266661c | ||
|
61325d7b91 | ||
|
68e8eb2435 | ||
|
3f8aa13e68 | ||
|
08279047ae | ||
|
3dd4968c41 | ||
|
ba1ca68977 | ||
|
81a5b1b4c8 | ||
|
52e6ce95cf | ||
|
d547718fdd | ||
|
56f7515ecd | ||
|
af4e74c39d | ||
|
27c02b5a56 | ||
|
f6b7940b76 | ||
|
f1b91a119d | ||
|
630de7481e | ||
|
fadee5e87b | ||
|
35d8281f4d | ||
|
67d9c8da0b | ||
|
00de5c711a | ||
|
b935c80dbd | ||
|
22c6630412 | ||
|
1a1cfd1adc | ||
|
240fb871b6 | ||
|
b2c4221429 | ||
|
d131ef57da | ||
|
97de552e06 | ||
|
281fa25844 | ||
|
454f552691 | ||
|
7258048403 | ||
|
bd3eaf4f5e | ||
|
7a6bfd3336 | ||
|
1b9873cae9 | ||
|
e86f21ae7b | ||
|
194247caae | ||
|
cd0654026a | ||
|
b39ce8cc58 | ||
|
33f0aed5ea | ||
|
188ef84c4f | ||
|
a5c520664a | ||
|
38d7011487 | ||
|
033fccccc7 | ||
|
df99a9fb57 | ||
|
d6b69e1347 | ||
|
4bd055cf97 |
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -2,16 +2,16 @@
|
|||||||
PLEASE READ THIS MESSAGE.
|
PLEASE READ THIS MESSAGE.
|
||||||
|
|
||||||
Documentation fixes or enhancements:
|
Documentation fixes or enhancements:
|
||||||
- for Traefik v1: use branch v1.7
|
- for Traefik v2: use branch v2.10
|
||||||
- for Traefik v2: use branch v2.9
|
- for Traefik v3: use branch v3.0
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
- for Traefik v1: use branch v1.7
|
- for Traefik v2: use branch v2.10
|
||||||
- for Traefik v2: use branch v2.9
|
- for Traefik v3: use branch v3.0
|
||||||
|
|
||||||
Enhancements:
|
Enhancements:
|
||||||
- for Traefik v1: we only accept bug fixes
|
- for Traefik v2: we only accept bug fixes
|
||||||
- for Traefik v2: use branch master
|
- for Traefik v3: use branch master
|
||||||
|
|
||||||
HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
|
HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
|
||||||
|
|
||||||
|
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: 1.19
|
GO_VERSION: '1.20'
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
IN_DOCKER: ""
|
IN_DOCKER: ""
|
||||||
|
|
||||||
|
4
.github/workflows/check_doc.yml
vendored
4
.github/workflows/check_doc.yml
vendored
@@ -19,3 +19,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check documentation
|
- name: Check documentation
|
||||||
run: make docs-pull-images docs
|
run: make docs-pull-images docs
|
||||||
|
env:
|
||||||
|
# These variables are not passed to workflows that are triggered by a pull request from a fork.
|
||||||
|
DOCS_VERIFY_SKIP: ${{ vars.DOCS_VERIFY_SKIP }}
|
||||||
|
DOCS_LINT_SKIP: ${{ vars.DOCS_LINT_SKIP }}
|
||||||
|
6
.github/workflows/documentation.yml
vendored
6
.github/workflows/documentation.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
- v*
|
- v*
|
||||||
|
|
||||||
env:
|
env:
|
||||||
STRUCTOR_VERSION: v1.11.2
|
STRUCTOR_VERSION: v1.13.2
|
||||||
MIXTUS_VERSION: v0.4.1
|
MIXTUS_VERSION: v0.4.1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -41,12 +41,12 @@ jobs:
|
|||||||
- name: Build documentation
|
- name: Build documentation
|
||||||
run: $HOME/bin/structor -o traefik -r traefik --dockerfile-url="https://raw.githubusercontent.com/traefik/traefik/v1.7/docs.Dockerfile" --menu.js-url="https://raw.githubusercontent.com/traefik/structor/master/traefik-menu.js.gotmpl" --rqts-url="https://raw.githubusercontent.com/traefik/structor/master/requirements-override.txt" --force-edit-url --exp-branch=master --debug
|
run: $HOME/bin/structor -o traefik -r traefik --dockerfile-url="https://raw.githubusercontent.com/traefik/traefik/v1.7/docs.Dockerfile" --menu.js-url="https://raw.githubusercontent.com/traefik/structor/master/traefik-menu.js.gotmpl" --rqts-url="https://raw.githubusercontent.com/traefik/structor/master/requirements-override.txt" --force-edit-url --exp-branch=master --debug
|
||||||
env:
|
env:
|
||||||
STRUCTOR_LATEST_TAG: ${{ secrets.STRUCTOR_LATEST_TAG }}
|
STRUCTOR_LATEST_TAG: ${{ vars.STRUCTOR_LATEST_TAG }}
|
||||||
|
|
||||||
- name: Apply seo
|
- name: Apply seo
|
||||||
run: $HOME/bin/seo -path=./site -product=traefik
|
run: $HOME/bin/seo -path=./site -product=traefik
|
||||||
|
|
||||||
- name: Publish documentation
|
- name: Publish documentation
|
||||||
run: $HOME/bin/mixtus --dst-doc-path="./traefik" --dst-owner=traefik --dst-repo-name=doc --git-user-email="30906710+traefiker@users.noreply.github.com" --git-user-name=traefiker --src-doc-path="./site" --src-owner=containous --src-repo-name=traefik
|
run: $HOME/bin/mixtus --dst-doc-path="./traefik" --dst-owner=traefik --dst-repo-name=doc --git-user-email="30906710+traefiker@users.noreply.github.com" --git-user-name=traefiker --src-doc-path="./site" --src-owner=traefik --src-repo-name=traefik
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }}
|
||||||
|
2
.github/workflows/test-unit.yaml
vendored
2
.github/workflows/test-unit.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: 1.19
|
GO_VERSION: '1.20'
|
||||||
IN_DOCKER: ""
|
IN_DOCKER: ""
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
4
.github/workflows/validate.yaml
vendored
4
.github/workflows/validate.yaml
vendored
@@ -6,8 +6,8 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: 1.19
|
GO_VERSION: '1.20'
|
||||||
GOLANGCI_LINT_VERSION: v1.50.0
|
GOLANGCI_LINT_VERSION: v1.53.1
|
||||||
MISSSPELL_VERSION: v0.4.0
|
MISSSPELL_VERSION: v0.4.0
|
||||||
IN_DOCKER: ""
|
IN_DOCKER: ""
|
||||||
|
|
||||||
|
171
.golangci.yml
171
.golangci.yml
@@ -6,9 +6,10 @@ run:
|
|||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
govet:
|
govet:
|
||||||
check-shadowing: false
|
enable-all: true
|
||||||
golint:
|
disable:
|
||||||
min-confidence: 0
|
- shadow
|
||||||
|
- fieldalignment
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 14
|
min-complexity: 14
|
||||||
goconst:
|
goconst:
|
||||||
@@ -25,48 +26,123 @@ linters-settings:
|
|||||||
- ^spew\.Print(f|ln)?$
|
- ^spew\.Print(f|ln)?$
|
||||||
- ^spew\.Dump$
|
- ^spew\.Dump$
|
||||||
depguard:
|
depguard:
|
||||||
list-type: denylist
|
rules:
|
||||||
include-go-root: false
|
main:
|
||||||
packages:
|
deny:
|
||||||
- github.com/pkg/errors
|
- pkg: "github.com/instana/testify"
|
||||||
|
desc: not allowed
|
||||||
|
- pkg: "github.com/pkg/errors"
|
||||||
|
desc: Should be replaced by standard lib errors package
|
||||||
|
- pkg: "k8s.io/api/networking/v1beta1"
|
||||||
|
desc: This API is deprecated
|
||||||
|
- pkg: "k8s.io/api/extensions/v1beta1"
|
||||||
|
desc: This API is deprecated
|
||||||
godox:
|
godox:
|
||||||
keywords:
|
keywords:
|
||||||
- FIXME
|
- FIXME
|
||||||
importas:
|
importas:
|
||||||
corev1: k8s.io/api/core/v1
|
no-unaliased: true
|
||||||
networkingv1beta1: k8s.io/api/networking/v1beta1
|
alias:
|
||||||
extensionsv1beta1: k8s.io/api/extensions/v1beta1
|
- alias: composeapi
|
||||||
metav1: k8s.io/apimachinery/pkg/apis/meta/v1
|
pkg: github.com/docker/compose/v2/pkg/api
|
||||||
kubeerror: k8s.io/apimachinery/pkg/api/errors
|
|
||||||
composeapi: github.com/docker/compose/v2/pkg/api
|
# Standard Kubernetes rewrites:
|
||||||
|
- alias: corev1
|
||||||
|
pkg: "k8s.io/api/core/v1"
|
||||||
|
- alias: netv1
|
||||||
|
pkg: "k8s.io/api/networking/v1"
|
||||||
|
- alias: admv1
|
||||||
|
pkg: "k8s.io/api/admission/v1"
|
||||||
|
- alias: admv1beta1
|
||||||
|
pkg: "k8s.io/api/admission/v1beta1"
|
||||||
|
- alias: metav1
|
||||||
|
pkg: "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
- alias: ktypes
|
||||||
|
pkg: "k8s.io/apimachinery/pkg/types"
|
||||||
|
- alias: kerror
|
||||||
|
pkg: "k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
- alias: kclientset
|
||||||
|
pkg: "k8s.io/client-go/kubernetes"
|
||||||
|
- alias: kinformers
|
||||||
|
pkg: "k8s.io/client-go/informers"
|
||||||
|
- alias: ktesting
|
||||||
|
pkg: "k8s.io/client-go/testing"
|
||||||
|
- alias: kschema
|
||||||
|
pkg: "k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
- alias: kscheme
|
||||||
|
pkg: "k8s.io/client-go/kubernetes/scheme"
|
||||||
|
- alias: kversion
|
||||||
|
pkg: "k8s.io/apimachinery/pkg/version"
|
||||||
|
- alias: kubefake
|
||||||
|
pkg: "k8s.io/client-go/kubernetes/fake"
|
||||||
|
- alias: discoveryfake
|
||||||
|
pkg: "k8s.io/client-go/discovery/fake"
|
||||||
|
|
||||||
|
# Kubernetes Gateway rewrites:
|
||||||
|
- alias: gateclientset
|
||||||
|
pkg: "sigs.k8s.io/gateway-api/pkg/client/clientset/gateway/versioned"
|
||||||
|
- alias: gateinformers
|
||||||
|
pkg: "sigs.k8s.io/gateway-api/pkg/client/informers/gateway/externalversions"
|
||||||
|
- alias: gatev1alpha2
|
||||||
|
pkg: "sigs.k8s.io/gateway-api/apis/v1alpha2"
|
||||||
|
|
||||||
|
# Traefik Kubernetes rewrites:
|
||||||
|
- alias: containousv1alpha1
|
||||||
|
pkg: "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikcontainous/v1alpha1"
|
||||||
|
- alias: traefikv1alpha1
|
||||||
|
pkg: "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
|
||||||
|
- alias: traefikclientset
|
||||||
|
pkg: "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned"
|
||||||
|
- alias: traefikinformers
|
||||||
|
pkg: "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/informers/externalversions"
|
||||||
|
- alias: traefikscheme
|
||||||
|
pkg: "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned/scheme"
|
||||||
|
- alias: traefikcrdfake
|
||||||
|
pkg: "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned/fake"
|
||||||
|
tagalign:
|
||||||
|
align: false
|
||||||
|
sort: true
|
||||||
|
order:
|
||||||
|
- description
|
||||||
|
- json
|
||||||
|
- toml
|
||||||
|
- yaml
|
||||||
|
- yml
|
||||||
|
- label
|
||||||
|
- label-slice-as-struct
|
||||||
|
- file
|
||||||
|
- kv
|
||||||
|
- export
|
||||||
revive:
|
revive:
|
||||||
rules:
|
rules:
|
||||||
- name: struct-tag
|
- name: struct-tag
|
||||||
rules:
|
- name: blank-imports
|
||||||
- name: blank-imports
|
- name: context-as-argument
|
||||||
- name: context-as-argument
|
- name: context-keys-type
|
||||||
- name: context-keys-type
|
- name: dot-imports
|
||||||
- name: dot-imports
|
- name: error-return
|
||||||
- name: error-return
|
- name: error-strings
|
||||||
- name: error-strings
|
- name: error-naming
|
||||||
- name: error-naming
|
- name: exported
|
||||||
- name: exported
|
disabled: true
|
||||||
- name: if-return
|
- name: if-return
|
||||||
- name: increment-decrement
|
- name: increment-decrement
|
||||||
- name: var-naming
|
- name: var-naming
|
||||||
- name: var-declaration
|
- name: var-declaration
|
||||||
- name: package-comments
|
- name: package-comments
|
||||||
- name: range
|
disabled: true
|
||||||
- name: receiver-naming
|
- name: range
|
||||||
- name: time-naming
|
- name: receiver-naming
|
||||||
- name: unexported-return
|
- name: time-naming
|
||||||
- name: indent-error-flow
|
- name: unexported-return
|
||||||
- name: errorf
|
- name: indent-error-flow
|
||||||
- name: empty-block
|
- name: errorf
|
||||||
- name: superfluous-else
|
- name: empty-block
|
||||||
- name: unused-parameter
|
- name: superfluous-else
|
||||||
- name: unreachable-code
|
- name: unused-parameter
|
||||||
- name: redefines-builtin-id
|
disabled: true
|
||||||
|
- name: unreachable-code
|
||||||
|
- name: redefines-builtin-id
|
||||||
gomoddirectives:
|
gomoddirectives:
|
||||||
replace-allow-list:
|
replace-allow-list:
|
||||||
- github.com/abbot/go-http-auth
|
- github.com/abbot/go-http-auth
|
||||||
@@ -126,6 +202,7 @@ linters:
|
|||||||
- containedctx # too many false-positive
|
- containedctx # too many false-positive
|
||||||
- maintidx # kind of duplicate of gocyclo
|
- maintidx # kind of duplicate of gocyclo
|
||||||
- nonamedreturns # Too strict
|
- nonamedreturns # Too strict
|
||||||
|
- gosmopolitan # not relevant
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
exclude-use-default: false
|
exclude-use-default: false
|
||||||
@@ -134,14 +211,6 @@ issues:
|
|||||||
exclude:
|
exclude:
|
||||||
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked'
|
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked'
|
||||||
- "should have a package comment, unless it's in another file for this package"
|
- "should have a package comment, unless it's in another file for this package"
|
||||||
- 'SA1019: http.CloseNotifier has been deprecated' # FIXME must be fixed
|
|
||||||
- 'SA1019: cfg.SSLRedirect is deprecated'
|
|
||||||
- 'SA1019: cfg.SSLTemporaryRedirect is deprecated'
|
|
||||||
- 'SA1019: cfg.SSLHost is deprecated'
|
|
||||||
- 'SA1019: cfg.SSLForceHost is deprecated'
|
|
||||||
- 'SA1019: cfg.FeaturePolicy is deprecated'
|
|
||||||
- 'SA1019: c.Providers.ConsulCatalog.Namespace is deprecated'
|
|
||||||
- 'SA1019: c.Providers.Consul.Namespace is deprecated'
|
|
||||||
exclude-rules:
|
exclude-rules:
|
||||||
- path: '(.+)_test.go'
|
- path: '(.+)_test.go'
|
||||||
linters:
|
linters:
|
||||||
@@ -162,7 +231,7 @@ issues:
|
|||||||
text: "Function 'buildConstructor' has too many statements"
|
text: "Function 'buildConstructor' has too many statements"
|
||||||
linters:
|
linters:
|
||||||
- funlen
|
- funlen
|
||||||
- path: pkg/tracing/haystack/logger.go
|
- path: pkg/logs/haystack.go
|
||||||
linters:
|
linters:
|
||||||
- goprintffuncname
|
- goprintffuncname
|
||||||
- path: pkg/tracing/tracing.go
|
- path: pkg/tracing/tracing.go
|
||||||
@@ -187,3 +256,11 @@ issues:
|
|||||||
text: 'Duplicate words \(sub\) found'
|
text: 'Duplicate words \(sub\) found'
|
||||||
linters:
|
linters:
|
||||||
- dupword
|
- dupword
|
||||||
|
- path: pkg/provider/kubernetes/crd/kubernetes.go
|
||||||
|
text: "Function 'loadConfigurationFromCRD' has too many statements"
|
||||||
|
linters:
|
||||||
|
- funlen
|
||||||
|
- path: pkg/provider/kubernetes/gateway/client_mock_test.go
|
||||||
|
text: 'unusedwrite: unused write to field'
|
||||||
|
linters:
|
||||||
|
- govet
|
||||||
|
@@ -11,7 +11,7 @@ builds:
|
|||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X github.com/traefik/traefik/v2/pkg/version.Version={{.Version}} -X github.com/traefik/traefik/v2/pkg/version.Codename={{.Env.CODENAME}} -X github.com/traefik/traefik/v2/pkg/version.BuildDate={{.Date}}
|
- -s -w -X github.com/traefik/traefik/v3/pkg/version.Version={{.Version}} -X github.com/traefik/traefik/v3/pkg/version.Codename={{.Env.CODENAME}} -X github.com/traefik/traefik/v3/pkg/version.BuildDate={{.Date}}
|
||||||
flags:
|
flags:
|
||||||
- -trimpath
|
- -trimpath
|
||||||
goos:
|
goos:
|
||||||
@@ -22,22 +22,23 @@ builds:
|
|||||||
- openbsd
|
- openbsd
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
- 386
|
- '386'
|
||||||
- arm
|
- arm
|
||||||
- arm64
|
- arm64
|
||||||
- ppc64le
|
- ppc64le
|
||||||
- s390x
|
- s390x
|
||||||
goarm:
|
goarm:
|
||||||
- 7
|
- '7'
|
||||||
- 6
|
- '6'
|
||||||
- 5
|
|
||||||
ignore:
|
ignore:
|
||||||
- goos: darwin
|
- goos: darwin
|
||||||
goarch: 386
|
goarch: '386'
|
||||||
- goos: openbsd
|
- goos: openbsd
|
||||||
goarch: arm
|
goarch: arm
|
||||||
- goos: openbsd
|
- goos: openbsd
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
|
- goos: freebsd
|
||||||
|
goarch: arm
|
||||||
- goos: freebsd
|
- goos: freebsd
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
- goos: windows
|
- goos: windows
|
||||||
|
@@ -3,7 +3,7 @@ name: Traefik
|
|||||||
agent:
|
agent:
|
||||||
machine:
|
machine:
|
||||||
type: e1-standard-4
|
type: e1-standard-4
|
||||||
os_image: ubuntu1804
|
os_image: ubuntu2004
|
||||||
|
|
||||||
fail_fast:
|
fail_fast:
|
||||||
stop:
|
stop:
|
||||||
@@ -19,13 +19,13 @@ global_job_config:
|
|||||||
prologue:
|
prologue:
|
||||||
commands:
|
commands:
|
||||||
- curl -sSfL https://raw.githubusercontent.com/ldez/semgo/master/godownloader.sh | sudo sh -s -- -b "/usr/local/bin"
|
- curl -sSfL https://raw.githubusercontent.com/ldez/semgo/master/godownloader.sh | sudo sh -s -- -b "/usr/local/bin"
|
||||||
- sudo semgo go1.19
|
- sudo semgo go1.20
|
||||||
- export "GOPATH=$(go env GOPATH)"
|
- export "GOPATH=$(go env GOPATH)"
|
||||||
- export "SEMAPHORE_GIT_DIR=${GOPATH}/src/github.com/traefik/${SEMAPHORE_PROJECT_NAME}"
|
- export "SEMAPHORE_GIT_DIR=${GOPATH}/src/github.com/traefik/${SEMAPHORE_PROJECT_NAME}"
|
||||||
- export "PATH=${GOPATH}/bin:${PATH}"
|
- export "PATH=${GOPATH}/bin:${PATH}"
|
||||||
- mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin"
|
- mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin"
|
||||||
- export GOPROXY=https://proxy.golang.org,direct
|
- export GOPROXY=https://proxy.golang.org,direct
|
||||||
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.50.0
|
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.52.2
|
||||||
- curl -sSfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | bash -s -- -b "${GOPATH}/bin"
|
- curl -sSfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | bash -s -- -b "${GOPATH}/bin"
|
||||||
- checkout
|
- checkout
|
||||||
- cache restore traefik-$(checksum go.sum)
|
- cache restore traefik-$(checksum go.sum)
|
||||||
@@ -57,14 +57,14 @@ blocks:
|
|||||||
agent:
|
agent:
|
||||||
machine:
|
machine:
|
||||||
type: e1-standard-8
|
type: e1-standard-8
|
||||||
os_image: ubuntu1804
|
os_image: ubuntu2004
|
||||||
secrets:
|
secrets:
|
||||||
- name: traefik
|
- name: traefik
|
||||||
env_vars:
|
env_vars:
|
||||||
- name: GH_VERSION
|
- name: GH_VERSION
|
||||||
value: 1.12.1
|
value: 1.12.1
|
||||||
- name: CODENAME
|
- name: CODENAME
|
||||||
value: "banon"
|
value: "beaufort"
|
||||||
- name: IN_DOCKER
|
- name: IN_DOCKER
|
||||||
value: ""
|
value: ""
|
||||||
prologue:
|
prologue:
|
||||||
@@ -73,7 +73,7 @@ blocks:
|
|||||||
- curl -sSL -o /tmp/gh_${GH_VERSION}_linux_amd64.tar.gz https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz
|
- curl -sSL -o /tmp/gh_${GH_VERSION}_linux_amd64.tar.gz https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz
|
||||||
- tar -zxvf /tmp/gh_${GH_VERSION}_linux_amd64.tar.gz -C /tmp
|
- tar -zxvf /tmp/gh_${GH_VERSION}_linux_amd64.tar.gz -C /tmp
|
||||||
- sudo mv /tmp/gh_${GH_VERSION}_linux_amd64/bin/gh /usr/local/bin/gh
|
- sudo mv /tmp/gh_${GH_VERSION}_linux_amd64/bin/gh /usr/local/bin/gh
|
||||||
- sudo rm -rf ~/.phpbrew ~/.kerl ~/.sbt ~/.nvm ~/.npm ~/.kiex /usr/lib/jvm /opt/az /opt/firefox # Remove unnecessary data.
|
- sudo rm -rf ~/.phpbrew ~/.kerl ~/.sbt ~/.nvm ~/.npm ~/.kiex /usr/lib/jvm /opt/az /opt/firefox /usr/lib/google-cloud-sdk ~/.rbenv ~/.pip_download_cache # Remove unnecessary data.
|
||||||
- sudo service docker stop && sudo umount /var/lib/docker && sudo service docker start # Unmounts the docker disk and the whole system disk is usable.
|
- sudo service docker stop && sudo umount /var/lib/docker && sudo service docker start # Unmounts the docker disk and the whole system disk is usable.
|
||||||
jobs:
|
jobs:
|
||||||
- name: Release
|
- name: Release
|
||||||
|
318
CHANGELOG.md
318
CHANGELOG.md
@@ -1,5 +1,303 @@
|
|||||||
## [v2.9.2](https://github.com/traefik/traefik/tree/v2.9.2) (2022-10-27)
|
## [v3.0.0-beta3](https://github.com/traefik/traefik/tree/v3.0.0-beta3) (2023-06-21)
|
||||||
[All Commits](https://github.com/traefik/traefik/compare/v2.9.1...v2.9.2)
|
[All Commits](https://github.com/traefik/traefik/compare/v3.0.0-beta2...v3.0.0-beta3)
|
||||||
|
|
||||||
|
**Enhancements:**
|
||||||
|
- **[docker,docker/swarm]** Split Docker provider ([#9652](https://github.com/traefik/traefik/pull/9652) by [ldez](https://github.com/ldez))
|
||||||
|
- **[k8s,hub]** Remove deprecated code ([#9804](https://github.com/traefik/traefik/pull/9804) by [ldez](https://github.com/ldez))
|
||||||
|
- **[k8s,k8s/gatewayapi]** Support HostSNIRegexp in GatewayAPI TLS routes ([#9486](https://github.com/traefik/traefik/pull/9486) by [ddtmachado](https://github.com/ddtmachado))
|
||||||
|
- **[k8s/gatewayapi]** Add support for HTTPRequestRedirectFilter in k8s Gateway API ([#9408](https://github.com/traefik/traefik/pull/9408) by [romantomjak](https://github.com/romantomjak))
|
||||||
|
- **[k8s/ingress,k8s]** Remove support of the networking.k8s.io/v1beta1 APIVersion ([#9949](https://github.com/traefik/traefik/pull/9949) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[k8s/ingress,k8s]** Add option to the Ingress provider to disable IngressClass lookup ([#9281](https://github.com/traefik/traefik/pull/9281) by [jandillenkofer](https://github.com/jandillenkofer))
|
||||||
|
- **[marathon]** Remove Marathon provider ([#9614](https://github.com/traefik/traefik/pull/9614) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[metrics]** Remove InfluxDB v1 metrics middleware ([#9612](https://github.com/traefik/traefik/pull/9612) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[rancher]** Remove Rancher v1 provider ([#9613](https://github.com/traefik/traefik/pull/9613) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[rules]** Remove containous/mux from HTTP muxer ([#9558](https://github.com/traefik/traefik/pull/9558) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[tls,tcp,service]** Add TCP Servers Transports support ([#9465](https://github.com/traefik/traefik/pull/9465) by [sdelicata](https://github.com/sdelicata))
|
||||||
|
- **[webui]** Added router priority to webui's list and detail page ([#9004](https://github.com/traefik/traefik/pull/9004) by [bendre90](https://github.com/bendre90))
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[metrics]** Fix OpenTelemetry metrics ([#9962](https://github.com/traefik/traefik/pull/9962) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[metrics]** Remove config reload failure metrics ([#9660](https://github.com/traefik/traefik/pull/9660) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[metrics]** Fix open connections metric ([#9656](https://github.com/traefik/traefik/pull/9656) by [mpl](https://github.com/mpl))
|
||||||
|
- **[metrics]** Fix OpenTelemetry service name ([#9619](https://github.com/traefik/traefik/pull/9619) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[tcp]** Don't log EOF or timeout errors while peeking first bytes in Postgres StartTLS hook ([#9663](https://github.com/traefik/traefik/pull/9663) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[webui]** Detect dashboard assets content types ([#9622](https://github.com/traefik/traefik/pull/9622) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[webui]** fix: detect dashboard content types ([#9594](https://github.com/traefik/traefik/pull/9594) by [ldez](https://github.com/ldez))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[k8s]** Improve Kubernetes support documentation ([#9974](https://github.com/traefik/traefik/pull/9974) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- Adjust quick start ([#9790](https://github.com/traefik/traefik/pull/9790) by [svx](https://github.com/svx))
|
||||||
|
- Mention PathPrefix matcher changes in V3 Migration Guide ([#9727](https://github.com/traefik/traefik/pull/9727) by [aofei](https://github.com/aofei))
|
||||||
|
- Fix yaml indentation in the HTTP3 example ([#9724](https://github.com/traefik/traefik/pull/9724) by [benwaffle](https://github.com/benwaffle))
|
||||||
|
- Add OpenTelemetry in observability overview ([#9654](https://github.com/traefik/traefik/pull/9654) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
|
||||||
|
**Misc:**
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9977](https://github.com/traefik/traefik/pull/9977) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9931](https://github.com/traefik/traefik/pull/9931) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9896](https://github.com/traefik/traefik/pull/9896) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9867](https://github.com/traefik/traefik/pull/9867) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9850](https://github.com/traefik/traefik/pull/9850) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9845](https://github.com/traefik/traefik/pull/9845) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9803](https://github.com/traefik/traefik/pull/9803) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.10 into v3.0 ([#9793](https://github.com/traefik/traefik/pull/9793) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.9 into v3.0 ([#9722](https://github.com/traefik/traefik/pull/9722) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- Merge branch v2.9 into v3.0 ([#9650](https://github.com/traefik/traefik/pull/9650) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- Merge branch v2.9 into v3.0 ([#9632](https://github.com/traefik/traefik/pull/9632) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
|
||||||
|
## [v2.10.3](https://github.com/traefik/traefik/tree/v2.10.3) (2023-06-17)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.10.2...v2.10.3)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[acme]** Update go-acme/lego to v4.12.2 ([#9935](https://github.com/traefik/traefik/pull/9971) by [ldez](https://github.com/ldez))
|
||||||
|
|
||||||
|
## [v2.10.2](https://github.com/traefik/traefik/tree/v2.10.2) (2023-06-17)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.10.1...v2.10.2)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[acme]** Update go-acme/lego to v4.12.1 ([#9935](https://github.com/traefik/traefik/pull/9935) by [ldez](https://github.com/ldez))
|
||||||
|
- **[acme]** Update go-acme/lego to v4.12.0 ([#9918](https://github.com/traefik/traefik/pull/9918) by [ldez](https://github.com/ldez))
|
||||||
|
- **[acme]** Update go-acme/lego to v4.11.0 ([#9883](https://github.com/traefik/traefik/pull/9883) by [ldez](https://github.com/ldez))
|
||||||
|
- **[acme]** Do not check for wildcard domains for non DNS challenge ([#9881](https://github.com/traefik/traefik/pull/9881) by [erkexzcx](https://github.com/erkexzcx))
|
||||||
|
- **[k8s/crd]** Fix multiple subsets endpoint ([#9914](https://github.com/traefik/traefik/pull/9914) by [joaosilva15](https://github.com/joaosilva15))
|
||||||
|
- **[k8s/ingress,k8s/crd,k8s,hub]** Clean code related to Hub ([#9894](https://github.com/traefik/traefik/pull/9894) by [ldez](https://github.com/ldez))
|
||||||
|
- **[metrics]** Enable Prometheus provider cleanup when only the router's metrics level is activated ([#9887](https://github.com/traefik/traefik/pull/9887) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[middleware]** Encode query semicolons ([#9943](https://github.com/traefik/traefik/pull/9943) by [LandryBe](https://github.com/LandryBe))
|
||||||
|
- **[middleware]** Missing trailer with custom errors middleware ([#9942](https://github.com/traefik/traefik/pull/9942) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[middleware]** Support informational headers in middlewares redefining the response writer. ([#9938](https://github.com/traefik/traefik/pull/9938) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[plugins]** Improve error messages related to plugins ([#9924](https://github.com/traefik/traefik/pull/9924) by [ldez](https://github.com/ldez))
|
||||||
|
- **[tracing]** Update DataDog tracing dependency to v1.50.1 ([#9953](https://github.com/traefik/traefik/pull/9953) by [der-eismann](https://github.com/der-eismann))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[accesslogs]** Fix over-indented yaml configuration of access logs ([#9930](https://github.com/traefik/traefik/pull/9930) by [ufUNnxagpM](https://github.com/ufUNnxagpM))
|
||||||
|
- **[tls]** Add FAQ documentation about TLS certificates ([#9868](https://github.com/traefik/traefik/pull/9868) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- Fix typo ([#9966](https://github.com/traefik/traefik/pull/9966) by [green1052](https://github.com/green1052))
|
||||||
|
- Add business callouts ([#9940](https://github.com/traefik/traefik/pull/9940) by [tomatokoolaid](https://github.com/tomatokoolaid))
|
||||||
|
- Add logo for GitHub dark mode ([#9890](https://github.com/traefik/traefik/pull/9890) by [ldez](https://github.com/ldez))
|
||||||
|
|
||||||
|
## [v2.10.1](https://github.com/traefik/traefik/tree/v2.10.1) (2023-04-27)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.10.0...v2.10.1)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[middleware,oxy]** Update vulcand/oxy to be5cf38 ([#9874](https://github.com/traefik/traefik/pull/9874) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- Fix v2.10 migration guide ([#9863](https://github.com/traefik/traefik/pull/9863) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
|
||||||
|
## [v2.10.0](https://github.com/traefik/traefik/tree/v2.10.0) (2023-04-24)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.0-rc1...v2.10.0)
|
||||||
|
|
||||||
|
**Enhancements:**
|
||||||
|
- **[docker]** Expose ContainerName in Docker provider ([#9770](https://github.com/traefik/traefik/pull/9770) by [quinot](https://github.com/quinot))
|
||||||
|
- **[hub]** Remove hub configuration out of experimental ([#9792](https://github.com/traefik/traefik/pull/9792) by [mpl](https://github.com/mpl))
|
||||||
|
- **[k8s/crd]** Introduce traefik.io API Group CRDs ([#9765](https://github.com/traefik/traefik/pull/9765) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[k8s/ingress,k8s/crd,k8s]** Native Kubernetes service load-balancing ([#9740](https://github.com/traefik/traefik/pull/9740) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[middleware,metrics]** Add prometheus metric requests_total with headers ([#9783](https://github.com/traefik/traefik/pull/9783) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[nomad]** Support multiple namespaces in the Nomad Provider ([#9794](https://github.com/traefik/traefik/pull/9794) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[tracing]** Add support to send DataDog traces via Unix Socket ([#9714](https://github.com/traefik/traefik/pull/9714) by [der-eismann](https://github.com/der-eismann))
|
||||||
|
- **[webui]** Modify the Hub Button ([#9851](https://github.com/traefik/traefik/pull/9851) by [mdeliatf](https://github.com/mdeliatf))
|
||||||
|
- **[webui]** Display period setting of the RateLimit middleware in the webui ([#9822](https://github.com/traefik/traefik/pull/9822) by [smatyas](https://github.com/smatyas))
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[docker]** Only warn about missing docker network when network_mode is not host or container ([#9799](https://github.com/traefik/traefik/pull/9799) by [sentriz](https://github.com/sentriz))
|
||||||
|
- **[k8s/ingress,k8s]** Bump k8s.io/client-go from v0.22.1 to v0.26.3 ([#9808](https://github.com/traefik/traefik/pull/9808) by [ldez](https://github.com/ldez))
|
||||||
|
- **[plugins]** Improve DeepCopy of PluginConf ([#9846](https://github.com/traefik/traefik/pull/9846) by [ldez](https://github.com/ldez))
|
||||||
|
- **[plugins]** Update Yaegi to v0.15.1 ([#9815](https://github.com/traefik/traefik/pull/9815) by [ldez](https://github.com/ldez))
|
||||||
|
- **[server]** Update vulcand/oxy to 03de175b3822 ([#9849](https://github.com/traefik/traefik/pull/9849) by [longit644](https://github.com/longit644))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- Prepare release v2.10.0-rc1 ([#9802](https://github.com/traefik/traefik/pull/9802) by [ldez](https://github.com/ldez))
|
||||||
|
- Fix order of log levels ([#9791](https://github.com/traefik/traefik/pull/9791) by [svx](https://github.com/svx))
|
||||||
|
- **[docker]** Update wording - add link descriptions ([#9816](https://github.com/traefik/traefik/pull/9816) by [svx](https://github.com/svx))
|
||||||
|
- **[middleware]** Add accessControlAllowHeaders example ([#9810](https://github.com/traefik/traefik/pull/9810) by [yingshaoxo](https://github.com/yingshaoxo))
|
||||||
|
- **[tls]** More details on Kubernetes options for mTLS ([#9835](https://github.com/traefik/traefik/pull/9835) by [mloiseleur](https://github.com/mloiseleur))
|
||||||
|
- Prepare release v2.10.0-rc2 ([#9830](https://github.com/traefik/traefik/pull/9830) by [mpl](https://github.com/mpl))
|
||||||
|
- Update Call To Actions ([#9824](https://github.com/traefik/traefik/pull/9824) by [svx](https://github.com/svx))
|
||||||
|
- Improve concepts page ([#9813](https://github.com/traefik/traefik/pull/9813) by [svx](https://github.com/svx))
|
||||||
|
- Update wording ([#9811](https://github.com/traefik/traefik/pull/9811) by [svx](https://github.com/svx))
|
||||||
|
|
||||||
|
**Misc:**
|
||||||
|
- Merge branch v2.9 into v2.10 ([#9798](https://github.com/traefik/traefik/pull/9798) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.9 into v2.10 ([#9829](https://github.com/traefik/traefik/pull/9829) by [mpl](https://github.com/mpl))
|
||||||
|
|
||||||
|
## [v2.10.0-rc2](https://github.com/traefik/traefik/tree/v2.10.0-rc2) (2023-04-07)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.10.0-rc1...v2.10.0-rc2)
|
||||||
|
|
||||||
|
**Enhancements:**
|
||||||
|
- **[webui]** Display period setting of the RateLimit middleware in the webui ([#9822](https://github.com/traefik/traefik/pull/9822) by [smatyas](https://github.com/smatyas))
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[docker]** Only warn about missing docker network when network_mode is not host or container ([#9799](https://github.com/traefik/traefik/pull/9799) by [sentriz](https://github.com/sentriz))
|
||||||
|
- **[k8s/ingress,k8s]** chore: bump k8s.io/client-go from v0.22.1 to v0.26.3 ([#9808](https://github.com/traefik/traefik/pull/9808) by [ldez](https://github.com/ldez))
|
||||||
|
- **[plugins]** Update Yaegi to v0.15.1 ([#9815](https://github.com/traefik/traefik/pull/9815) by [ldez](https://github.com/ldez))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[docker]** Update wording - add link descriptions ([#9816](https://github.com/traefik/traefik/pull/9816) by [svx](https://github.com/svx))
|
||||||
|
- **[middleware]** Add accessControlAllowHeaders example ([#9810](https://github.com/traefik/traefik/pull/9810) by [yingshaoxo](https://github.com/yingshaoxo))
|
||||||
|
- Update Call To Actions ([#9824](https://github.com/traefik/traefik/pull/9824) by [svx](https://github.com/svx))
|
||||||
|
- Improve concepts page ([#9813](https://github.com/traefik/traefik/pull/9813) by [svx](https://github.com/svx))
|
||||||
|
- Update wording ([#9811](https://github.com/traefik/traefik/pull/9811) by [svx](https://github.com/svx))
|
||||||
|
|
||||||
|
## [v2.9.10](https://github.com/traefik/traefik/tree/v2.9.10) (2023-04-06)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.9...v2.9.10)
|
||||||
|
|
||||||
|
## [v2.10.0-rc1](https://github.com/traefik/traefik/tree/v2.10.0-rc1) (2023-03-22)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/b3f162a8a61d89beaa9edc8adc12cc4cb3e1de0f...v2.10.0-rc1)
|
||||||
|
|
||||||
|
**Enhancements:**
|
||||||
|
- **[docker]** Expose ContainerName in Docker provider ([#9770](https://github.com/traefik/traefik/pull/9770) by [quinot](https://github.com/quinot))
|
||||||
|
- **[hub]** hub: get out of experimental. ([#9792](https://github.com/traefik/traefik/pull/9792) by [mpl](https://github.com/mpl))
|
||||||
|
- **[k8s/crd]** Introduce traefik.io API Group CRDs ([#9765](https://github.com/traefik/traefik/pull/9765) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[k8s/ingress,k8s/crd,k8s]** Native Kubernetes service load-balancing ([#9740](https://github.com/traefik/traefik/pull/9740) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[middleware,metrics]** Add prometheus metric requests_total with headers ([#9783](https://github.com/traefik/traefik/pull/9783) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[nomad]** Support multiple namespaces in the Nomad Provider ([#9794](https://github.com/traefik/traefik/pull/9794) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[tracing]** Add support to send DataDog traces via Unix Socket ([#9714](https://github.com/traefik/traefik/pull/9714) by [der-eismann](https://github.com/der-eismann))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- docs: update order of log levels ([#9791](https://github.com/traefik/traefik/pull/9791) by [svx](https://github.com/svx))
|
||||||
|
|
||||||
|
**Misc:**
|
||||||
|
- Merge current v2.9 into v2.10 ([#9798](https://github.com/traefik/traefik/pull/9798) by [ldez](https://github.com/ldez))
|
||||||
|
|
||||||
|
## [v2.9.9](https://github.com/traefik/traefik/tree/v2.9.9) (2023-03-21)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.8...v2.9.9)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[acme]** Update go-acme/lego to v4.10.2 ([#9749](https://github.com/traefik/traefik/pull/9749) by [ldez](https://github.com/ldez))
|
||||||
|
- **[http3]** Update quic-go to v0.33.0 ([#9737](https://github.com/traefik/traefik/pull/9737) by [ldez](https://github.com/ldez))
|
||||||
|
- **[metrics]** Include user-defined default cert for traefik_tls_certs_not_after metric ([#9742](https://github.com/traefik/traefik/pull/9742) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[middleware]** Update vulcand/oxy to a0e9f7ff1040 ([#9750](https://github.com/traefik/traefik/pull/9750) by [ldez](https://github.com/ldez))
|
||||||
|
- **[nomad]** Fix default configuration settings for Nomad Provider ([#9758](https://github.com/traefik/traefik/pull/9758) by [aofei](https://github.com/aofei))
|
||||||
|
- **[nomad]** Fix Nomad client TLS defaults ([#9795](https://github.com/traefik/traefik/pull/9795) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[server]** Remove User-Agent header removal from ReverseProxy director func ([#9752](https://github.com/traefik/traefik/pull/9752) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[middleware]** Clarify ratelimit middleware ([#9777](https://github.com/traefik/traefik/pull/9777) by [mpl](https://github.com/mpl))
|
||||||
|
- **[tcp]** Correcting variable name 'server address' in TCP Router ([#9743](https://github.com/traefik/traefik/pull/9743) by [ralphg6](https://github.com/ralphg6))
|
||||||
|
|
||||||
|
## [v2.9.8](https://github.com/traefik/traefik/tree/v2.9.8) (2023-02-15)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.7...v2.9.8)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[server]** Update golang.org/x/net to v0.7.0 ([#9716](https://github.com/traefik/traefik/pull/9716) by [ldez](https://github.com/ldez))
|
||||||
|
|
||||||
|
## [v2.9.7](https://github.com/traefik/traefik/tree/v2.9.7) (2023-02-14)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.6...v2.9.7)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[acme]** Update go-acme/lego to v4.10.0 ([#9705](https://github.com/traefik/traefik/pull/9705) by [ldez](https://github.com/ldez))
|
||||||
|
- **[ecs]** Prevent panicking when a container has no network interfaces ([#9661](https://github.com/traefik/traefik/pull/9661) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[file]** Make file provider more resilient wrt first configuration ([#9595](https://github.com/traefik/traefik/pull/9595) by [mpl](https://github.com/mpl))
|
||||||
|
- **[logs]** Differentiate UDP stream and TCP connection in logs ([#9687](https://github.com/traefik/traefik/pull/9687) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[middleware]** Prevent from no rate limiting when average is zero ([#9621](https://github.com/traefik/traefik/pull/9621) by [witalisoft](https://github.com/witalisoft))
|
||||||
|
- **[middleware]** Prevents superfluous WriteHeader call in the error middleware ([#9620](https://github.com/traefik/traefik/pull/9620) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[middleware]** Sanitize X-Forwarded-Proto header in RedirectScheme middleware ([#9598](https://github.com/traefik/traefik/pull/9598) by [ldez](https://github.com/ldez))
|
||||||
|
- **[plugins]** Update paerser to v0.2.0 ([#9671](https://github.com/traefik/traefik/pull/9671) by [ldez](https://github.com/ldez))
|
||||||
|
- **[plugins]** Update Yaegi to v0.15.0 ([#9700](https://github.com/traefik/traefik/pull/9700) by [ldez](https://github.com/ldez))
|
||||||
|
- **[tls,http3]** Bump quic-go to 89769f409f ([#9685](https://github.com/traefik/traefik/pull/9685) by [mpl](https://github.com/mpl))
|
||||||
|
- **[tls,tcp]** Adds the support for IPv6 in the TCP HostSNI matcher ([#9692](https://github.com/traefik/traefik/pull/9692) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[acme]** Add CNAME support and gotchas ([#9698](https://github.com/traefik/traefik/pull/9698) by [mpl](https://github.com/mpl))
|
||||||
|
- **[acme]** Further Let's Encrypt ratelimit warnings ([#9627](https://github.com/traefik/traefik/pull/9627) by [hcooper](https://github.com/hcooper))
|
||||||
|
- **[k8s]** Add info admonition about routing to k8 services ([#9645](https://github.com/traefik/traefik/pull/9645) by [svx](https://github.com/svx))
|
||||||
|
- **[k8s]** Improve TLSStore CRD documentation ([#9579](https://github.com/traefik/traefik/pull/9579) by [mloiseleur](https://github.com/mloiseleur))
|
||||||
|
- **[middleware]** doc: add note about remoteaddr strategy ([#9701](https://github.com/traefik/traefik/pull/9701) by [mpl](https://github.com/mpl))
|
||||||
|
- Update copyright to match new standard ([#9651](https://github.com/traefik/traefik/pull/9651) by [paulocfjunior](https://github.com/paulocfjunior))
|
||||||
|
- Update copyright for 2023 ([#9631](https://github.com/traefik/traefik/pull/9631) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
- Update submitting pull requests to include language about drafts ([#9609](https://github.com/traefik/traefik/pull/9609) by [tfny](https://github.com/tfny))
|
||||||
|
|
||||||
|
## [v3.0.0-beta2](https://github.com/traefik/traefik/tree/v3.0.0-beta2) (2022-12-07)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v3.0.0-beta1...v3.0.0-beta2)
|
||||||
|
|
||||||
|
**Enhancements:**
|
||||||
|
- **[http3]** Moves HTTP/3 outside the experimental section ([#9570](https://github.com/traefik/traefik/pull/9570) by [sdelicata](https://github.com/sdelicata))
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[logs]** Change traefik cmd error log to error level ([#9569](https://github.com/traefik/traefik/pull/9569) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[rules]** Rework Host and HostRegexp matchers ([#9559](https://github.com/traefik/traefik/pull/9559) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
|
||||||
|
**Misc:**
|
||||||
|
- Merge current v2.9 into master ([#9586](https://github.com/traefik/traefik/pull/9586) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
|
||||||
|
## [v2.9.6](https://github.com/traefik/traefik/tree/v2.9.6) (2022-12-07)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.5...v2.9.6)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[acme]** Update go-acme/lego to v4.9.1 ([#9550](https://github.com/traefik/traefik/pull/9550) by [ldez](https://github.com/ldez))
|
||||||
|
- **[k8s/crd]** Support of allowEmptyServices in TraefikService ([#9424](https://github.com/traefik/traefik/pull/9424) by [jeromeguiard](https://github.com/jeromeguiard))
|
||||||
|
- **[logs]** Remove logs of the request ([#9574](https://github.com/traefik/traefik/pull/9574) by [ldez](https://github.com/ldez))
|
||||||
|
- **[plugins]** Increase the timeout on plugin download ([#9529](https://github.com/traefik/traefik/pull/9529) by [ldez](https://github.com/ldez))
|
||||||
|
- **[server]** Update golang.org/x/net ([#9582](https://github.com/traefik/traefik/pull/9582) by [ldez](https://github.com/ldez))
|
||||||
|
- **[tls]** Handle broken TLS conf better ([#9572](https://github.com/traefik/traefik/pull/9572) by [mpl](https://github.com/mpl))
|
||||||
|
- **[tracing]** Update DataDog tracing dependency to v1.43.1 ([#9526](https://github.com/traefik/traefik/pull/9526) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- **[webui]** Add missing serialNumber passTLSClientCert option to middleware panel ([#9539](https://github.com/traefik/traefik/pull/9539) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[docker]** Add networking example ([#9542](https://github.com/traefik/traefik/pull/9542) by [Janik-Haag](https://github.com/Janik-Haag))
|
||||||
|
- **[hub]** Add information about the Hub Agent ([#9560](https://github.com/traefik/traefik/pull/9560) by [nmengin](https://github.com/nmengin))
|
||||||
|
- **[k8s/helm]** Update Helm installation section ([#9564](https://github.com/traefik/traefik/pull/9564) by [mloiseleur](https://github.com/mloiseleur))
|
||||||
|
- **[middleware]** Clarify PathPrefix matcher greediness ([#9519](https://github.com/traefik/traefik/pull/9519) by [mpl](https://github.com/mpl))
|
||||||
|
|
||||||
|
## [v3.0.0-beta1](https://github.com/traefik/traefik/tree/v3.0.0-beta1) (2022-12-05)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.0-rc1...v3.0.0-beta1)
|
||||||
|
|
||||||
|
**Enhancements:**
|
||||||
|
- **[ecs]** Add option to keep only healthy ECS tasks ([#8027](https://github.com/traefik/traefik/pull/8027) by [Michampt](https://github.com/Michampt))
|
||||||
|
- **[healthcheck]** Support gRPC healthcheck ([#8583](https://github.com/traefik/traefik/pull/8583) by [jjacque](https://github.com/jjacque))
|
||||||
|
- **[healthcheck]** Add a status option to the service health check ([#9463](https://github.com/traefik/traefik/pull/9463) by [guoard](https://github.com/guoard))
|
||||||
|
- **[http]** Support custom headers when fetching configuration through HTTP ([#9421](https://github.com/traefik/traefik/pull/9421) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
- **[logs,performance]** New logger for the Traefik logs ([#9515](https://github.com/traefik/traefik/pull/9515) by [ldez](https://github.com/ldez))
|
||||||
|
- **[logs,plugins]** Retry on plugin API calls ([#9530](https://github.com/traefik/traefik/pull/9530) by [ldez](https://github.com/ldez))
|
||||||
|
- **[logs,provider]** Improve provider logs ([#9562](https://github.com/traefik/traefik/pull/9562) by [ldez](https://github.com/ldez))
|
||||||
|
- **[logs]** Improve test logger assertions ([#9533](https://github.com/traefik/traefik/pull/9533) by [ldez](https://github.com/ldez))
|
||||||
|
- **[metrics]** Support gRPC and gRPC-Web protocol in metrics ([#9483](https://github.com/traefik/traefik/pull/9483) by [longit644](https://github.com/longit644))
|
||||||
|
- **[middleware,accesslogs]** Log TLS client subject ([#9285](https://github.com/traefik/traefik/pull/9285) by [xmessi](https://github.com/xmessi))
|
||||||
|
- **[middleware,metrics,tracing]** Add OpenTelemetry tracing and metrics support ([#8999](https://github.com/traefik/traefik/pull/8999) by [tomMoulard](https://github.com/tomMoulard))
|
||||||
|
- **[middleware]** Disable Content-Type auto-detection by default ([#9546](https://github.com/traefik/traefik/pull/9546) by [sdelicata](https://github.com/sdelicata))
|
||||||
|
- **[middleware]** Add gRPC-Web middleware ([#9451](https://github.com/traefik/traefik/pull/9451) by [juliens](https://github.com/juliens))
|
||||||
|
- **[middleware]** Add support for Brotli ([#9387](https://github.com/traefik/traefik/pull/9387) by [glinton](https://github.com/glinton))
|
||||||
|
- **[middleware]** Renaming IPWhiteList to IPAllowList ([#9457](https://github.com/traefik/traefik/pull/9457) by [wxmbugu](https://github.com/wxmbugu))
|
||||||
|
- **[nomad]** Support multiple namespaces in the Nomad Provider ([#9332](https://github.com/traefik/traefik/pull/9332) by [0teh](https://github.com/0teh))
|
||||||
|
- **[rules]** Update routing syntax ([#9531](https://github.com/traefik/traefik/pull/9531) by [skwair](https://github.com/skwair))
|
||||||
|
- **[server]** Rework servers load-balancer to use the WRR ([#9431](https://github.com/traefik/traefik/pull/9431) by [juliens](https://github.com/juliens))
|
||||||
|
- **[server]** Allow default entrypoints definition ([#9100](https://github.com/traefik/traefik/pull/9100) by [jilleJr](https://github.com/jilleJr))
|
||||||
|
- **[tls,service]** Support SPIFFE mTLS between Traefik and Backend servers ([#9394](https://github.com/traefik/traefik/pull/9394) by [jlevesy](https://github.com/jlevesy))
|
||||||
|
- **[tls]** Add Tailscale certificate resolver ([#9237](https://github.com/traefik/traefik/pull/9237) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
- **[tls]** Support SNI routing with Postgres STARTTLS connections ([#9377](https://github.com/traefik/traefik/pull/9377) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
- Remove deprecated options ([#9527](https://github.com/traefik/traefik/pull/9527) by [sdelicata](https://github.com/sdelicata))
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[logs]** Fix log level ([#9545](https://github.com/traefik/traefik/pull/9545) by [ldez](https://github.com/ldez))
|
||||||
|
- **[metrics]** Fix ServerUp metric ([#9534](https://github.com/traefik/traefik/pull/9534) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
- **[tls,service]** Enforce default servers transport SPIFFE config ([#9444](https://github.com/traefik/traefik/pull/9444) by [jlevesy](https://github.com/jlevesy))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[metrics]** Update and publish official Grafana Dashboard ([#9493](https://github.com/traefik/traefik/pull/9493) by [mloiseleur](https://github.com/mloiseleur))
|
||||||
|
|
||||||
|
**Misc:**
|
||||||
|
- Merge branch v2.9 into master ([#9554](https://github.com/traefik/traefik/pull/9554) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.9 into master ([#9536](https://github.com/traefik/traefik/pull/9536) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.9 into master ([#9532](https://github.com/traefik/traefik/pull/9532) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.9 into master ([#9482](https://github.com/traefik/traefik/pull/9482) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
- Merge branch v2.9 into master ([#9464](https://github.com/traefik/traefik/pull/9464) by [ldez](https://github.com/ldez))
|
||||||
|
- Merge branch v2.9 into master ([#9449](https://github.com/traefik/traefik/pull/9449) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
- Merge branch v2.9 into master ([#9419](https://github.com/traefik/traefik/pull/9419) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
- Merge branch v2.9 into master ([#9351](https://github.com/traefik/traefik/pull/9351) by [rtribotte](https://github.com/rtribotte))
|
||||||
|
|
||||||
|
## [v2.9.5](https://github.com/traefik/traefik/tree/v2.9.5) (2022-11-17)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.4...v2.9.5)
|
||||||
|
|
||||||
|
**Bug fixes:**
|
||||||
|
- **[logs,middleware]** Create a new capture instance for each incoming request ([#9510](https://github.com/traefik/traefik/pull/9510) by [sdelicata](https://github.com/sdelicata))
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- **[k8s/helm]** Update helm repository ([#9506](https://github.com/traefik/traefik/pull/9506) by [charlie-haley](https://github.com/charlie-haley))
|
||||||
|
- Enhance wording of building-testing page ([#9509](https://github.com/traefik/traefik/pull/9509) by [svx](https://github.com/svx))
|
||||||
|
- Add link descriptions and update wording ([#9507](https://github.com/traefik/traefik/pull/9507) by [svx](https://github.com/svx))
|
||||||
|
- Removes the experimental tag on the Traefik Hub header ([#9498](https://github.com/traefik/traefik/pull/9498) by [tfny](https://github.com/tfny))
|
||||||
|
|
||||||
|
## [v2.9.4](https://github.com/traefik/traefik/tree/v2.9.4) (2022-10-27)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.1...v2.9.4)
|
||||||
|
|
||||||
**Bug fixes:**
|
**Bug fixes:**
|
||||||
- **[acme]** Update go-acme/lego to v4.9.0 ([#9413](https://github.com/traefik/traefik/pull/9413) by [tony-defa](https://github.com/tony-defa))
|
- **[acme]** Update go-acme/lego to v4.9.0 ([#9413](https://github.com/traefik/traefik/pull/9413) by [tony-defa](https://github.com/tony-defa))
|
||||||
@@ -14,6 +312,16 @@
|
|||||||
- Simplify dashboard rule example ([#9454](https://github.com/traefik/traefik/pull/9454) by [sosoba](https://github.com/sosoba))
|
- Simplify dashboard rule example ([#9454](https://github.com/traefik/traefik/pull/9454) by [sosoba](https://github.com/sosoba))
|
||||||
- Add v2.9 to release page ([#9438](https://github.com/traefik/traefik/pull/9438) by [kevinpollet](https://github.com/kevinpollet))
|
- Add v2.9 to release page ([#9438](https://github.com/traefik/traefik/pull/9438) by [kevinpollet](https://github.com/kevinpollet))
|
||||||
|
|
||||||
|
## [v2.9.3](https://github.com/traefik/traefik/tree/v2.9.3) (2022-10-27)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.1...v2.9.3)
|
||||||
|
|
||||||
|
Release canceled.
|
||||||
|
|
||||||
|
## [v2.9.2](https://github.com/traefik/traefik/tree/v2.9.2) (2022-10-27)
|
||||||
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.1...v2.9.2)
|
||||||
|
|
||||||
|
Release canceled.
|
||||||
|
|
||||||
## [v2.9.1](https://github.com/traefik/traefik/tree/v2.9.1) (2022-10-03)
|
## [v2.9.1](https://github.com/traefik/traefik/tree/v2.9.1) (2022-10-03)
|
||||||
[All Commits](https://github.com/traefik/traefik/compare/v2.9.0-rc1...v2.9.1)
|
[All Commits](https://github.com/traefik/traefik/compare/v2.9.0-rc1...v2.9.1)
|
||||||
|
|
||||||
@@ -42,13 +350,7 @@
|
|||||||
- **[acme]** Fix ACME panic ([#9365](https://github.com/traefik/traefik/pull/9365) by [ldez](https://github.com/ldez))
|
- **[acme]** Fix ACME panic ([#9365](https://github.com/traefik/traefik/pull/9365) by [ldez](https://github.com/ldez))
|
||||||
|
|
||||||
**Documentation:**
|
**Documentation:**
|
||||||
- Prepare release v2.9.0 ([#9409](https://github.com/traefik/traefik/pull/9409) by [tomMoulard](https://github.com/tomMoulard))
|
|
||||||
- **[metrics]** Rework metrics overview page ([#9366](https://github.com/traefik/traefik/pull/9366) by [ddtmachado](https://github.com/ddtmachado))
|
- **[metrics]** Rework metrics overview page ([#9366](https://github.com/traefik/traefik/pull/9366) by [ddtmachado](https://github.com/ddtmachado))
|
||||||
- Prepare release v2.9.0-rc5 ([#9402](https://github.com/traefik/traefik/pull/9402) by [ldez](https://github.com/ldez))
|
|
||||||
- Prepare release v2.9.0-rc4 ([#9372](https://github.com/traefik/traefik/pull/9372) by [kevinpollet](https://github.com/kevinpollet))
|
|
||||||
- Prepare release v2.9.0-rc3 ([#9344](https://github.com/traefik/traefik/pull/9344) by [kevinpollet](https://github.com/kevinpollet))
|
|
||||||
- Prepare release v2.9.0-rc2 ([6c2c561](https://github.com/traefik/traefik/commit/6c2c561d8f935d76ccd07d28e1455c7768adc153) by [ldez](https://github.com/ldez))
|
|
||||||
- Prepare release v2.9.0-rc1 ([#9334](https://github.com/traefik/traefik/pull/9334) by [rtribotte](https://github.com/rtribotte))
|
|
||||||
|
|
||||||
**Misc:**
|
**Misc:**
|
||||||
- Merge current v2.8 into v2.9 ([#9400](https://github.com/traefik/traefik/pull/9400) by [ldez](https://github.com/ldez))
|
- Merge current v2.8 into v2.9 ([#9400](https://github.com/traefik/traefik/pull/9400) by [ldez](https://github.com/ldez))
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016-2020 Containous SAS; 2020-2022 Traefik Labs
|
Copyright (c) 2016-2020 Containous SAS; 2020-2023 Traefik Labs
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
2
Makefile
2
Makefile
@@ -189,7 +189,7 @@ generate-genconf:
|
|||||||
.PHONY: release-packages
|
.PHONY: release-packages
|
||||||
release-packages: generate-webui build-dev-image
|
release-packages: generate-webui build-dev-image
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
$(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) goreleaser release --skip-publish --timeout="90m"
|
$(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) goreleaser release --skip-publish -p 2 --timeout="90m"
|
||||||
$(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) tar cfz dist/traefik-${VERSION}.src.tar.gz \
|
$(if $(IN_DOCKER),$(DOCKER_RUN_TRAEFIK_NOTTY)) tar cfz dist/traefik-${VERSION}.src.tar.gz \
|
||||||
--exclude-vcs \
|
--exclude-vcs \
|
||||||
--exclude .idea \
|
--exclude .idea \
|
||||||
|
14
README.md
14
README.md
@@ -1,6 +1,10 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="docs/content/assets/img/traefik.logo.png" alt="Traefik" title="Traefik" />
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="docs/content/assets/img/traefik.logo-dark.png">
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="docs/content/assets/img/traefik.logo.png">
|
||||||
|
<img alt="Traefik" title="Traefik" src="docs/content/assets/img/traefik.logo.png">
|
||||||
|
</picture>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://semaphoreci.com/containous/traefik)
|
[](https://semaphoreci.com/containous/traefik)
|
||||||
@@ -11,7 +15,7 @@
|
|||||||
[](https://twitter.com/intent/follow?screen_name=traefik)
|
[](https://twitter.com/intent/follow?screen_name=traefik)
|
||||||
|
|
||||||
Traefik (pronounced _traffic_) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy.
|
Traefik (pronounced _traffic_) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy.
|
||||||
Traefik integrates with your existing infrastructure components ([Docker](https://www.docker.com/), [Swarm mode](https://docs.docker.com/engine/swarm/), [Kubernetes](https://kubernetes.io), [Marathon](https://mesosphere.github.io/marathon/), [Consul](https://www.consul.io/), [Etcd](https://coreos.com/etcd/), [Rancher](https://rancher.com), [Amazon ECS](https://aws.amazon.com/ecs), ...) and configures itself automatically and dynamically.
|
Traefik integrates with your existing infrastructure components ([Docker](https://www.docker.com/), [Swarm mode](https://docs.docker.com/engine/swarm/), [Kubernetes](https://kubernetes.io), [Consul](https://www.consul.io/), [Etcd](https://coreos.com/etcd/), [Rancher v2](https://rancher.com), [Amazon ECS](https://aws.amazon.com/ecs), ...) and configures itself automatically and dynamically.
|
||||||
Pointing Traefik at your orchestrator should be the _only_ configuration step you need.
|
Pointing Traefik at your orchestrator should be the _only_ configuration step you need.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -57,8 +61,8 @@ _(But if you'd rather configure some of your routes manually, Traefik supports t
|
|||||||
- Provides HTTPS to your microservices by leveraging [Let's Encrypt](https://letsencrypt.org) (wildcard certificates support)
|
- Provides HTTPS to your microservices by leveraging [Let's Encrypt](https://letsencrypt.org) (wildcard certificates support)
|
||||||
- Circuit breakers, retry
|
- Circuit breakers, retry
|
||||||
- See the magic through its clean web UI
|
- See the magic through its clean web UI
|
||||||
- Websocket, HTTP/2, GRPC ready
|
- Websocket, HTTP/2, gRPC ready
|
||||||
- Provides metrics (Rest, Prometheus, Datadog, Statsd, InfluxDB)
|
- Provides metrics (Rest, Prometheus, Datadog, Statsd, InfluxDB 2.X)
|
||||||
- Keeps access logs (JSON, CLF)
|
- Keeps access logs (JSON, CLF)
|
||||||
- Fast
|
- Fast
|
||||||
- Exposes a Rest API
|
- Exposes a Rest API
|
||||||
@@ -68,8 +72,6 @@ _(But if you'd rather configure some of your routes manually, Traefik supports t
|
|||||||
|
|
||||||
- [Docker](https://doc.traefik.io/traefik/providers/docker/) / [Swarm mode](https://doc.traefik.io/traefik/providers/docker/)
|
- [Docker](https://doc.traefik.io/traefik/providers/docker/) / [Swarm mode](https://doc.traefik.io/traefik/providers/docker/)
|
||||||
- [Kubernetes](https://doc.traefik.io/traefik/providers/kubernetes-crd/)
|
- [Kubernetes](https://doc.traefik.io/traefik/providers/kubernetes-crd/)
|
||||||
- [Marathon](https://doc.traefik.io/traefik/providers/marathon/)
|
|
||||||
- [Rancher](https://doc.traefik.io/traefik/providers/rancher/) (Metadata)
|
|
||||||
- [File](https://doc.traefik.io/traefik/providers/file/)
|
- [File](https://doc.traefik.io/traefik/providers/file/)
|
||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.19-alpine
|
FROM golang:1.20-alpine
|
||||||
|
|
||||||
RUN apk --no-cache --no-progress add git mercurial bash gcc musl-dev curl tar ca-certificates tzdata \
|
RUN apk --no-cache --no-progress add git mercurial bash gcc musl-dev curl tar ca-certificates tzdata \
|
||||||
&& update-ca-certificates \
|
&& update-ca-certificates \
|
||||||
@@ -13,7 +13,7 @@ RUN mkdir -p /usr/local/bin \
|
|||||||
| tar -xzC /usr/local/bin --transform 's#^.+/##x'
|
| tar -xzC /usr/local/bin --transform 's#^.+/##x'
|
||||||
|
|
||||||
# Download golangci-lint binary to bin folder in $GOPATH
|
# Download golangci-lint binary to bin folder in $GOPATH
|
||||||
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.50.0
|
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.52.2
|
||||||
|
|
||||||
# Download misspell binary to bin folder in $GOPATH
|
# Download misspell binary to bin folder in $GOPATH
|
||||||
RUN curl -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.4.0
|
RUN curl -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.4.0
|
||||||
|
@@ -4,7 +4,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
ptypes "github.com/traefik/paerser/types"
|
ptypes "github.com/traefik/paerser/types"
|
||||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
"github.com/traefik/traefik/v3/pkg/config/static"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TraefikCmdConfiguration wraps the static configuration and extra parameters.
|
// TraefikCmdConfiguration wraps the static configuration and extra parameters.
|
||||||
@@ -28,6 +28,10 @@ func NewTraefikConfiguration() *TraefikCmdConfiguration {
|
|||||||
ServersTransport: &static.ServersTransport{
|
ServersTransport: &static.ServersTransport{
|
||||||
MaxIdleConnsPerHost: 200,
|
MaxIdleConnsPerHost: 200,
|
||||||
},
|
},
|
||||||
|
TCPServersTransport: &static.TCPServersTransport{
|
||||||
|
DialTimeout: ptypes.Duration(30 * time.Second),
|
||||||
|
DialKeepAlive: ptypes.Duration(15 * time.Second),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
ConfigFile: "",
|
ConfigFile: "",
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/traefik/paerser/cli"
|
"github.com/traefik/paerser/cli"
|
||||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
"github.com/traefik/traefik/v3/pkg/config/static"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewCmd builds a new HealthCheck command.
|
// NewCmd builds a new HealthCheck command.
|
||||||
|
@@ -11,7 +11,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const rootPkg = "github.com/traefik/traefik/v2/pkg/config/dynamic"
|
const rootPkg = "github.com/traefik/traefik/v3/pkg/config/dynamic"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
destModuleName = "github.com/traefik/genconf"
|
destModuleName = "github.com/traefik/genconf"
|
||||||
@@ -57,8 +57,8 @@ func run(dest string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
centrifuge.IncludedImports = []string{
|
centrifuge.IncludedImports = []string{
|
||||||
"github.com/traefik/traefik/v2/pkg/tls",
|
"github.com/traefik/traefik/v3/pkg/tls",
|
||||||
"github.com/traefik/traefik/v2/pkg/types",
|
"github.com/traefik/traefik/v3/pkg/types",
|
||||||
}
|
}
|
||||||
|
|
||||||
centrifuge.ExcludedTypes = []string{
|
centrifuge.ExcludedTypes = []string{
|
||||||
@@ -71,8 +71,8 @@ func run(dest string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
centrifuge.ExcludedFiles = []string{
|
centrifuge.ExcludedFiles = []string{
|
||||||
"github.com/traefik/traefik/v2/pkg/types/logs.go",
|
"github.com/traefik/traefik/v3/pkg/types/logs.go",
|
||||||
"github.com/traefik/traefik/v2/pkg/types/metrics.go",
|
"github.com/traefik/traefik/v3/pkg/types/metrics.go",
|
||||||
}
|
}
|
||||||
|
|
||||||
centrifuge.TypeCleaner = cleanType
|
centrifuge.TypeCleaner = cleanType
|
||||||
@@ -87,11 +87,11 @@ func run(dest string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cleanType(typ types.Type, base string) string {
|
func cleanType(typ types.Type, base string) string {
|
||||||
if typ.String() == "github.com/traefik/traefik/v2/pkg/tls.FileOrContent" {
|
if typ.String() == "github.com/traefik/traefik/v3/pkg/tls.FileOrContent" {
|
||||||
return "string"
|
return "string"
|
||||||
}
|
}
|
||||||
|
|
||||||
if typ.String() == "[]github.com/traefik/traefik/v2/pkg/tls.FileOrContent" {
|
if typ.String() == "[]github.com/traefik/traefik/v3/pkg/tls.FileOrContent" {
|
||||||
return "[]string"
|
return "[]string"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,8 +103,8 @@ func cleanType(typ types.Type, base string) string {
|
|||||||
return strings.ReplaceAll(typ.String(), base+".", "")
|
return strings.ReplaceAll(typ.String(), base+".", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(typ.String(), "github.com/traefik/traefik/v2/pkg/") {
|
if strings.Contains(typ.String(), "github.com/traefik/traefik/v3/pkg/") {
|
||||||
return strings.ReplaceAll(typ.String(), "github.com/traefik/traefik/v2/pkg/", "")
|
return strings.ReplaceAll(typ.String(), "github.com/traefik/traefik/v3/pkg/", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
return typ.String()
|
return typ.String()
|
||||||
@@ -114,9 +114,9 @@ func cleanPackage(src string) string {
|
|||||||
switch src {
|
switch src {
|
||||||
case "github.com/traefik/paerser/types":
|
case "github.com/traefik/paerser/types":
|
||||||
return ""
|
return ""
|
||||||
case "github.com/traefik/traefik/v2/pkg/tls":
|
case "github.com/traefik/traefik/v3/pkg/tls":
|
||||||
return path.Join(destModuleName, destPkg, "tls")
|
return path.Join(destModuleName, destPkg, "tls")
|
||||||
case "github.com/traefik/traefik/v2/pkg/types":
|
case "github.com/traefik/traefik/v3/pkg/types":
|
||||||
return path.Join(destModuleName, destPkg, "types")
|
return path.Join(destModuleName, destPkg, "types")
|
||||||
default:
|
default:
|
||||||
return src
|
return src
|
||||||
|
89
cmd/traefik/logger.go
Normal file
89
cmd/traefik/logger.go
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
stdlog "log"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/natefinch/lumberjack"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
"github.com/traefik/traefik/v3/pkg/config/static"
|
||||||
|
"github.com/traefik/traefik/v3/pkg/logs"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// hide the first logs before the setup of the logger.
|
||||||
|
zerolog.SetGlobalLevel(zerolog.ErrorLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupLogger(staticConfiguration *static.Configuration) {
|
||||||
|
// configure log format
|
||||||
|
w := getLogWriter(staticConfiguration)
|
||||||
|
|
||||||
|
// configure log level
|
||||||
|
logLevel := getLogLevel(staticConfiguration)
|
||||||
|
|
||||||
|
// create logger
|
||||||
|
logCtx := zerolog.New(w).With().Timestamp()
|
||||||
|
if logLevel <= zerolog.DebugLevel {
|
||||||
|
logCtx = logCtx.Caller()
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Logger = logCtx.Logger().Level(logLevel)
|
||||||
|
zerolog.DefaultContextLogger = &log.Logger
|
||||||
|
zerolog.SetGlobalLevel(logLevel)
|
||||||
|
|
||||||
|
// Global logrus replacement (related to lib like go-rancher-metadata, docker, etc.)
|
||||||
|
logrus.StandardLogger().Out = logs.NoLevel(log.Logger, zerolog.DebugLevel)
|
||||||
|
|
||||||
|
// configure default standard log.
|
||||||
|
stdlog.SetFlags(stdlog.Lshortfile | stdlog.LstdFlags)
|
||||||
|
stdlog.SetOutput(logs.NoLevel(log.Logger, zerolog.DebugLevel))
|
||||||
|
}
|
||||||
|
|
||||||
|
func getLogWriter(staticConfiguration *static.Configuration) io.Writer {
|
||||||
|
var w io.Writer = os.Stderr
|
||||||
|
|
||||||
|
if staticConfiguration.Log != nil && len(staticConfiguration.Log.FilePath) > 0 {
|
||||||
|
_, _ = os.Create(staticConfiguration.Log.FilePath)
|
||||||
|
w = &lumberjack.Logger{
|
||||||
|
Filename: staticConfiguration.Log.FilePath,
|
||||||
|
MaxSize: staticConfiguration.Log.MaxSize,
|
||||||
|
MaxBackups: staticConfiguration.Log.MaxBackups,
|
||||||
|
MaxAge: staticConfiguration.Log.MaxAge,
|
||||||
|
Compress: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if staticConfiguration.Log == nil || staticConfiguration.Log.Format != "json" {
|
||||||
|
w = zerolog.ConsoleWriter{
|
||||||
|
Out: w,
|
||||||
|
TimeFormat: time.RFC3339,
|
||||||
|
NoColor: staticConfiguration.Log != nil && (staticConfiguration.Log.NoColor || len(staticConfiguration.Log.FilePath) > 0),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
func getLogLevel(staticConfiguration *static.Configuration) zerolog.Level {
|
||||||
|
levelStr := "error"
|
||||||
|
if staticConfiguration.Log != nil && staticConfiguration.Log.Level != "" {
|
||||||
|
levelStr = strings.ToLower(staticConfiguration.Log.Level)
|
||||||
|
}
|
||||||
|
|
||||||
|
logLevel, err := zerolog.ParseLevel(strings.ToLower(levelStr))
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).
|
||||||
|
Str("logLevel", levelStr).
|
||||||
|
Msg("Unspecified or invalid log level, setting the level to default (ERROR)...")
|
||||||
|
|
||||||
|
logLevel = zerolog.ErrorLevel
|
||||||
|
}
|
||||||
|
|
||||||
|
return logLevel
|
||||||
|
}
|
@@ -3,8 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
"github.com/traefik/traefik/v3/pkg/config/static"
|
||||||
"github.com/traefik/traefik/v2/pkg/plugins"
|
"github.com/traefik/traefik/v3/pkg/plugins"
|
||||||
)
|
)
|
||||||
|
|
||||||
const outputDir = "./plugins-storage/"
|
const outputDir = "./plugins-storage/"
|
||||||
@@ -35,12 +35,12 @@ func initPlugins(staticCfg *static.Configuration) (*plugins.Client, map[string]p
|
|||||||
var err error
|
var err error
|
||||||
client, err = plugins.NewClient(opts)
|
client, err = plugins.NewClient(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, fmt.Errorf("unable to create plugins client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = plugins.SetupRemotePlugins(client, staticCfg.Experimental.Plugins)
|
err = plugins.SetupRemotePlugins(client, staticCfg.Experimental.Plugins)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, fmt.Errorf("unable to set up plugins environment: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
plgs = staticCfg.Experimental.Plugins
|
plgs = staticCfg.Experimental.Plugins
|
||||||
|
@@ -9,7 +9,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
@@ -18,33 +17,35 @@ import (
|
|||||||
"github.com/coreos/go-systemd/daemon"
|
"github.com/coreos/go-systemd/daemon"
|
||||||
"github.com/go-acme/lego/v4/challenge"
|
"github.com/go-acme/lego/v4/challenge"
|
||||||
gokitmetrics "github.com/go-kit/kit/metrics"
|
gokitmetrics "github.com/go-kit/kit/metrics"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
"github.com/spiffe/go-spiffe/v2/workloadapi"
|
||||||
"github.com/traefik/paerser/cli"
|
"github.com/traefik/paerser/cli"
|
||||||
"github.com/traefik/traefik/v2/cmd"
|
"github.com/traefik/traefik/v3/cmd"
|
||||||
"github.com/traefik/traefik/v2/cmd/healthcheck"
|
"github.com/traefik/traefik/v3/cmd/healthcheck"
|
||||||
cmdVersion "github.com/traefik/traefik/v2/cmd/version"
|
cmdVersion "github.com/traefik/traefik/v3/cmd/version"
|
||||||
tcli "github.com/traefik/traefik/v2/pkg/cli"
|
tcli "github.com/traefik/traefik/v3/pkg/cli"
|
||||||
"github.com/traefik/traefik/v2/pkg/collector"
|
"github.com/traefik/traefik/v3/pkg/collector"
|
||||||
"github.com/traefik/traefik/v2/pkg/config/dynamic"
|
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
||||||
"github.com/traefik/traefik/v2/pkg/config/runtime"
|
"github.com/traefik/traefik/v3/pkg/config/runtime"
|
||||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
"github.com/traefik/traefik/v3/pkg/config/static"
|
||||||
"github.com/traefik/traefik/v2/pkg/log"
|
"github.com/traefik/traefik/v3/pkg/logs"
|
||||||
"github.com/traefik/traefik/v2/pkg/metrics"
|
"github.com/traefik/traefik/v3/pkg/metrics"
|
||||||
"github.com/traefik/traefik/v2/pkg/middlewares/accesslog"
|
"github.com/traefik/traefik/v3/pkg/middlewares/accesslog"
|
||||||
"github.com/traefik/traefik/v2/pkg/provider/acme"
|
"github.com/traefik/traefik/v3/pkg/provider/acme"
|
||||||
"github.com/traefik/traefik/v2/pkg/provider/aggregator"
|
"github.com/traefik/traefik/v3/pkg/provider/aggregator"
|
||||||
"github.com/traefik/traefik/v2/pkg/provider/hub"
|
"github.com/traefik/traefik/v3/pkg/provider/tailscale"
|
||||||
"github.com/traefik/traefik/v2/pkg/provider/traefik"
|
"github.com/traefik/traefik/v3/pkg/provider/traefik"
|
||||||
"github.com/traefik/traefik/v2/pkg/safe"
|
"github.com/traefik/traefik/v3/pkg/safe"
|
||||||
"github.com/traefik/traefik/v2/pkg/server"
|
"github.com/traefik/traefik/v3/pkg/server"
|
||||||
"github.com/traefik/traefik/v2/pkg/server/middleware"
|
"github.com/traefik/traefik/v3/pkg/server/middleware"
|
||||||
"github.com/traefik/traefik/v2/pkg/server/service"
|
"github.com/traefik/traefik/v3/pkg/server/service"
|
||||||
traefiktls "github.com/traefik/traefik/v2/pkg/tls"
|
"github.com/traefik/traefik/v3/pkg/tcp"
|
||||||
"github.com/traefik/traefik/v2/pkg/tracing"
|
traefiktls "github.com/traefik/traefik/v3/pkg/tls"
|
||||||
"github.com/traefik/traefik/v2/pkg/tracing/jaeger"
|
"github.com/traefik/traefik/v3/pkg/tracing"
|
||||||
"github.com/traefik/traefik/v2/pkg/types"
|
"github.com/traefik/traefik/v3/pkg/tracing/jaeger"
|
||||||
"github.com/traefik/traefik/v2/pkg/version"
|
"github.com/traefik/traefik/v3/pkg/types"
|
||||||
"github.com/vulcand/oxy/roundrobin"
|
"github.com/traefik/traefik/v3/pkg/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -78,7 +79,7 @@ Complete documentation is available at https://traefik.io`,
|
|||||||
|
|
||||||
err = cli.Execute(cmdTraefik)
|
err = cli.Execute(cmdTraefik)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
stdlog.Println(err)
|
log.Error().Err(err).Msg("Command error")
|
||||||
logrus.Exit(1)
|
logrus.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,27 +87,24 @@ Complete documentation is available at https://traefik.io`,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runCmd(staticConfiguration *static.Configuration) error {
|
func runCmd(staticConfiguration *static.Configuration) error {
|
||||||
configureLogging(staticConfiguration)
|
setupLogger(staticConfiguration)
|
||||||
|
|
||||||
http.DefaultTransport.(*http.Transport).Proxy = http.ProxyFromEnvironment
|
http.DefaultTransport.(*http.Transport).Proxy = http.ProxyFromEnvironment
|
||||||
|
|
||||||
if err := roundrobin.SetDefaultWeight(0); err != nil {
|
|
||||||
log.WithoutContext().Errorf("Could not set round robin default weight: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
staticConfiguration.SetEffectiveConfiguration()
|
staticConfiguration.SetEffectiveConfiguration()
|
||||||
if err := staticConfiguration.ValidateConfiguration(); err != nil {
|
if err := staticConfiguration.ValidateConfiguration(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.WithoutContext().Infof("Traefik version %s built on %s", version.Version, version.BuildDate)
|
log.Info().Str("version", version.Version).
|
||||||
|
Msgf("Traefik version %s built on %s", version.Version, version.BuildDate)
|
||||||
|
|
||||||
jsonConf, err := json.Marshal(staticConfiguration)
|
jsonConf, err := json.Marshal(staticConfiguration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithoutContext().Errorf("Could not marshal static configuration: %v", err)
|
log.Error().Err(err).Msg("Could not marshal static configuration")
|
||||||
log.WithoutContext().Debugf("Static configuration loaded [struct] %#v", staticConfiguration)
|
log.Debug().Interface("staticConfiguration", staticConfiguration).Msg("Static configuration loaded [struct]")
|
||||||
} else {
|
} else {
|
||||||
log.WithoutContext().Debugf("Static configuration loaded %s", string(jsonConf))
|
log.Debug().RawJSON("staticConfiguration", jsonConf).Msg("Static configuration loaded [json]")
|
||||||
}
|
}
|
||||||
|
|
||||||
if staticConfiguration.Global.CheckNewVersion {
|
if staticConfiguration.Global.CheckNewVersion {
|
||||||
@@ -131,16 +129,16 @@ func runCmd(staticConfiguration *static.Configuration) error {
|
|||||||
|
|
||||||
sent, err := daemon.SdNotify(false, "READY=1")
|
sent, err := daemon.SdNotify(false, "READY=1")
|
||||||
if !sent && err != nil {
|
if !sent && err != nil {
|
||||||
log.WithoutContext().Errorf("Failed to notify: %v", err)
|
log.Error().Err(err).Msg("Failed to notify")
|
||||||
}
|
}
|
||||||
|
|
||||||
t, err := daemon.SdWatchdogEnabled(false)
|
t, err := daemon.SdWatchdogEnabled(false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithoutContext().Errorf("Could not enable Watchdog: %v", err)
|
log.Error().Err(err).Msg("Could not enable Watchdog")
|
||||||
} else if t != 0 {
|
} else if t != 0 {
|
||||||
// Send a ping each half time given
|
// Send a ping each half time given
|
||||||
t /= 2
|
t /= 2
|
||||||
log.WithoutContext().Infof("Watchdog activated with timer duration %s", t)
|
log.Info().Msgf("Watchdog activated with timer duration %s", t)
|
||||||
safe.Go(func() {
|
safe.Go(func() {
|
||||||
tick := time.Tick(t)
|
tick := time.Tick(t)
|
||||||
for range tick {
|
for range tick {
|
||||||
@@ -151,17 +149,17 @@ func runCmd(staticConfiguration *static.Configuration) error {
|
|||||||
|
|
||||||
if staticConfiguration.Ping == nil || errHealthCheck == nil {
|
if staticConfiguration.Ping == nil || errHealthCheck == nil {
|
||||||
if ok, _ := daemon.SdNotify(false, "WATCHDOG=1"); !ok {
|
if ok, _ := daemon.SdNotify(false, "WATCHDOG=1"); !ok {
|
||||||
log.WithoutContext().Error("Fail to tick watchdog")
|
log.Error().Msg("Fail to tick watchdog")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.WithoutContext().Error(errHealthCheck)
|
log.Error().Err(errHealthCheck).Send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
svr.Wait()
|
svr.Wait()
|
||||||
log.WithoutContext().Info("Shutting down")
|
log.Info().Msg("Shutting down")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,9 +188,18 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
|
|
||||||
acmeProviders := initACMEProvider(staticConfiguration, &providerAggregator, tlsManager, httpChallengeProvider, tlsChallengeProvider)
|
acmeProviders := initACMEProvider(staticConfiguration, &providerAggregator, tlsManager, httpChallengeProvider, tlsChallengeProvider)
|
||||||
|
|
||||||
|
// Tailscale
|
||||||
|
|
||||||
|
tsProviders := initTailscaleProviders(staticConfiguration, &providerAggregator)
|
||||||
|
|
||||||
|
// Metrics
|
||||||
|
|
||||||
|
metricRegistries := registerMetricClients(staticConfiguration.Metrics)
|
||||||
|
metricsRegistry := metrics.NewMultiRegistry(metricRegistries)
|
||||||
|
|
||||||
// Entrypoints
|
// Entrypoints
|
||||||
|
|
||||||
serverEntryPointsTCP, err := server.NewTCPEntryPoints(staticConfiguration.EntryPoints, staticConfiguration.HostResolver)
|
serverEntryPointsTCP, err := server.NewTCPEntryPoints(staticConfiguration.EntryPoints, staticConfiguration.HostResolver, metricsRegistry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -202,15 +209,11 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if staticConfiguration.Pilot != nil {
|
|
||||||
log.WithoutContext().Warn("Traefik Pilot has been removed.")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
|
|
||||||
pluginBuilder, err := createPluginBuilder(staticConfiguration)
|
pluginBuilder, err := createPluginBuilder(staticConfiguration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithoutContext().WithError(err).Error("Plugins are disabled because an error has occurred.")
|
log.Error().Err(err).Msg("Plugins are disabled because an error has occurred.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Providers plugins
|
// Providers plugins
|
||||||
@@ -231,27 +234,29 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Traefik Hub
|
|
||||||
|
|
||||||
if staticConfiguration.Hub != nil {
|
|
||||||
if err = providerAggregator.AddProvider(staticConfiguration.Hub); err != nil {
|
|
||||||
return nil, fmt.Errorf("adding Traefik Hub provider: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// API is mandatory for Traefik Hub to access the dynamic configuration.
|
|
||||||
if staticConfiguration.API == nil {
|
|
||||||
staticConfiguration.API = &static.API{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Metrics
|
|
||||||
|
|
||||||
metricRegistries := registerMetricClients(staticConfiguration.Metrics)
|
|
||||||
metricsRegistry := metrics.NewMultiRegistry(metricRegistries)
|
|
||||||
|
|
||||||
// Service manager factory
|
// Service manager factory
|
||||||
|
|
||||||
roundTripperManager := service.NewRoundTripperManager()
|
var spiffeX509Source *workloadapi.X509Source
|
||||||
|
if staticConfiguration.Spiffe != nil && staticConfiguration.Spiffe.WorkloadAPIAddr != "" {
|
||||||
|
log.Info().Str("workloadAPIAddr", staticConfiguration.Spiffe.WorkloadAPIAddr).
|
||||||
|
Msg("Waiting on SPIFFE SVID delivery")
|
||||||
|
|
||||||
|
spiffeX509Source, err = workloadapi.NewX509Source(
|
||||||
|
ctx,
|
||||||
|
workloadapi.WithClientOptions(
|
||||||
|
workloadapi.WithAddr(
|
||||||
|
staticConfiguration.Spiffe.WorkloadAPIAddr,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("unable to create SPIFFE x509 source: %w", err)
|
||||||
|
}
|
||||||
|
log.Info().Msg("Successfully obtained SPIFFE SVID.")
|
||||||
|
}
|
||||||
|
|
||||||
|
roundTripperManager := service.NewRoundTripperManager(spiffeX509Source)
|
||||||
|
dialerManager := tcp.NewDialerManager(spiffeX509Source)
|
||||||
acmeHTTPHandler := getHTTPChallengeHandler(acmeProviders, httpChallengeProvider)
|
acmeHTTPHandler := getHTTPChallengeHandler(acmeProviders, httpChallengeProvider)
|
||||||
managerFactory := service.NewManagerFactory(*staticConfiguration, routinesPool, metricsRegistry, roundTripperManager, acmeHTTPHandler)
|
managerFactory := service.NewManagerFactory(*staticConfiguration, routinesPool, metricsRegistry, roundTripperManager, acmeHTTPHandler)
|
||||||
|
|
||||||
@@ -261,7 +266,7 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
tracer := setupTracing(staticConfiguration.Tracing)
|
tracer := setupTracing(staticConfiguration.Tracing)
|
||||||
|
|
||||||
chainBuilder := middleware.NewChainBuilder(metricsRegistry, accessLog, tracer)
|
chainBuilder := middleware.NewChainBuilder(metricsRegistry, accessLog, tracer)
|
||||||
routerFactory := server.NewRouterFactory(*staticConfiguration, managerFactory, tlsManager, chainBuilder, pluginBuilder, metricsRegistry)
|
routerFactory := server.NewRouterFactory(*staticConfiguration, managerFactory, tlsManager, chainBuilder, pluginBuilder, metricsRegistry, dialerManager)
|
||||||
|
|
||||||
// Watcher
|
// Watcher
|
||||||
|
|
||||||
@@ -278,7 +283,7 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
tlsManager.UpdateConfigs(ctx, conf.TLS.Stores, conf.TLS.Options, conf.TLS.Certificates)
|
tlsManager.UpdateConfigs(ctx, conf.TLS.Stores, conf.TLS.Options, conf.TLS.Certificates)
|
||||||
|
|
||||||
gauge := metricsRegistry.TLSCertsNotAfterTimestampGauge()
|
gauge := metricsRegistry.TLSCertsNotAfterTimestampGauge()
|
||||||
for _, certificate := range tlsManager.GetCertificates() {
|
for _, certificate := range tlsManager.GetServerCertificates() {
|
||||||
appendCertMetric(gauge, certificate)
|
appendCertMetric(gauge, certificate)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -292,13 +297,14 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
// Server Transports
|
// Server Transports
|
||||||
watcher.AddListener(func(conf dynamic.Configuration) {
|
watcher.AddListener(func(conf dynamic.Configuration) {
|
||||||
roundTripperManager.Update(conf.HTTP.ServersTransports)
|
roundTripperManager.Update(conf.HTTP.ServersTransports)
|
||||||
|
dialerManager.Update(conf.TCP.ServersTransports)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Switch router
|
// Switch router
|
||||||
watcher.AddListener(switchRouter(routerFactory, serverEntryPointsTCP, serverEntryPointsUDP))
|
watcher.AddListener(switchRouter(routerFactory, serverEntryPointsTCP, serverEntryPointsUDP))
|
||||||
|
|
||||||
// Metrics
|
// Metrics
|
||||||
if metricsRegistry.IsEpEnabled() || metricsRegistry.IsSvcEnabled() {
|
if metricsRegistry.IsEpEnabled() || metricsRegistry.IsRouterEnabled() || metricsRegistry.IsSvcEnabled() {
|
||||||
var eps []string
|
var eps []string
|
||||||
for key := range serverEntryPointsTCP {
|
for key := range serverEntryPointsTCP {
|
||||||
eps = append(eps, key)
|
eps = append(eps, key)
|
||||||
@@ -311,13 +317,22 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
// TLS challenge
|
// TLS challenge
|
||||||
watcher.AddListener(tlsChallengeProvider.ListenConfiguration)
|
watcher.AddListener(tlsChallengeProvider.ListenConfiguration)
|
||||||
|
|
||||||
// ACME
|
// Certificate Resolvers
|
||||||
|
|
||||||
resolverNames := map[string]struct{}{}
|
resolverNames := map[string]struct{}{}
|
||||||
|
|
||||||
|
// ACME
|
||||||
for _, p := range acmeProviders {
|
for _, p := range acmeProviders {
|
||||||
resolverNames[p.ResolverName] = struct{}{}
|
resolverNames[p.ResolverName] = struct{}{}
|
||||||
watcher.AddListener(p.ListenConfiguration)
|
watcher.AddListener(p.ListenConfiguration)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tailscale
|
||||||
|
for _, p := range tsProviders {
|
||||||
|
resolverNames[p.ResolverName] = struct{}{}
|
||||||
|
watcher.AddListener(p.HandleConfigUpdate)
|
||||||
|
}
|
||||||
|
|
||||||
// Certificate resolver logs
|
// Certificate resolver logs
|
||||||
watcher.AddListener(func(config dynamic.Configuration) {
|
watcher.AddListener(func(config dynamic.Configuration) {
|
||||||
for rtName, rt := range config.HTTP.Routers {
|
for rtName, rt := range config.HTTP.Routers {
|
||||||
@@ -325,11 +340,9 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := resolverNames[rt.TLS.CertResolver]; !ok &&
|
if _, ok := resolverNames[rt.TLS.CertResolver]; !ok {
|
||||||
// "traefik-hub" is an allowed certificate resolver name in a Traefik Hub Experimental feature context.
|
log.Error().Err(err).Str(logs.RouterName, rtName).Str("certificateResolver", rt.TLS.CertResolver).
|
||||||
// It is used to activate its own certificate resolution, even though it is not a "classical" traefik certificate resolver.
|
Msg("Router uses a non-existent certificate resolver")
|
||||||
(staticConfiguration.Hub == nil || rt.TLS.CertResolver != "traefik-hub") {
|
|
||||||
log.WithoutContext().Errorf("the router %s uses a non-existent resolver: %s", rtName, rt.TLS.CertResolver)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -350,16 +363,27 @@ func getHTTPChallengeHandler(acmeProviders []*acme.Provider, httpChallengeProvid
|
|||||||
|
|
||||||
func getDefaultsEntrypoints(staticConfiguration *static.Configuration) []string {
|
func getDefaultsEntrypoints(staticConfiguration *static.Configuration) []string {
|
||||||
var defaultEntryPoints []string
|
var defaultEntryPoints []string
|
||||||
|
|
||||||
|
// Determines if at least one EntryPoint is configured to be used by default.
|
||||||
|
var hasDefinedDefaults bool
|
||||||
|
for _, ep := range staticConfiguration.EntryPoints {
|
||||||
|
if ep.AsDefault {
|
||||||
|
hasDefinedDefaults = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for name, cfg := range staticConfiguration.EntryPoints {
|
for name, cfg := range staticConfiguration.EntryPoints {
|
||||||
// Traefik Hub entryPoint should not be part of the set of default entryPoints.
|
// By default all entrypoints are considered.
|
||||||
if hub.APIEntrypoint == name || hub.TunnelEntrypoint == name {
|
// If at least one is flagged, then only flagged entrypoints are included.
|
||||||
|
if hasDefinedDefaults && !cfg.AsDefault {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol, err := cfg.GetProtocol()
|
protocol, err := cfg.GetProtocol()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Should never happen because Traefik should not start if protocol is invalid.
|
// Should never happen because Traefik should not start if protocol is invalid.
|
||||||
log.WithoutContext().Errorf("Invalid protocol: %v", err)
|
log.Error().Err(err).Msg("Invalid protocol")
|
||||||
}
|
}
|
||||||
|
|
||||||
if protocol != "udp" && name != static.DefaultInternalEntryPointName {
|
if protocol != "udp" && name != static.DefaultInternalEntryPointName {
|
||||||
@@ -382,7 +406,7 @@ func switchRouter(routerFactory *server.RouterFactory, serverEntryPointsTCP serv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// initACMEProvider creates an acme provider from the ACME part of globalConfiguration.
|
// initACMEProvider creates and registers acme.Provider instances corresponding to the configured ACME certificate resolvers.
|
||||||
func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.ProviderAggregator, tlsManager *traefiktls.Manager, httpChallengeProvider, tlsChallengeProvider challenge.Provider) []*acme.Provider {
|
func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.ProviderAggregator, tlsManager *traefiktls.Manager, httpChallengeProvider, tlsChallengeProvider challenge.Provider) []*acme.Provider {
|
||||||
localStores := map[string]*acme.LocalStore{}
|
localStores := map[string]*acme.LocalStore{}
|
||||||
|
|
||||||
@@ -405,7 +429,7 @@ func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.Pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := providerAggregator.AddProvider(p); err != nil {
|
if err := providerAggregator.AddProvider(p); err != nil {
|
||||||
log.WithoutContext().Errorf("The ACME resolver %q is skipped from the resolvers list because: %v", name, err)
|
log.Error().Err(err).Str("resolver", name).Msg("The ACME resolve is skipped from the resolvers list")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,6 +443,27 @@ func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.Pr
|
|||||||
return resolvers
|
return resolvers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initTailscaleProviders creates and registers tailscale.Provider instances corresponding to the configured Tailscale certificate resolvers.
|
||||||
|
func initTailscaleProviders(cfg *static.Configuration, providerAggregator *aggregator.ProviderAggregator) []*tailscale.Provider {
|
||||||
|
var providers []*tailscale.Provider
|
||||||
|
for name, resolver := range cfg.CertificatesResolvers {
|
||||||
|
if resolver.Tailscale == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
tsProvider := &tailscale.Provider{ResolverName: name}
|
||||||
|
|
||||||
|
if err := providerAggregator.AddProvider(tsProvider); err != nil {
|
||||||
|
log.Error().Err(err).Str(logs.ProviderName, name).Msg("Unable to create Tailscale provider")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
providers = append(providers, tsProvider)
|
||||||
|
}
|
||||||
|
|
||||||
|
return providers
|
||||||
|
}
|
||||||
|
|
||||||
func registerMetricClients(metricsConfig *types.Metrics) []metrics.Registry {
|
func registerMetricClients(metricsConfig *types.Metrics) []metrics.Registry {
|
||||||
if metricsConfig == nil {
|
if metricsConfig == nil {
|
||||||
return nil
|
return nil
|
||||||
@@ -427,42 +472,60 @@ func registerMetricClients(metricsConfig *types.Metrics) []metrics.Registry {
|
|||||||
var registries []metrics.Registry
|
var registries []metrics.Registry
|
||||||
|
|
||||||
if metricsConfig.Prometheus != nil {
|
if metricsConfig.Prometheus != nil {
|
||||||
ctx := log.With(context.Background(), log.Str(log.MetricsProviderName, "prometheus"))
|
logger := log.With().Str(logs.MetricsProviderName, "prometheus").Logger()
|
||||||
prometheusRegister := metrics.RegisterPrometheus(ctx, metricsConfig.Prometheus)
|
|
||||||
|
prometheusRegister := metrics.RegisterPrometheus(logger.WithContext(context.Background()), metricsConfig.Prometheus)
|
||||||
if prometheusRegister != nil {
|
if prometheusRegister != nil {
|
||||||
registries = append(registries, prometheusRegister)
|
registries = append(registries, prometheusRegister)
|
||||||
log.FromContext(ctx).Debug("Configured Prometheus metrics")
|
logger.Debug().Msg("Configured Prometheus metrics")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if metricsConfig.Datadog != nil {
|
if metricsConfig.Datadog != nil {
|
||||||
ctx := log.With(context.Background(), log.Str(log.MetricsProviderName, "datadog"))
|
logger := log.With().Str(logs.MetricsProviderName, "datadog").Logger()
|
||||||
registries = append(registries, metrics.RegisterDatadog(ctx, metricsConfig.Datadog))
|
|
||||||
log.FromContext(ctx).Debugf("Configured Datadog metrics: pushing to %s once every %s",
|
registries = append(registries, metrics.RegisterDatadog(logger.WithContext(context.Background()), metricsConfig.Datadog))
|
||||||
metricsConfig.Datadog.Address, metricsConfig.Datadog.PushInterval)
|
logger.Debug().
|
||||||
|
Str("address", metricsConfig.Datadog.Address).
|
||||||
|
Str("pushInterval", metricsConfig.Datadog.PushInterval.String()).
|
||||||
|
Msgf("Configured Datadog metrics")
|
||||||
}
|
}
|
||||||
|
|
||||||
if metricsConfig.StatsD != nil {
|
if metricsConfig.StatsD != nil {
|
||||||
ctx := log.With(context.Background(), log.Str(log.MetricsProviderName, "statsd"))
|
logger := log.With().Str(logs.MetricsProviderName, "statsd").Logger()
|
||||||
registries = append(registries, metrics.RegisterStatsd(ctx, metricsConfig.StatsD))
|
|
||||||
log.FromContext(ctx).Debugf("Configured StatsD metrics: pushing to %s once every %s",
|
|
||||||
metricsConfig.StatsD.Address, metricsConfig.StatsD.PushInterval)
|
|
||||||
}
|
|
||||||
|
|
||||||
if metricsConfig.InfluxDB != nil {
|
registries = append(registries, metrics.RegisterStatsd(logger.WithContext(context.Background()), metricsConfig.StatsD))
|
||||||
ctx := log.With(context.Background(), log.Str(log.MetricsProviderName, "influxdb"))
|
logger.Debug().
|
||||||
registries = append(registries, metrics.RegisterInfluxDB(ctx, metricsConfig.InfluxDB))
|
Str("address", metricsConfig.StatsD.Address).
|
||||||
log.FromContext(ctx).Debugf("Configured InfluxDB metrics: pushing to %s once every %s",
|
Str("pushInterval", metricsConfig.StatsD.PushInterval.String()).
|
||||||
metricsConfig.InfluxDB.Address, metricsConfig.InfluxDB.PushInterval)
|
Msg("Configured StatsD metrics")
|
||||||
}
|
}
|
||||||
|
|
||||||
if metricsConfig.InfluxDB2 != nil {
|
if metricsConfig.InfluxDB2 != nil {
|
||||||
ctx := log.With(context.Background(), log.Str(log.MetricsProviderName, "influxdb2"))
|
logger := log.With().Str(logs.MetricsProviderName, "influxdb2").Logger()
|
||||||
influxDB2Register := metrics.RegisterInfluxDB2(ctx, metricsConfig.InfluxDB2)
|
|
||||||
|
influxDB2Register := metrics.RegisterInfluxDB2(logger.WithContext(context.Background()), metricsConfig.InfluxDB2)
|
||||||
if influxDB2Register != nil {
|
if influxDB2Register != nil {
|
||||||
registries = append(registries, influxDB2Register)
|
registries = append(registries, influxDB2Register)
|
||||||
log.FromContext(ctx).Debugf("Configured InfluxDB v2 metrics: pushing to %s (%s org/%s bucket) once every %s",
|
logger.Debug().
|
||||||
metricsConfig.InfluxDB2.Address, metricsConfig.InfluxDB2.Org, metricsConfig.InfluxDB2.Bucket, metricsConfig.InfluxDB2.PushInterval)
|
Str("address", metricsConfig.InfluxDB2.Address).
|
||||||
|
Str("bucket", metricsConfig.InfluxDB2.Bucket).
|
||||||
|
Str("organization", metricsConfig.InfluxDB2.Org).
|
||||||
|
Str("pushInterval", metricsConfig.InfluxDB2.PushInterval.String()).
|
||||||
|
Msg("Configured InfluxDB v2 metrics")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if metricsConfig.OpenTelemetry != nil {
|
||||||
|
logger := log.With().Str(logs.MetricsProviderName, "openTelemetry").Logger()
|
||||||
|
|
||||||
|
openTelemetryRegistry := metrics.RegisterOpenTelemetry(logger.WithContext(context.Background()), metricsConfig.OpenTelemetry)
|
||||||
|
if openTelemetryRegistry != nil {
|
||||||
|
registries = append(registries, openTelemetryRegistry)
|
||||||
|
logger.Debug().
|
||||||
|
Str("address", metricsConfig.OpenTelemetry.Address).
|
||||||
|
Str("pushInterval", metricsConfig.OpenTelemetry.PushInterval.String()).
|
||||||
|
Msg("Configured OpenTelemetry metrics")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -490,7 +553,7 @@ func setupAccessLog(conf *types.AccessLog) *accesslog.Handler {
|
|||||||
|
|
||||||
accessLoggerMiddleware, err := accesslog.NewHandler(conf)
|
accessLoggerMiddleware, err := accesslog.NewHandler(conf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithoutContext().Warnf("Unable to create access logger: %v", err)
|
log.Warn().Err(err).Msg("Unable to create access logger")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,7 +573,7 @@ func setupTracing(conf *static.Tracing) *tracing.Tracing {
|
|||||||
|
|
||||||
if conf.Zipkin != nil {
|
if conf.Zipkin != nil {
|
||||||
if backend != nil {
|
if backend != nil {
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Zipkin backend.")
|
log.Error().Msg("Multiple tracing backend are not supported: cannot create Zipkin backend.")
|
||||||
} else {
|
} else {
|
||||||
backend = conf.Zipkin
|
backend = conf.Zipkin
|
||||||
}
|
}
|
||||||
@@ -518,7 +581,7 @@ func setupTracing(conf *static.Tracing) *tracing.Tracing {
|
|||||||
|
|
||||||
if conf.Datadog != nil {
|
if conf.Datadog != nil {
|
||||||
if backend != nil {
|
if backend != nil {
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Datadog backend.")
|
log.Error().Msg("Multiple tracing backend are not supported: cannot create Datadog backend.")
|
||||||
} else {
|
} else {
|
||||||
backend = conf.Datadog
|
backend = conf.Datadog
|
||||||
}
|
}
|
||||||
@@ -526,7 +589,7 @@ func setupTracing(conf *static.Tracing) *tracing.Tracing {
|
|||||||
|
|
||||||
if conf.Instana != nil {
|
if conf.Instana != nil {
|
||||||
if backend != nil {
|
if backend != nil {
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Instana backend.")
|
log.Error().Msg("Multiple tracing backend are not supported: cannot create Instana backend.")
|
||||||
} else {
|
} else {
|
||||||
backend = conf.Instana
|
backend = conf.Instana
|
||||||
}
|
}
|
||||||
@@ -534,7 +597,7 @@ func setupTracing(conf *static.Tracing) *tracing.Tracing {
|
|||||||
|
|
||||||
if conf.Haystack != nil {
|
if conf.Haystack != nil {
|
||||||
if backend != nil {
|
if backend != nil {
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Haystack backend.")
|
log.Error().Msg("Multiple tracing backend are not supported: cannot create Haystack backend.")
|
||||||
} else {
|
} else {
|
||||||
backend = conf.Haystack
|
backend = conf.Haystack
|
||||||
}
|
}
|
||||||
@@ -542,14 +605,22 @@ func setupTracing(conf *static.Tracing) *tracing.Tracing {
|
|||||||
|
|
||||||
if conf.Elastic != nil {
|
if conf.Elastic != nil {
|
||||||
if backend != nil {
|
if backend != nil {
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Elastic backend.")
|
log.Error().Msg("Multiple tracing backend are not supported: cannot create Elastic backend.")
|
||||||
} else {
|
} else {
|
||||||
backend = conf.Elastic
|
backend = conf.Elastic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if conf.OpenTelemetry != nil {
|
||||||
|
if backend != nil {
|
||||||
|
log.Error().Msg("Tracing backends are all mutually exclusive: cannot create OpenTelemetry backend.")
|
||||||
|
} else {
|
||||||
|
backend = conf.OpenTelemetry
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if backend == nil {
|
if backend == nil {
|
||||||
log.WithoutContext().Debug("Could not initialize tracing, using Jaeger by default")
|
log.Debug().Msg("Could not initialize tracing, using Jaeger by default")
|
||||||
defaultBackend := &jaeger.Config{}
|
defaultBackend := &jaeger.Config{}
|
||||||
defaultBackend.SetDefaults()
|
defaultBackend.SetDefaults()
|
||||||
backend = defaultBackend
|
backend = defaultBackend
|
||||||
@@ -557,65 +628,12 @@ func setupTracing(conf *static.Tracing) *tracing.Tracing {
|
|||||||
|
|
||||||
tracer, err := tracing.NewTracing(conf.ServiceName, conf.SpanNameLimit, backend)
|
tracer, err := tracing.NewTracing(conf.ServiceName, conf.SpanNameLimit, backend)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithoutContext().Warnf("Unable to create tracer: %v", err)
|
log.Warn().Err(err).Msg("Unable to create tracer")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return tracer
|
return tracer
|
||||||
}
|
}
|
||||||
|
|
||||||
func configureLogging(staticConfiguration *static.Configuration) {
|
|
||||||
// configure default log flags
|
|
||||||
stdlog.SetFlags(stdlog.Lshortfile | stdlog.LstdFlags)
|
|
||||||
|
|
||||||
// configure log level
|
|
||||||
// an explicitly defined log level always has precedence. if none is
|
|
||||||
// given and debug mode is disabled, the default is ERROR, and DEBUG
|
|
||||||
// otherwise.
|
|
||||||
levelStr := "error"
|
|
||||||
if staticConfiguration.Log != nil && staticConfiguration.Log.Level != "" {
|
|
||||||
levelStr = strings.ToLower(staticConfiguration.Log.Level)
|
|
||||||
}
|
|
||||||
|
|
||||||
level, err := logrus.ParseLevel(levelStr)
|
|
||||||
if err != nil {
|
|
||||||
log.WithoutContext().Errorf("Error getting level: %v", err)
|
|
||||||
}
|
|
||||||
log.SetLevel(level)
|
|
||||||
|
|
||||||
var logFile string
|
|
||||||
if staticConfiguration.Log != nil && len(staticConfiguration.Log.FilePath) > 0 {
|
|
||||||
logFile = staticConfiguration.Log.FilePath
|
|
||||||
}
|
|
||||||
|
|
||||||
// configure log format
|
|
||||||
var formatter logrus.Formatter
|
|
||||||
if staticConfiguration.Log != nil && staticConfiguration.Log.Format == "json" {
|
|
||||||
formatter = &logrus.JSONFormatter{}
|
|
||||||
} else {
|
|
||||||
disableColors := len(logFile) > 0
|
|
||||||
formatter = &logrus.TextFormatter{DisableColors: disableColors, FullTimestamp: true, DisableSorting: true}
|
|
||||||
}
|
|
||||||
log.SetFormatter(formatter)
|
|
||||||
|
|
||||||
if len(logFile) > 0 {
|
|
||||||
dir := filepath.Dir(logFile)
|
|
||||||
|
|
||||||
if err := os.MkdirAll(dir, 0o755); err != nil {
|
|
||||||
log.WithoutContext().Errorf("Failed to create log path %s: %s", dir, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = log.OpenFile(logFile)
|
|
||||||
logrus.RegisterExitHandler(func() {
|
|
||||||
if err := log.CloseFile(); err != nil {
|
|
||||||
log.WithoutContext().Errorf("Error while closing log: %v", err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
log.WithoutContext().Errorf("Error while opening log file %s: %v", logFile, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkNewVersion() {
|
func checkNewVersion() {
|
||||||
ticker := time.Tick(24 * time.Hour)
|
ticker := time.Tick(24 * time.Hour)
|
||||||
safe.Go(func() {
|
safe.Go(func() {
|
||||||
@@ -626,16 +644,16 @@ func checkNewVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func stats(staticConfiguration *static.Configuration) {
|
func stats(staticConfiguration *static.Configuration) {
|
||||||
logger := log.WithoutContext()
|
logger := log.Info()
|
||||||
|
|
||||||
if staticConfiguration.Global.SendAnonymousUsage {
|
if staticConfiguration.Global.SendAnonymousUsage {
|
||||||
logger.Info(`Stats collection is enabled.`)
|
logger.Msg(`Stats collection is enabled.`)
|
||||||
logger.Info(`Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration.`)
|
logger.Msg(`Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration.`)
|
||||||
logger.Info(`Help us improve Traefik by leaving this feature on :)`)
|
logger.Msg(`Help us improve Traefik by leaving this feature on :)`)
|
||||||
logger.Info(`More details on: https://doc.traefik.io/traefik/contributing/data-collection/`)
|
logger.Msg(`More details on: https://doc.traefik.io/traefik/contributing/data-collection/`)
|
||||||
collect(staticConfiguration)
|
collect(staticConfiguration)
|
||||||
} else {
|
} else {
|
||||||
logger.Info(`
|
logger.Msg(`
|
||||||
Stats collection is disabled.
|
Stats collection is disabled.
|
||||||
Help us improve Traefik by turning this feature on :)
|
Help us improve Traefik by turning this feature on :)
|
||||||
More details on: https://doc.traefik.io/traefik/contributing/data-collection/
|
More details on: https://doc.traefik.io/traefik/contributing/data-collection/
|
||||||
@@ -648,7 +666,7 @@ func collect(staticConfiguration *static.Configuration) {
|
|||||||
safe.Go(func() {
|
safe.Go(func() {
|
||||||
for time.Sleep(10 * time.Minute); ; <-ticker {
|
for time.Sleep(10 * time.Minute); ; <-ticker {
|
||||||
if err := collector.Collect(staticConfiguration); err != nil {
|
if err := collector.Collect(staticConfiguration); err != nil {
|
||||||
log.WithoutContext().Debug(err)
|
log.Debug().Err(err).Send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/go-kit/kit/metrics"
|
"github.com/go-kit/kit/metrics"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
"github.com/traefik/traefik/v3/pkg/config/static"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FooCert is a PEM-encoded TLS cert.
|
// FooCert is a PEM-encoded TLS cert.
|
||||||
@@ -114,3 +115,79 @@ func TestAppendCertMetric(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetDefaultsEntrypoints(t *testing.T) {
|
||||||
|
testCases := []struct {
|
||||||
|
desc string
|
||||||
|
entrypoints static.EntryPoints
|
||||||
|
expected []string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
desc: "Skips special names",
|
||||||
|
entrypoints: map[string]*static.EntryPoint{
|
||||||
|
"web": {
|
||||||
|
Address: ":80",
|
||||||
|
},
|
||||||
|
"traefik": {
|
||||||
|
Address: ":8080",
|
||||||
|
},
|
||||||
|
"traefikhub-api": {
|
||||||
|
Address: ":9900",
|
||||||
|
},
|
||||||
|
"traefikhub-tunl": {
|
||||||
|
Address: ":9901",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: []string{"web"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "Two EntryPoints not attachable",
|
||||||
|
entrypoints: map[string]*static.EntryPoint{
|
||||||
|
"web": {
|
||||||
|
Address: ":80",
|
||||||
|
},
|
||||||
|
"websecure": {
|
||||||
|
Address: ":443",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: []string{"web", "websecure"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "Two EntryPoints only one attachable",
|
||||||
|
entrypoints: map[string]*static.EntryPoint{
|
||||||
|
"web": {
|
||||||
|
Address: ":80",
|
||||||
|
},
|
||||||
|
"websecure": {
|
||||||
|
Address: ":443",
|
||||||
|
AsDefault: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: []string{"websecure"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc: "Two attachable EntryPoints",
|
||||||
|
entrypoints: map[string]*static.EntryPoint{
|
||||||
|
"web": {
|
||||||
|
Address: ":80",
|
||||||
|
AsDefault: true,
|
||||||
|
},
|
||||||
|
"websecure": {
|
||||||
|
Address: ":443",
|
||||||
|
AsDefault: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expected: []string{"web", "websecure"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range testCases {
|
||||||
|
t.Run(test.desc, func(t *testing.T) {
|
||||||
|
actual := getDefaultsEntrypoints(&static.Configuration{
|
||||||
|
EntryPoints: test.entrypoints,
|
||||||
|
})
|
||||||
|
|
||||||
|
assert.ElementsMatch(t, test.expected, actual)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -8,7 +8,7 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"github.com/traefik/paerser/cli"
|
"github.com/traefik/paerser/cli"
|
||||||
"github.com/traefik/traefik/v2/pkg/version"
|
"github.com/traefik/traefik/v3/pkg/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
var versionTemplate = `Version: {{.Version}}
|
var versionTemplate = `Version: {{.Version}}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 58 KiB |
BIN
docs/content/assets/img/traefik.logo-dark.png
Normal file
BIN
docs/content/assets/img/traefik.logo-dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
@@ -8,17 +8,22 @@ description: "Compile and test your own Traefik Proxy! Learn how to build your o
|
|||||||
Compile and Test Your Own Traefik!
|
Compile and Test Your Own Traefik!
|
||||||
{: .subtitle }
|
{: .subtitle }
|
||||||
|
|
||||||
So you want to build your own Traefik binary from the sources?
|
You want to build your own Traefik binary from the sources?
|
||||||
Let's see how.
|
Let's see how.
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
You need either [Docker](https://github.com/docker/docker) and `make` (Method 1), or `go` (Method 2) in order to build Traefik.
|
You need either [Docker](https://github.com/docker/docker "Link to website of Docker") and `make` (Method 1), or [Go](https://go.dev/ "Link to website of Go") (Method 2) in order to build Traefik.
|
||||||
For changes to its dependencies, the `dep` dependency management tool is required.
|
For changes to its dependencies, the `dep` dependency management tool is required.
|
||||||
|
|
||||||
### Method 1: Using `Docker` and `Makefile`
|
### Method 1: Using `Docker` and `Makefile`
|
||||||
|
|
||||||
Run make with the `binary` target.
|
Run make with the `binary` target.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make binary
|
||||||
|
```
|
||||||
|
|
||||||
This will create binaries for the Linux platform in the `dist` folder.
|
This will create binaries for the Linux platform in the `dist` folder.
|
||||||
|
|
||||||
In case when you run build on CI, you may probably want to run docker in non-interactive mode. To achieve that define `DOCKER_NON_INTERACTIVE=true` environment variable.
|
In case when you run build on CI, you may probably want to run docker in non-interactive mode. To achieve that define `DOCKER_NON_INTERACTIVE=true` environment variable.
|
||||||
@@ -160,7 +165,7 @@ TESTFLAGS="-check.f MyTestSuite.My" make test-integration
|
|||||||
TESTFLAGS="-check.f MyTestSuite.*Test" make test-integration
|
TESTFLAGS="-check.f MyTestSuite.*Test" make test-integration
|
||||||
```
|
```
|
||||||
|
|
||||||
More: https://labix.org/gocheck
|
Check [gocheck](https://labix.org/gocheck "Link to website of gocheck") for more information.
|
||||||
|
|
||||||
### Method 2: `go`
|
### Method 2: `go`
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@ Understanding How Traefik is Being Used
|
|||||||
## Configuration Example
|
## Configuration Example
|
||||||
|
|
||||||
Understanding how you use Traefik is very important to us: it helps us improve the solution in many different ways.
|
Understanding how you use Traefik is very important to us: it helps us improve the solution in many different ways.
|
||||||
For this very reason, the sendAnonymousUsage option is mandatory: we want you to take time to consider whether or not you wish to share anonymous data with us so we can benefit from your experience and use cases.
|
For this very reason, the sendAnonymousUsage option is mandatory: we want you to take time to consider whether or not you wish to share anonymous data with us, so we can benefit from your experience and use cases.
|
||||||
|
|
||||||
!!! example "Enabling Data Collection"
|
!!! example "Enabling Data Collection"
|
||||||
|
|
||||||
@@ -34,9 +34,7 @@ For this very reason, the sendAnonymousUsage option is mandatory: we want you to
|
|||||||
|
|
||||||
## Collected Data
|
## Collected Data
|
||||||
|
|
||||||
This feature comes from the public proposal [here](https://github.com/traefik/traefik/issues/2369).
|
This feature comes from this [public proposal](https://github.com/traefik/traefik/issues/2369).
|
||||||
|
|
||||||
This feature is activated when using Traefik Pilot to better understand the community's need, and also to get information about plug-ins popularity.
|
|
||||||
|
|
||||||
In order to help us learn more about how Traefik is being used and improve it, we collect anonymous usage statistics from running instances.
|
In order to help us learn more about how Traefik is being used and improve it, we collect anonymous usage statistics from running instances.
|
||||||
Those data help us prioritize our developments and focus on what's important for our users (for example, which provider is popular, and which is not).
|
Those data help us prioritize our developments and focus on what's important for our users (for example, which provider is popular, and which is not).
|
||||||
@@ -47,7 +45,7 @@ Once a day (the first call begins 10 minutes after the start of Traefik), we col
|
|||||||
|
|
||||||
- the Traefik version number
|
- the Traefik version number
|
||||||
- a hash of the configuration
|
- a hash of the configuration
|
||||||
- an **anonymized version** of the static configuration (token, user name, password, URL, IP, domain, email, etc, are removed).
|
- an **anonymized version** of the static configuration (token, username, password, URL, IP, domain, email, etc., are removed).
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
|
|
||||||
@@ -68,7 +66,6 @@ providers:
|
|||||||
docker:
|
docker:
|
||||||
endpoint: "tcp://10.10.10.10:2375"
|
endpoint: "tcp://10.10.10.10:2375"
|
||||||
exposedByDefault: true
|
exposedByDefault: true
|
||||||
swarmMode: true
|
|
||||||
|
|
||||||
tls:
|
tls:
|
||||||
ca: dockerCA
|
ca: dockerCA
|
||||||
@@ -88,7 +85,6 @@ providers:
|
|||||||
docker:
|
docker:
|
||||||
endpoint: "xxxx"
|
endpoint: "xxxx"
|
||||||
exposedByDefault: true
|
exposedByDefault: true
|
||||||
swarmMode: true
|
|
||||||
|
|
||||||
tls:
|
tls:
|
||||||
ca: xxxx
|
ca: xxxx
|
||||||
@@ -101,4 +97,4 @@ providers:
|
|||||||
|
|
||||||
If you want to dig into more details, here is the source code of the collecting system: [collector.go](https://github.com/traefik/traefik/blob/master/pkg/collector/collector.go)
|
If you want to dig into more details, here is the source code of the collecting system: [collector.go](https://github.com/traefik/traefik/blob/master/pkg/collector/collector.go)
|
||||||
|
|
||||||
By default we anonymize all configuration fields, except fields tagged with `export=true`.
|
By default, we anonymize all configuration fields, except fields tagged with `export=true`.
|
||||||
|
@@ -15,10 +15,14 @@ Let's see how.
|
|||||||
|
|
||||||
### General
|
### General
|
||||||
|
|
||||||
This [documentation](https://doc.traefik.io/traefik/) is built with [mkdocs](https://mkdocs.org/).
|
This [documentation](https://doc.traefik.io/traefik/ "Link to the official Traefik documentation") is built with [MkDocs](https://mkdocs.org/ "Link to website of MkDocs").
|
||||||
|
|
||||||
### Method 1: `Docker` and `make`
|
### Method 1: `Docker` and `make`
|
||||||
|
|
||||||
|
Please make sure you have the following requirements installed:
|
||||||
|
|
||||||
|
- [Docker](https://www.docker.com/ "Link to website of Docker")
|
||||||
|
|
||||||
You can build the documentation and test it locally (with live reloading), using the `docs-serve` target:
|
You can build the documentation and test it locally (with live reloading), using the `docs-serve` target:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -43,9 +47,12 @@ $ make docs-build
|
|||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
### Method 2: `mkdocs`
|
### Method 2: `MkDocs`
|
||||||
|
|
||||||
First, make sure you have `python` and `pip` installed.
|
Please make sure you have the following requirements installed:
|
||||||
|
|
||||||
|
- [Python](https://www.python.org/ "Link to website of Python")
|
||||||
|
- [pip](https://pypi.org/project/pip/ "Link to the website of pip on PyPI")
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ python --version
|
$ python --version
|
||||||
@@ -54,7 +61,7 @@ $ pip --version
|
|||||||
pip 1.5.2
|
pip 1.5.2
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, install mkdocs with `pip`.
|
Then, install MkDocs with `pip`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install --user -r requirements.txt
|
pip install --user -r requirements.txt
|
||||||
@@ -87,7 +94,7 @@ Running ["HtmlCheck", "ImageCheck", "ScriptCheck", "LinkCheck"] on /app/site/bas
|
|||||||
|
|
||||||
!!! note "Clean & Verify"
|
!!! note "Clean & Verify"
|
||||||
|
|
||||||
If you've made changes to the documentation, it's safter to clean it before verifying it.
|
If you've made changes to the documentation, it's safer to clean it before verifying it.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make docs
|
$ make docs
|
||||||
|
@@ -11,7 +11,7 @@ Note: the document is a work in progress.
|
|||||||
|
|
||||||
Welcome to the Traefik Community.
|
Welcome to the Traefik Community.
|
||||||
This document describes how to be part of the core team
|
This document describes how to be part of the core team
|
||||||
as well as various responsibilities
|
together with various responsibilities
|
||||||
and guidelines for Traefik maintainers.
|
and guidelines for Traefik maintainers.
|
||||||
We are strongly promoting a philosophy of openness and sharing,
|
We are strongly promoting a philosophy of openness and sharing,
|
||||||
and firmly standing against the elitist closed approach.
|
and firmly standing against the elitist closed approach.
|
||||||
@@ -20,7 +20,7 @@ and wants to be part of that journey!
|
|||||||
|
|
||||||
## Onboarding Process
|
## Onboarding Process
|
||||||
|
|
||||||
If you consider joining our community please drop us a line using Twitter or leave a note in the issue.
|
If you consider joining our community, please drop us a line using Twitter or leave a note in the issue.
|
||||||
We will schedule a quick call to meet you and learn more about your motivation.
|
We will schedule a quick call to meet you and learn more about your motivation.
|
||||||
During the call, the team will discuss the process of becoming a maintainer.
|
During the call, the team will discuss the process of becoming a maintainer.
|
||||||
We will be happy to answer any questions and explain all your doubts.
|
We will be happy to answer any questions and explain all your doubts.
|
||||||
@@ -53,7 +53,7 @@ but we can suggest you start with activities such as:
|
|||||||
Each of the issues that are labeled as bug/possible bug/confirmed requires a reproducible use case.
|
Each of the issues that are labeled as bug/possible bug/confirmed requires a reproducible use case.
|
||||||
You can help in creating a reproducible use case if it has not been added to the issue
|
You can help in creating a reproducible use case if it has not been added to the issue
|
||||||
or use the sample code provided by the reporter.
|
or use the sample code provided by the reporter.
|
||||||
Typically, a simple docker compose should be enough to reproduce the issue.
|
Typically, a simple Docker Compose should be enough to reproduce the issue.
|
||||||
- Code contribution.
|
- Code contribution.
|
||||||
- Documentation contribution.
|
- Documentation contribution.
|
||||||
- Technical documentation is one of the most important components of the product.
|
- Technical documentation is one of the most important components of the product.
|
||||||
@@ -61,7 +61,7 @@ but we can suggest you start with activities such as:
|
|||||||
using the official documentation,
|
using the official documentation,
|
||||||
is a game changer.
|
is a game changer.
|
||||||
- You will be listed on our Maintainers GitHub page
|
- You will be listed on our Maintainers GitHub page
|
||||||
as well as on our website in the section [maintainers](maintainers.md).
|
and on our website in the section [maintainers](maintainers.md).
|
||||||
- We will be promoting you on social channels (mostly on Twitter).
|
- We will be promoting you on social channels (mostly on Twitter).
|
||||||
|
|
||||||
## Governance
|
## Governance
|
||||||
@@ -114,7 +114,7 @@ maintainers' activity and involvement will be reviewed on a regular basis.
|
|||||||
- Be open-minded and respectful with other maintainers and other community members.
|
- Be open-minded and respectful with other maintainers and other community members.
|
||||||
- Keep the communication public -
|
- Keep the communication public -
|
||||||
if anyone tries to communicate with you directly,
|
if anyone tries to communicate with you directly,
|
||||||
ask him politely to move the conversation to a public communication channel.
|
ask politely to move the conversation to a public communication channel.
|
||||||
- Stay away from defensive comments.
|
- Stay away from defensive comments.
|
||||||
- Please try to express your thoughts clearly enough
|
- Please try to express your thoughts clearly enough
|
||||||
and note that some of us are not native English speakers.
|
and note that some of us are not native English speakers.
|
||||||
@@ -122,7 +122,7 @@ maintainers' activity and involvement will be reviewed on a regular basis.
|
|||||||
none of us is able to predict your thoughts.
|
none of us is able to predict your thoughts.
|
||||||
- There are a lot of use cases of using Traefik
|
- There are a lot of use cases of using Traefik
|
||||||
and even more issues that are difficult to reproduce.
|
and even more issues that are difficult to reproduce.
|
||||||
If the issue can’t be replicated due to a lack of reproducible case (a simple docker compose should be enough) -
|
If the issue can’t be replicated due to a lack of reproducible case (a simple Docker Compose should be enough) -
|
||||||
set your time limits while working on the issue
|
set your time limits while working on the issue
|
||||||
and express clearly that you were not able to replicate it.
|
and express clearly that you were not able to replicate it.
|
||||||
You can come back later to that case.
|
You can come back later to that case.
|
||||||
|
@@ -107,7 +107,6 @@ The `status/*` labels represent the desired state in the workflow.
|
|||||||
* `area/provider/kv`: KV related.
|
* `area/provider/kv`: KV related.
|
||||||
* `area/provider/marathon`: Marathon related.
|
* `area/provider/marathon`: Marathon related.
|
||||||
* `area/provider/mesos`: Mesos related.
|
* `area/provider/mesos`: Mesos related.
|
||||||
* `area/provider/rancher`: Rancher related.
|
|
||||||
* `area/provider/servicefabric`: Azure service fabric related.
|
* `area/provider/servicefabric`: Azure service fabric related.
|
||||||
* `area/provider/zk`: Zoo Keeper related.
|
* `area/provider/zk`: Zoo Keeper related.
|
||||||
* `area/rules`: Rules related.
|
* `area/rules`: Rules related.
|
||||||
|
@@ -12,7 +12,7 @@ Issues are perfect for requesting a feature/enhancement or reporting a suspected
|
|||||||
We use the [GitHub issue tracker](https://github.com/traefik/traefik/issues) to keep track of issues in Traefik.
|
We use the [GitHub issue tracker](https://github.com/traefik/traefik/issues) to keep track of issues in Traefik.
|
||||||
|
|
||||||
The process of sorting and checking the issues is a daunting task, and requires a lot of work (more than an hour a day ... just for sorting).
|
The process of sorting and checking the issues is a daunting task, and requires a lot of work (more than an hour a day ... just for sorting).
|
||||||
To help us (and other community members) quickly and easily understand what you need,
|
To help us (and other community members) quickly and effortlessly understand what you need,
|
||||||
be sure to follow the guidelines below.
|
be sure to follow the guidelines below.
|
||||||
|
|
||||||
!!! important "Getting Help Vs Reporting an Issue"
|
!!! important "Getting Help Vs Reporting an Issue"
|
||||||
@@ -40,9 +40,10 @@ Follow the [issue template](https://github.com/traefik/traefik/blob/master/.gith
|
|||||||
|
|
||||||
Do your best to explain what you're looking for, and why it would improve Traefik for everyone.
|
Do your best to explain what you're looking for, and why it would improve Traefik for everyone.
|
||||||
Be detailed and share the use-case(s) to allow us to see the value of your feature request as quickly as possible.
|
Be detailed and share the use-case(s) to allow us to see the value of your feature request as quickly as possible.
|
||||||
|
|
||||||
Features with a lot of positive interaction (claps, +1s, conversation about how this would impact them) indicate higher community interest and help us to prioritize.
|
Features with a lot of positive interaction (claps, +1s, conversation about how this would impact them) indicate higher community interest and help us to prioritize.
|
||||||
|
|
||||||
If you are interested in creating a PR for your feature request, let us know in the the issue so we can work with you.
|
If you are interested in creating a PR for your feature request, let us know in the issue, so we can work with you.
|
||||||
It can take a lot of work to make sure a PR can integrate with our existing code and planning with the team ahead of time can make sure that your PR can be accepted and merged quickly.
|
It can take a lot of work to make sure a PR can integrate with our existing code and planning with the team ahead of time can make sure that your PR can be accepted and merged quickly.
|
||||||
|
|
||||||
## Issues or Possible Bug Reports
|
## Issues or Possible Bug Reports
|
||||||
@@ -50,13 +51,13 @@ It can take a lot of work to make sure a PR can integrate with our existing code
|
|||||||
Follow the [issue template](https://github.com/traefik/traefik/blob/master/.github/ISSUE_TEMPLATE/bug_report.yml) as much as possible.
|
Follow the [issue template](https://github.com/traefik/traefik/blob/master/.github/ISSUE_TEMPLATE/bug_report.yml) as much as possible.
|
||||||
|
|
||||||
Explain the conditions in which you encountered the issue; what is your context?
|
Explain the conditions in which you encountered the issue; what is your context?
|
||||||
Share any logs you may have and make sure to share the steps it takes to reproduce your issue or bug.
|
Share any logs you may have, and make sure to share the steps it takes to reproduce your issue or bug.
|
||||||
|
|
||||||
Remain as clear and concise as possible.
|
Remain as clear and concise as possible.
|
||||||
|
|
||||||
Take time to polish the format of your message so we'll enjoy reading it and working on it.
|
Take time to polish the format of your message, so we'll enjoy reading it and working on it.
|
||||||
Help your readers focus on what matters and help them understand the structure of your message (see the [GitHub Markdown Syntax](https://docs.github.com/en/get-started/writing-on-github)).
|
Help your readers focus on what matters and help them understand the structure of your message (see the [GitHub Markdown Syntax](https://docs.github.com/en/get-started/writing-on-github)).
|
||||||
|
|
||||||
## International English
|
## International English
|
||||||
|
|
||||||
Every maintainer / Traefik user is not a native English speaker, so if you feel sometimes that some messages sound rude, remember that it probably is a language barrier problem from someone willing to help you.
|
Every maintainer / Traefik user is not a native English speaker, so if you sometimes feel that some messages sound rude, remember that it probably is a language barrier problem from someone willing to help you.
|
||||||
|
@@ -20,7 +20,7 @@ or the list of [confirmed bugs](https://github.com/traefik/traefik/labels/kind%2
|
|||||||
We wish we could review every pull request right away.
|
We wish we could review every pull request right away.
|
||||||
Unfortunately, our team has to prioritize pull requests (PRs) for review
|
Unfortunately, our team has to prioritize pull requests (PRs) for review
|
||||||
(but we are welcoming new [maintainers](https://github.com/traefik/traefik/blob/master/docs/content/contributing/maintainers-guidelines.md) to speed this up,
|
(but we are welcoming new [maintainers](https://github.com/traefik/traefik/blob/master/docs/content/contributing/maintainers-guidelines.md) to speed this up,
|
||||||
so if you are interested, check it out and apply).
|
if you are interested, check it out and apply).
|
||||||
|
|
||||||
The PRs we are able to handle fastest are:
|
The PRs we are able to handle fastest are:
|
||||||
|
|
||||||
@@ -38,11 +38,11 @@ and tell us you are interested in writing the PR.
|
|||||||
If an issue already exists, definitely comment on it to tell us you are interested in creating a PR.
|
If an issue already exists, definitely comment on it to tell us you are interested in creating a PR.
|
||||||
|
|
||||||
This will allow us to communicate directly and let you know if it is something we would accept.
|
This will allow us to communicate directly and let you know if it is something we would accept.
|
||||||
|
|
||||||
It also allows us to make sure you have all the information you need during the design phase
|
It also allows us to make sure you have all the information you need during the design phase
|
||||||
so that it can be reviewed and merged quickly.
|
so that it can be reviewed and merged quickly.
|
||||||
|
|
||||||
If you have questions about the Triage process,
|
Read more about the [Triage process](https://github.com/traefik/contributors-guide/blob/master/issue_triage.md) in the docs.
|
||||||
[read more here](https://github.com/traefik/contributors-guide/blob/master/issue_triage.md).
|
|
||||||
|
|
||||||
## The Pull Request Submit Process
|
## The Pull Request Submit Process
|
||||||
|
|
||||||
@@ -56,14 +56,15 @@ Merging a PR requires the following steps to be completed before it is merged au
|
|||||||
* Do not open the PR from an organization repository.
|
* Do not open the PR from an organization repository.
|
||||||
* Keep "allows edit from maintainer" checked.
|
* Keep "allows edit from maintainer" checked.
|
||||||
* Use semantic line breaks for documentation.
|
* Use semantic line breaks for documentation.
|
||||||
|
* Ensure your PR is not a draft. We do not review drafts, but do answer questions and confer with developers on them as needed.
|
||||||
* Pass the validation check.
|
* Pass the validation check.
|
||||||
* Pass all tests.
|
* Pass all tests.
|
||||||
* Receive 3 approving reviews maintainers.
|
* Receive 3 approving reviews maintainers.
|
||||||
|
|
||||||
## Pull Request Review Cycle
|
## Pull Request Review Cycle
|
||||||
|
|
||||||
You can read about our Triage Process [here](https://github.com/traefik/contributors-guide/blob/master/issue_triage.md),
|
Learn about our [Triage Process](https://github.com/traefik/contributors-guide/blob/master/issue_triage.md),
|
||||||
but in short, it looks like this:
|
in short, it looks like this:
|
||||||
|
|
||||||
* We triage every new PR or comment before entering it into the review process.
|
* We triage every new PR or comment before entering it into the review process.
|
||||||
* We ensure that all prerequisites for review have been met.
|
* We ensure that all prerequisites for review have been met.
|
||||||
@@ -131,12 +132,12 @@ Part of this goal is maintaining a lean codebase and ensuring code velocity.
|
|||||||
unfortunately, this means that sometimes we will not be able to merge a pull request.
|
unfortunately, this means that sometimes we will not be able to merge a pull request.
|
||||||
|
|
||||||
Because we respect the work you did, you will always be told why we are closing your pull request.
|
Because we respect the work you did, you will always be told why we are closing your pull request.
|
||||||
If you do not agree with our decision, do not worry; closed pull requests are easy to recreate,
|
If you do not agree with our decision, do not worry; closed pull requests are effortless to recreate,
|
||||||
and little work is lost by closing a pull request that subsequently needs to be reopened.
|
and little work is lost by closing a pull request that subsequently needs to be reopened.
|
||||||
|
|
||||||
Your pull request might be closed if:
|
Your pull request might be closed if:
|
||||||
|
|
||||||
* Your PR's design conflicts with our existing codebase in such a way that Merging is not an option
|
* Your PR's design conflicts with our existing codebase in such a way that merging is not an option
|
||||||
and the work needed to make your pull request usable is too high.
|
and the work needed to make your pull request usable is too high.
|
||||||
* To prevent this, make sure you created an issue first
|
* To prevent this, make sure you created an issue first
|
||||||
and think about including Traefik Proxy maintainers in your design phase to minimize conflicts.
|
and think about including Traefik Proxy maintainers in your design phase to minimize conflicts.
|
||||||
@@ -151,7 +152,7 @@ A few factors affect how long your pull request might wait for review.
|
|||||||
|
|
||||||
We must prioritize which PRs we focus on.
|
We must prioritize which PRs we focus on.
|
||||||
Our first priority is PRs we have identified as having high community engagement and broad applicability.
|
Our first priority is PRs we have identified as having high community engagement and broad applicability.
|
||||||
We put our top priorities on our roadmap and you can identify them by the `contributor/wanted` tag.
|
We put our top priorities on our roadmap, and you can identify them by the `contributor/wanted` tag.
|
||||||
These PRs will enter our review process the fastest.
|
These PRs will enter our review process the fastest.
|
||||||
|
|
||||||
Our second priority is bug fixes.
|
Our second priority is bug fixes.
|
||||||
@@ -159,7 +160,7 @@ Especially for bugs that have already been tagged with `bug/confirmed`.
|
|||||||
These reviews enter the process quickly.
|
These reviews enter the process quickly.
|
||||||
|
|
||||||
If your PR does not meet the criteria above,
|
If your PR does not meet the criteria above,
|
||||||
it will take longer for us to review as any PRs that do meet the criteria above will be prioritized.
|
it will take longer for us to review, as any PRs that do meet the criteria above will be prioritized.
|
||||||
|
|
||||||
Additionally, during the last few weeks of a milestone, we stop reviewing PRs to reduce churn and stabilize.
|
Additionally, during the last few weeks of a milestone, we stop reviewing PRs to reduce churn and stabilize.
|
||||||
We will resume after the release.
|
We will resume after the release.
|
||||||
@@ -185,7 +186,7 @@ The most common failures to follow best practices are:
|
|||||||
|
|
||||||
Please remember that we are working internationally, cross-culturally, and with different use-cases.
|
Please remember that we are working internationally, cross-culturally, and with different use-cases.
|
||||||
Your reviewer will not intuitively understand the problem the same way you do or solve it the same way you would.
|
Your reviewer will not intuitively understand the problem the same way you do or solve it the same way you would.
|
||||||
This is why every change you make must be explained and your strategy for coding must also be explained.
|
This is why every change you make must be explained, and your strategy for coding must also be explained.
|
||||||
|
|
||||||
* Your tests were inadequate or absent.
|
* Your tests were inadequate or absent.
|
||||||
* If you do not know how to test your PR, please ask!
|
* If you do not know how to test your PR, please ask!
|
||||||
@@ -227,4 +228,4 @@ but you should answer reasonable comments with an explanation.
|
|||||||
|
|
||||||
No document can take the place of common sense and good taste.
|
No document can take the place of common sense and good taste.
|
||||||
Use your best judgment, while you put a bit of thought into how your work can be made easier to review.
|
Use your best judgment, while you put a bit of thought into how your work can be made easier to review.
|
||||||
If you do these things your pull requests will get merged with less friction.
|
If you do these things, your pull requests will get merged with less friction.
|
||||||
|
@@ -2,27 +2,22 @@
|
|||||||
|
|
||||||
This page is maintained and updated periodically to reflect our roadmap and any decisions around feature deprecation.
|
This page is maintained and updated periodically to reflect our roadmap and any decisions around feature deprecation.
|
||||||
|
|
||||||
| Feature | Deprecated | End of Support | Removal |
|
| Feature | Deprecated | End of Support | Removal |
|
||||||
|-------------------------------------------------------------|------------|----------------|---------|
|
|----------------------------------------------------------------------------------------------------------------------|------------|----------------|---------|
|
||||||
| [Pilot](#pilot) | 2.7 | 2.8 | 2.9 |
|
| [Kubernetes CRDs API Version `traefik.io/v1alpha1`](#kubernetes-crds-api-version-traefikiov1alpha1) | N/A | N/A | 3.0 |
|
||||||
| [Consul Enterprise Namespace](#consul-enterprise-namespace) | 2.8 | N/A | 3.0 |
|
| [Kubernetes Ingress API Version `networking.k8s.io/v1beta1`](#kubernetes-ingress-api-version-networkingk8siov1beta1) | N/A | N/A | 3.0 |
|
||||||
| [TLS 1.0 and 1.1 Support](#tls-10-and-11) | N/A | 2.8 | N/A |
|
| [CRD API Version `apiextensions.k8s.io/v1beta1`](#kubernetes-ingress-api-version-networkingk8siov1beta1) | N/A | N/A | 3.0 |
|
||||||
|
|
||||||
## Impact
|
## Impact
|
||||||
|
|
||||||
### Pilot
|
### Kubernetes CRDs API Version `traefik.io/v1alpha1`
|
||||||
|
|
||||||
Metrics will continue to function normally up to 2.8, when they will be disabled.
|
The newly introduced Kubernetes CRD API Version `traefik.io/v1alpha1` will subsequently be removed in Traefik v3. The following version will be `traefik.io/v1`.
|
||||||
In 2.9, the Pilot platform and all Traefik integration code will be permanently removed.
|
|
||||||
|
|
||||||
Starting on 2.7 the pilot token will not be a requirement anymore for plugins.
|
### Kubernetes Ingress API Version `networking.k8s.io/v1beta1`
|
||||||
Since 2.8, a [new plugin catalog](https://plugins.traefik.io) is available, decoupled from Pilot.
|
|
||||||
|
|
||||||
### Consul Enterprise Namespace
|
The Kubernetes Ingress API Version `networking.k8s.io/v1beta1` is removed in v3. Please use the API Group `networking.k8s.io/v1` instead.
|
||||||
|
|
||||||
Starting on 2.8 the `namespace` option of Consul and Consul Catalog providers is deprecated,
|
### Traefik CRD API Version `apiextensions.k8s.io/v1beta1`
|
||||||
please use the `namespaces` options instead.
|
|
||||||
|
|
||||||
### TLS 1.0 and 1.1
|
The Traefik CRD API Version `apiextensions.k8s.io/v1beta1` is removed in v3. Please use the API Group `apiextensions.k8s.io/v1` instead.
|
||||||
|
|
||||||
Starting on 2.8 the default TLS options will use the minimum version of TLS 1.2. Of course, it can still be overridden with custom configuration.
|
|
||||||
|
@@ -6,7 +6,8 @@ Below is a non-exhaustive list of versions and their maintenance status:
|
|||||||
|
|
||||||
| Version | Release Date | Active Support | Security Support |
|
| Version | Release Date | Active Support | Security Support |
|
||||||
|---------|--------------|--------------------|------------------|
|
|---------|--------------|--------------------|------------------|
|
||||||
| 2.9 | Oct 03, 2022 | Yes | Yes |
|
| 2.10 | Apr 24, 2023 | Yes | Yes |
|
||||||
|
| 2.9 | Oct 03, 2022 | Ended Apr 24, 2023 | No |
|
||||||
| 2.8 | Jun 29, 2022 | Ended Oct 03, 2022 | No |
|
| 2.8 | Jun 29, 2022 | Ended Oct 03, 2022 | No |
|
||||||
| 2.7 | May 24, 2022 | Ended Jun 29, 2022 | No |
|
| 2.7 | May 24, 2022 | Ended Jun 29, 2022 | No |
|
||||||
| 2.6 | Jan 24, 2022 | Ended May 24, 2022 | No |
|
| 2.6 | Jan 24, 2022 | Ended May 24, 2022 | No |
|
||||||
|
@@ -1,19 +1,34 @@
|
|||||||
---
|
---
|
||||||
title: "Traefik Concepts Documentation"
|
title: Concepts
|
||||||
description: "Get started with Traefik Proxy. Read the technical documentation for an introduction into the key concepts behind our open source edge router."
|
description: Traefik - base concepts and main features
|
||||||
---
|
---
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
Everything You Need to Know
|
This page explains the base concepts of Traefik.
|
||||||
{: .subtitle }
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
Traefik is based on the concept of EntryPoints, Routers, Middlewares and Services.
|
||||||
|
|
||||||
|
The main features include dynamic configuration, automatic service discovery, and support for multiple backends and protocols.
|
||||||
|
|
||||||
|
1. [EntryPoints](../routing/entrypoints.md "Link to docs about EntryPoints"): EntryPoints are the network entry points into Traefik. They define the port which will receive the packets, and whether to listen for TCP or UDP.
|
||||||
|
|
||||||
|
2. [Routers](../routing/routers/index.md "Link to docs about routers"): A router is in charge of connecting incoming requests to the services that can handle them.
|
||||||
|
|
||||||
|
3. [Middlewares](../middlewares/overview.md "Link to docs about middlewares"): Attached to the routers, middlewares can modify the requests or responses before they are sent to your service
|
||||||
|
|
||||||
|
4. [Services](../routing/services/index.md "Link to docs about services"): Services are responsible for configuring how to reach the actual services that will eventually handle the incoming requests.
|
||||||
|
|
||||||
## Edge Router
|
## Edge Router
|
||||||
|
|
||||||
Traefik is an _Edge Router_, it means that it's the door to your platform, and that it intercepts and routes every incoming request:
|
Traefik is an *Edge Router*, it means that it's the door to your platform, and that it intercepts and routes every incoming request:
|
||||||
it knows all the logic and every rule that determine which services handle which requests (based on the [path](../routing/routers/index.md#rule), the [host](../routing/routers/index.md#rule), [headers](../routing/routers/index.md#rule), [and so on](../routing/routers/index.md#rule) ...).
|
it knows all the logic and every [rule](../routing/routers/index.md#rule "Link to docs about routing rules") that determine which services handle which requests (based on the *path*, the *host*, *headers*, etc.).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Auto Service Discovery
|
## Auto Service Discovery
|
||||||
|
|
||||||
@@ -21,7 +36,7 @@ Where traditionally edge routers (or reverse proxies) need a configuration file
|
|||||||
|
|
||||||
Deploying your services, you attach information that tells Traefik the characteristics of the requests the services can handle.
|
Deploying your services, you attach information that tells Traefik the characteristics of the requests the services can handle.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
It means that when a service is deployed, Traefik detects it immediately and updates the routing rules in real time.
|
It means that when a service is deployed, Traefik detects it immediately and updates the routing rules in real time.
|
||||||
Similarly, when a service is removed from the infrastructure, the corresponding route is deleted accordingly.
|
Similarly, when a service is removed from the infrastructure, the corresponding route is deleted accordingly.
|
||||||
@@ -30,14 +45,16 @@ You no longer need to create and synchronize configuration files cluttered with
|
|||||||
|
|
||||||
!!! info "Many different rules"
|
!!! info "Many different rules"
|
||||||
|
|
||||||
In the example above, we used the request [path](../routing/routers/index.md#rule) to determine which service was in charge, but of course you can use many other different [rules](../routing/routers/index.md#rule).
|
In the example above, we used the request [path rule](../routing/routers/index.md#rule "Link to docs about routing rules") to determine which service was in charge.
|
||||||
|
Certainly, you can use many other different [rules](../routing/routers/index.md#rule "Link to docs about routing rules").
|
||||||
|
|
||||||
!!! info "Updating the requests"
|
!!! info "Updating the requests"
|
||||||
|
|
||||||
In the [middleware](../middlewares/overview.md) section, you can learn about how to update the requests before forwarding them to the services.
|
In the [middleware](../middlewares/overview.md "Link to middleware documentation") section, you can learn about how to update the requests before forwarding them to the services.
|
||||||
|
|
||||||
!!! question "How does Traefik discover the services?"
|
!!! question "How does Traefik discover the services?"
|
||||||
|
|
||||||
Traefik is able to use your cluster API to discover the services and read the attached information. In Traefik, these connectors are called [providers](../providers/overview.md) because they _provide_ the configuration to Traefik. To learn more about them, read the [provider overview](../providers/overview.md) section.
|
Traefik is able to use your cluster API to discover the services and read the attached information.
|
||||||
|
In Traefik, these connectors are called [providers](../providers/overview.md "Link to overview about Traefik providers") because they *provide* the configuration to Traefik.
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
@@ -79,7 +79,7 @@ traefik --help
|
|||||||
# or
|
# or
|
||||||
|
|
||||||
docker run traefik[:version] --help
|
docker run traefik[:version] --help
|
||||||
# ex: docker run traefik:v2.9 --help
|
# ex: docker run traefik:v3.0 --help
|
||||||
```
|
```
|
||||||
|
|
||||||
All available arguments can also be found [here](../reference/static-configuration/cli.md).
|
All available arguments can also be found [here](../reference/static-configuration/cli.md).
|
||||||
|
@@ -158,6 +158,56 @@ By default, the following headers are automatically added when proxying requests
|
|||||||
For more details,
|
For more details,
|
||||||
please check out the [forwarded header](../routing/entrypoints.md#forwarded-headers) documentation.
|
please check out the [forwarded header](../routing/entrypoints.md#forwarded-headers) documentation.
|
||||||
|
|
||||||
|
## How Traefik is Storing and Serving TLS Certificates?
|
||||||
|
|
||||||
|
### Storing TLS Certificates
|
||||||
|
|
||||||
|
[TLS](../https/tls.md "Link to Traefik TLS docs") certificates are either provided directly by the [dynamic configuration](./configuration-overview.md#the-dynamic-configuration "Link to dynamic configuration overview") from [providers](../https/tls.md#user-defined "Link to the TLS configuration"),
|
||||||
|
or by [ACME resolvers](../https/acme.md#providers "Link to ACME resolvers"), which act themselves as providers internally.
|
||||||
|
|
||||||
|
For each TLS certificate, Traefik produces an identifier used as a key to store it.
|
||||||
|
This identifier is constructed as the alphabetically ordered concatenation of the SANs `DNSNames` and `IPAddresses` of the TLScertificate.
|
||||||
|
|
||||||
|
#### Examples:
|
||||||
|
|
||||||
|
| X509v3 Subject Alternative Name | TLS Certificate Identifier |
|
||||||
|
|-----------------------------------------|-----------------------------|
|
||||||
|
| `DNS:example.com, IP Address:127.0.0.1` | `127.0.0.1,example.com` |
|
||||||
|
| `DNS:example.com, DNS:*.example.com` | `*.example.com,example.com` |
|
||||||
|
|
||||||
|
The identifier is used to store TLS certificates in order to be later used to handle TLS connections.
|
||||||
|
This operation happens each time there are configuration changes.
|
||||||
|
|
||||||
|
If multiple TLS certificates are provided with the same SANs definition (same identifier), only the one processed first is kept.
|
||||||
|
Because the dynamic configuration is aggregated from all providers,
|
||||||
|
when processing it to gather TLS certificates,
|
||||||
|
there is no guarantee of the order in which they would be processed.
|
||||||
|
This means that along with configurations applied, it is possible that the TLS certificate retained for a given identifier differs.
|
||||||
|
|
||||||
|
### Serving TLS Certificates
|
||||||
|
|
||||||
|
For each incoming connection, Traefik is serving the "best" matching TLS certificate for the provided server name.
|
||||||
|
|
||||||
|
The TLS certificate selection process narrows down the list of TLS certificates matching the server name,
|
||||||
|
and then selects the last TLS certificate in this list after having ordered it by the identifier alphabetically.
|
||||||
|
|
||||||
|
#### Examples:
|
||||||
|
|
||||||
|
| Selected TLS Certificates Identifiers | Sorted TLS Certificates Identifiers | Served Certificate Identifier |
|
||||||
|
|-----------------------------------------------------|-----------------------------------------------------|-------------------------------|
|
||||||
|
| `127.0.0.1,example.com`,`*.example.com,example.com` | `*.example.com,example.com`,`127.0.0.1,example.com` | `127.0.0.1,example.com` |
|
||||||
|
| `*.example.com,example.com`,`example.com` | `*.example.com,example.com`,`example.com` | `example.com` |
|
||||||
|
|
||||||
|
### Caching TLS Certificates
|
||||||
|
|
||||||
|
While Traefik is serving the best matching TLS certificate for each incoming connection,
|
||||||
|
the selection process cost for each incoming connection is avoided thanks to a cache mechanism.
|
||||||
|
|
||||||
|
Once a TLS certificate has been selected as the "best" TLS certificate for a server name,
|
||||||
|
it is cached for an hour, avoiding the selection process for further connections.
|
||||||
|
|
||||||
|
Nonetheless, when a new configuration is applied, the cache is reset.
|
||||||
|
|
||||||
## What does the "field not found" error mean?
|
## What does the "field not found" error mean?
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -181,3 +231,23 @@ and the message should help in figuring out the mistake(s) in the configuration,
|
|||||||
|
|
||||||
When using the file provider,
|
When using the file provider,
|
||||||
one easy way to check if the dynamic configuration is well-formed is to validate it with the [JSON Schema of the dynamic configuration](https://json.schemastore.org/traefik-v2-file-provider.json).
|
one easy way to check if the dynamic configuration is well-formed is to validate it with the [JSON Schema of the dynamic configuration](https://json.schemastore.org/traefik-v2-file-provider.json).
|
||||||
|
|
||||||
|
## Why does Let's Encrypt wildcard certificate renewal/generation with DNS challenge fail?
|
||||||
|
|
||||||
|
If you're trying to renew wildcard certificates, with DNS challenge,
|
||||||
|
and you're getting errors such as:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
msg="Error renewing certificate from LE: {example.com [*.example.com]}"
|
||||||
|
providerName=letsencrypt.acme error="error: one or more domains had a problem:
|
||||||
|
[example.com] acme: error presenting token: gandiv5: unexpected authZone example.com. for fqdn example.com."
|
||||||
|
```
|
||||||
|
|
||||||
|
then it could be due to `CNAME` support.
|
||||||
|
|
||||||
|
In which case, you should make sure your infrastructure is properly set up for a
|
||||||
|
`DNS` challenge that does not rely on `CNAME`, and you should try disabling `CNAME` support with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
LEGO_DISABLE_CNAME_SUPPORT=true
|
||||||
|
```
|
||||||
|
@@ -16,12 +16,12 @@ You can install Traefik with the following flavors:
|
|||||||
|
|
||||||
Choose one of the [official Docker images](https://hub.docker.com/_/traefik) and run it with one sample configuration file:
|
Choose one of the [official Docker images](https://hub.docker.com/_/traefik) and run it with one sample configuration file:
|
||||||
|
|
||||||
* [YAML](https://raw.githubusercontent.com/traefik/traefik/v2.9/traefik.sample.yml)
|
* [YAML](https://raw.githubusercontent.com/traefik/traefik/v3.0/traefik.sample.yml)
|
||||||
* [TOML](https://raw.githubusercontent.com/traefik/traefik/v2.9/traefik.sample.toml)
|
* [TOML](https://raw.githubusercontent.com/traefik/traefik/v3.0/traefik.sample.toml)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d -p 8080:8080 -p 80:80 \
|
docker run -d -p 8080:8080 -p 80:80 \
|
||||||
-v $PWD/traefik.yml:/etc/traefik/traefik.yml traefik:v2.9
|
-v $PWD/traefik.yml:/etc/traefik/traefik.yml traefik:v3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details, go to the [Docker provider documentation](../providers/docker.md)
|
For more details, go to the [Docker provider documentation](../providers/docker.md)
|
||||||
@@ -29,7 +29,7 @@ For more details, go to the [Docker provider documentation](../providers/docker.
|
|||||||
!!! tip
|
!!! tip
|
||||||
|
|
||||||
* Prefer a fixed version than the latest that could be an unexpected version.
|
* Prefer a fixed version than the latest that could be an unexpected version.
|
||||||
ex: `traefik:v2.9`
|
ex: `traefik:v3.0`
|
||||||
* Docker images are based from the [Alpine Linux Official image](https://hub.docker.com/_/alpine).
|
* Docker images are based from the [Alpine Linux Official image](https://hub.docker.com/_/alpine).
|
||||||
* Any orchestrator using docker images can fetch the official Traefik docker image.
|
* Any orchestrator using docker images can fetch the official Traefik docker image.
|
||||||
|
|
||||||
@@ -44,13 +44,13 @@ Traefik can be installed in Kubernetes using the Helm chart from <https://github
|
|||||||
|
|
||||||
Ensure that the following requirements are met:
|
Ensure that the following requirements are met:
|
||||||
|
|
||||||
* Kubernetes 1.14+
|
* Kubernetes 1.16+
|
||||||
* Helm version 3.x is [installed](https://helm.sh/docs/intro/install/)
|
* Helm version 3.9+ is [installed](https://helm.sh/docs/intro/install/)
|
||||||
|
|
||||||
Add Traefik's chart repository to Helm:
|
Add Traefik Labs chart repository to Helm:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
helm repo add traefik https://helm.traefik.io/traefik
|
helm repo add traefik https://traefik.github.io/charts
|
||||||
```
|
```
|
||||||
|
|
||||||
You can update the chart repository by running:
|
You can update the chart repository by running:
|
||||||
@@ -68,6 +68,9 @@ helm install traefik traefik/traefik
|
|||||||
!!! tip "Helm Features"
|
!!! tip "Helm Features"
|
||||||
|
|
||||||
All [Helm features](https://helm.sh/docs/intro/using_helm/) are supported.
|
All [Helm features](https://helm.sh/docs/intro/using_helm/) are supported.
|
||||||
|
|
||||||
|
Examples are provided [here](https://github.com/traefik/traefik-helm-chart/blob/master/EXAMPLES.md).
|
||||||
|
|
||||||
For instance, installing the chart in a dedicated namespace:
|
For instance, installing the chart in a dedicated namespace:
|
||||||
|
|
||||||
```bash tab="Install in a Dedicated Namespace"
|
```bash tab="Install in a Dedicated Namespace"
|
||||||
@@ -83,8 +86,7 @@ helm install traefik traefik/traefik
|
|||||||
as with [any helm chart](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing).
|
as with [any helm chart](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing).
|
||||||
{: #helm-custom-values }
|
{: #helm-custom-values }
|
||||||
|
|
||||||
The values are not (yet) documented, but are self-explanatory:
|
All parameters are documented in the default [`values.yaml`](https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml).
|
||||||
you can look at the [default `values.yaml`](https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml) file to explore possibilities.
|
|
||||||
|
|
||||||
You can also set Traefik command line flags using `additionalArguments`.
|
You can also set Traefik command line flags using `additionalArguments`.
|
||||||
Example of installation with logging set to `DEBUG`:
|
Example of installation with logging set to `DEBUG`:
|
||||||
@@ -119,7 +121,7 @@ by defining and applying an IngressRoute CRD (`kubectl apply -f dashboard.yaml`)
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# dashboard.yaml
|
# dashboard.yaml
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: dashboard
|
name: dashboard
|
||||||
|
@@ -130,7 +130,7 @@ spec:
|
|||||||
serviceAccountName: traefik-account
|
serviceAccountName: traefik-account
|
||||||
containers:
|
containers:
|
||||||
- name: traefik
|
- name: traefik
|
||||||
image: traefik:v2.9
|
image: traefik:v3.0
|
||||||
args:
|
args:
|
||||||
- --api.insecure
|
- --api.insecure
|
||||||
- --providers.kubernetesingress
|
- --providers.kubernetesingress
|
||||||
@@ -316,3 +316,5 @@ curl -v http://localhost/
|
|||||||
- [Filter the ingresses](../providers/kubernetes-ingress.md#ingressclass) to use with [IngressClass](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class)
|
- [Filter the ingresses](../providers/kubernetes-ingress.md#ingressclass) to use with [IngressClass](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class)
|
||||||
- Use [IngressRoute CRD](../providers/kubernetes-crd.md)
|
- Use [IngressRoute CRD](../providers/kubernetes-crd.md)
|
||||||
- Protect [ingresses with TLS](../routing/providers/kubernetes-ingress.md#enabling-tls-via-annotations)
|
- Protect [ingresses with TLS](../routing/providers/kubernetes-ingress.md#enabling-tls-via-annotations)
|
||||||
|
|
||||||
|
{!traefik-api-management-kubernetes.md!}
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
title: "Traefik Getting Started Quickly"
|
title: "Traefik Getting Started Quickly"
|
||||||
description: "Looking to get started with Traefik Proxy quickly? Read the technical documentation to learn a simple use case that leverages Docker."
|
description: "Looking to get started with Traefik Proxy quickly? Read the technical documentation to see a basic use case that leverages Docker."
|
||||||
---
|
---
|
||||||
|
|
||||||
# Quick Start
|
# Quick Start
|
||||||
|
|
||||||
A Simple Use Case Using Docker
|
A Basic Use Case Using Docker
|
||||||
{: .subtitle }
|
{: .subtitle }
|
||||||
|
|
||||||

|

|
||||||
@@ -19,9 +19,9 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
reverse-proxy:
|
reverse-proxy:
|
||||||
# The official v2 Traefik docker image
|
# The official v3 Traefik Docker image
|
||||||
image: traefik:v2.9
|
image: traefik:v3.0
|
||||||
# Enables the web UI and tells Traefik to listen to docker
|
# Enables the web UI and tells Traefik to listen to Docker
|
||||||
command: --api.insecure=true --providers.docker
|
command: --api.insecure=true --providers.docker
|
||||||
ports:
|
ports:
|
||||||
# The HTTP port
|
# The HTTP port
|
||||||
@@ -50,7 +50,12 @@ Now that we have a Traefik instance up and running, we will deploy new services.
|
|||||||
Edit your `docker-compose.yml` file and add the following at the end of your file.
|
Edit your `docker-compose.yml` file and add the following at the end of your file.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# ...
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
whoami:
|
whoami:
|
||||||
# A container that exposes an API to show its IP address
|
# A container that exposes an API to show its IP address
|
||||||
image: traefik/whoami
|
image: traefik/whoami
|
||||||
@@ -58,7 +63,7 @@ Edit your `docker-compose.yml` file and add the following at the end of your fil
|
|||||||
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
||||||
```
|
```
|
||||||
|
|
||||||
The above defines `whoami`: a simple web service that outputs information about the machine it is deployed on (its IP address, host, and so on).
|
The above defines [`whoami`](https://github.com/traefik/whoami "Link to whoami app on GitHub"), a web service that outputs information about the machine it is deployed on (its IP address, host, etc.).
|
||||||
|
|
||||||
Start the `whoami` service with the following command:
|
Start the `whoami` service with the following command:
|
||||||
|
|
||||||
@@ -66,9 +71,9 @@ Start the `whoami` service with the following command:
|
|||||||
docker-compose up -d whoami
|
docker-compose up -d whoami
|
||||||
```
|
```
|
||||||
|
|
||||||
Go back to your browser (`http://localhost:8080/api/rawdata`) and see that Traefik has automatically detected the new container and updated its own configuration.
|
Browse `http://localhost:8080/api/rawdata` and see that Traefik has automatically detected the new container and updated its own configuration.
|
||||||
|
|
||||||
When Traefik detects new services, it creates the corresponding routes so you can call them ... _let's see!_ (Here, we're using curl)
|
When Traefik detects new services, it creates the corresponding routes, so you can call them ... _let's see!_ (Here, we're using curl)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -H Host:whoami.docker.localhost http://127.0.0.1
|
curl -H Host:whoami.docker.localhost http://127.0.0.1
|
||||||
@@ -90,7 +95,7 @@ Run more instances of your `whoami` service with the following command:
|
|||||||
docker-compose up -d --scale whoami=2
|
docker-compose up -d --scale whoami=2
|
||||||
```
|
```
|
||||||
|
|
||||||
Go back to your browser (`http://localhost:8080/api/rawdata`) and see that Traefik has automatically detected the new instance of the container.
|
Browse to `http://localhost:8080/api/rawdata` and see that Traefik has automatically detected the new instance of the container.
|
||||||
|
|
||||||
Finally, see that Traefik load-balances between the two instances of your service by running the following command twice:
|
Finally, see that Traefik load-balances between the two instances of your service by running the following command twice:
|
||||||
|
|
||||||
@@ -114,6 +119,6 @@ IP: 172.27.0.4
|
|||||||
|
|
||||||
!!! question "Where to Go Next?"
|
!!! question "Where to Go Next?"
|
||||||
|
|
||||||
Now that you have a basic understanding of how Traefik can automatically create the routes to your services and load balance them, it is time to dive into [the documentation](/) and let Traefik work for you!
|
Now that you have a basic understanding of how Traefik can automatically create the routes to your services and load balance them, it is time to dive into [the documentation](/ "Link to the docs landing page") and let Traefik work for you!
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
@@ -11,7 +11,11 @@ Automatic HTTPS
|
|||||||
You can configure Traefik to use an ACME provider (like Let's Encrypt) for automatic certificate generation.
|
You can configure Traefik to use an ACME provider (like Let's Encrypt) for automatic certificate generation.
|
||||||
|
|
||||||
!!! warning "Let's Encrypt and Rate Limiting"
|
!!! warning "Let's Encrypt and Rate Limiting"
|
||||||
Note that Let's Encrypt API has [rate limiting](https://letsencrypt.org/docs/rate-limits).
|
Note that Let's Encrypt API has [rate limiting](https://letsencrypt.org/docs/rate-limits). These last up to __one week__, and can not be overridden.
|
||||||
|
|
||||||
|
When running Traefik in a container this file should be persisted across restarts.
|
||||||
|
If Traefik requests new certificates each time it starts up, a crash-looping container can quickly reach Let's Encrypt's ratelimits.
|
||||||
|
To configure where certificates are stored, please take a look at the [storage](#storage) configuration.
|
||||||
|
|
||||||
Use Let's Encrypt staging server with the [`caServer`](#caserver) configuration option
|
Use Let's Encrypt staging server with the [`caServer`](#caserver) configuration option
|
||||||
when experimenting to avoid hitting this limit too fast.
|
when experimenting to avoid hitting this limit too fast.
|
||||||
@@ -279,8 +283,19 @@ Use the `DNS-01` challenge to generate and renew ACME certificates by provisioni
|
|||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! important
|
!!! warning "`CNAME` support"
|
||||||
A `provider` is mandatory.
|
|
||||||
|
`CNAME` are supported (and sometimes even [encouraged](https://letsencrypt.org/2019/10/09/onboarding-your-customers-with-lets-encrypt-and-acme.html#the-advantages-of-a-cname)),
|
||||||
|
but there are a few cases where they can be [problematic](../../getting-started/faq/#why-does-lets-encrypt-wildcard-certificate-renewalgeneration-with-dns-challenge-fail).
|
||||||
|
|
||||||
|
If needed, `CNAME` support can be disabled with the following environment variable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
LEGO_DISABLE_CNAME_SUPPORT=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! important
|
||||||
|
A `provider` is mandatory.
|
||||||
|
|
||||||
#### `providers`
|
#### `providers`
|
||||||
|
|
||||||
@@ -293,117 +308,127 @@ For example, `CF_API_EMAIL_FILE=/run/secrets/traefik_cf-api-email` could be used
|
|||||||
|
|
||||||
For complete details, refer to your provider's _Additional configuration_ link.
|
For complete details, refer to your provider's _Additional configuration_ link.
|
||||||
|
|
||||||
| Provider Name | Provider Code | Environment Variables | |
|
| Provider Name | Provider Code | Environment Variables | |
|
||||||
|----------------------------------------------------------------------------------------------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
|
|------------------------------------------------------------------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
|
||||||
| [ACME DNS](https://github.com/joohoi/acme-dns) | `acme-dns` | `ACME_DNS_API_BASE`, `ACME_DNS_STORAGE_PATH` | [Additional configuration](https://go-acme.github.io/lego/dns/acme-dns) |
|
| [ACME DNS](https://github.com/joohoi/acme-dns) | `acme-dns` | `ACME_DNS_API_BASE`, `ACME_DNS_STORAGE_PATH` | [Additional configuration](https://go-acme.github.io/lego/dns/acme-dns) |
|
||||||
| [Alibaba Cloud](https://www.alibabacloud.com) | `alidns` | `ALICLOUD_ACCESS_KEY`, `ALICLOUD_SECRET_KEY`, `ALICLOUD_REGION_ID` | [Additional configuration](https://go-acme.github.io/lego/dns/alidns) |
|
| [Alibaba Cloud](https://www.alibabacloud.com) | `alidns` | `ALICLOUD_ACCESS_KEY`, `ALICLOUD_SECRET_KEY`, `ALICLOUD_REGION_ID` | [Additional configuration](https://go-acme.github.io/lego/dns/alidns) |
|
||||||
| [all-inkl](https://all-inkl.com) | `allinkl` | `ALL_INKL_LOGIN`, `ALL_INKL_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/allinkl) |
|
| [all-inkl](https://all-inkl.com) | `allinkl` | `ALL_INKL_LOGIN`, `ALL_INKL_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/allinkl) |
|
||||||
| [ArvanCloud](https://www.arvancloud.com/en) | `arvancloud` | `ARVANCLOUD_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/arvancloud) |
|
| [ArvanCloud](https://www.arvancloud.com/en) | `arvancloud` | `ARVANCLOUD_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/arvancloud) |
|
||||||
| [Auroradns](https://www.pcextreme.com/dns-health-checks) | `auroradns` | `AURORA_USER_ID`, `AURORA_KEY`, `AURORA_ENDPOINT` | [Additional configuration](https://go-acme.github.io/lego/dns/auroradns) |
|
| [Auroradns](https://www.pcextreme.com/dns-health-checks) | `auroradns` | `AURORA_USER_ID`, `AURORA_KEY`, `AURORA_ENDPOINT` | [Additional configuration](https://go-acme.github.io/lego/dns/auroradns) |
|
||||||
| [Autodns](https://www.internetx.com/domains/autodns/) | `autodns` | `AUTODNS_API_USER`, `AUTODNS_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/autodns) |
|
| [Autodns](https://www.internetx.com/domains/autodns/) | `autodns` | `AUTODNS_API_USER`, `AUTODNS_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/autodns) |
|
||||||
| [Azure](https://azure.microsoft.com/services/dns/) | `azure` | `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`, `AZURE_TENANT_ID`, `AZURE_RESOURCE_GROUP`, `[AZURE_METADATA_ENDPOINT]` | [Additional configuration](https://go-acme.github.io/lego/dns/azure) |
|
| [Azure](https://azure.microsoft.com/services/dns/) | `azure` | `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`, `AZURE_TENANT_ID`, `AZURE_RESOURCE_GROUP`, `[AZURE_METADATA_ENDPOINT]` | [Additional configuration](https://go-acme.github.io/lego/dns/azure) |
|
||||||
| [Bindman](https://github.com/labbsr0x/bindman-dns-webhook) | `bindman` | `BINDMAN_MANAGER_ADDRESS` | [Additional configuration](https://go-acme.github.io/lego/dns/bindman) |
|
| [Bindman](https://github.com/labbsr0x/bindman-dns-webhook) | `bindman` | `BINDMAN_MANAGER_ADDRESS` | [Additional configuration](https://go-acme.github.io/lego/dns/bindman) |
|
||||||
| [Blue Cat](https://www.bluecatnetworks.com/) | `bluecat` | `BLUECAT_SERVER_URL`, `BLUECAT_USER_NAME`, `BLUECAT_PASSWORD`, `BLUECAT_CONFIG_NAME`, `BLUECAT_DNS_VIEW` | [Additional configuration](https://go-acme.github.io/lego/dns/bluecat) |
|
| [Blue Cat](https://www.bluecatnetworks.com/) | `bluecat` | `BLUECAT_SERVER_URL`, `BLUECAT_USER_NAME`, `BLUECAT_PASSWORD`, `BLUECAT_CONFIG_NAME`, `BLUECAT_DNS_VIEW` | [Additional configuration](https://go-acme.github.io/lego/dns/bluecat) |
|
||||||
| [Checkdomain](https://www.checkdomain.de/) | `checkdomain` | `CHECKDOMAIN_TOKEN`, | [Additional configuration](https://go-acme.github.io/lego/dns/checkdomain/) |
|
| [Brandit](https://www.brandit.com) | `brandit` | `BRANDIT_API_USERNAME`, `BRANDIT_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/brandit) |
|
||||||
| [Civo](https://www.civo.com/) | `civo` | `CIVO_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/civo) |
|
| [Bunny](https://bunny.net) | `bunny` | `BUNNY_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/bunny) |
|
||||||
| [CloudDNS](https://vshosting.eu/) | `clouddns` | `CLOUDDNS_CLIENT_ID`, `CLOUDDNS_EMAIL`, `CLOUDDNS_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/clouddns) |
|
| [Checkdomain](https://www.checkdomain.de/) | `checkdomain` | `CHECKDOMAIN_TOKEN`, | [Additional configuration](https://go-acme.github.io/lego/dns/checkdomain/) |
|
||||||
| [Cloudflare](https://www.cloudflare.com) | `cloudflare` | `CF_API_EMAIL`, `CF_API_KEY` [^5] or `CF_DNS_API_TOKEN`, `[CF_ZONE_API_TOKEN]` | [Additional configuration](https://go-acme.github.io/lego/dns/cloudflare) |
|
| [Civo](https://www.civo.com/) | `civo` | `CIVO_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/civo) |
|
||||||
| [ClouDNS](https://www.cloudns.net/) | `cloudns` | `CLOUDNS_AUTH_ID`, `CLOUDNS_AUTH_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/cloudns) |
|
| [CloudDNS](https://vshosting.eu/) | `clouddns` | `CLOUDDNS_CLIENT_ID`, `CLOUDDNS_EMAIL`, `CLOUDDNS_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/clouddns) |
|
||||||
| [CloudXNS](https://www.cloudxns.net) | `cloudxns` | `CLOUDXNS_API_KEY`, `CLOUDXNS_SECRET_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/cloudxns) |
|
| [Cloudflare](https://www.cloudflare.com) | `cloudflare` | `CF_API_EMAIL`, `CF_API_KEY` [^5] or `CF_DNS_API_TOKEN`, `[CF_ZONE_API_TOKEN]` | [Additional configuration](https://go-acme.github.io/lego/dns/cloudflare) |
|
||||||
| [ConoHa](https://www.conoha.jp) | `conoha` | `CONOHA_TENANT_ID`, `CONOHA_API_USERNAME`, `CONOHA_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/conoha) |
|
| [ClouDNS](https://www.cloudns.net/) | `cloudns` | `CLOUDNS_AUTH_ID`, `CLOUDNS_AUTH_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/cloudns) |
|
||||||
| [Constellix](https://constellix.com) | `constellix` | `CONSTELLIX_API_KEY`, `CONSTELLIX_SECRET_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/constellix) |
|
| [CloudXNS](https://www.cloudxns.net) | `cloudxns` | `CLOUDXNS_API_KEY`, `CLOUDXNS_SECRET_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/cloudxns) |
|
||||||
| [deSEC](https://desec.io) | `desec` | `DESEC_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/desec) |
|
| [ConoHa](https://www.conoha.jp) | `conoha` | `CONOHA_TENANT_ID`, `CONOHA_API_USERNAME`, `CONOHA_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/conoha) |
|
||||||
| [DigitalOcean](https://www.digitalocean.com) | `digitalocean` | `DO_AUTH_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/digitalocean) |
|
| [Constellix](https://constellix.com) | `constellix` | `CONSTELLIX_API_KEY`, `CONSTELLIX_SECRET_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/constellix) |
|
||||||
| [DNS Made Easy](https://dnsmadeeasy.com) | `dnsmadeeasy` | `DNSMADEEASY_API_KEY`, `DNSMADEEASY_API_SECRET`, `DNSMADEEASY_SANDBOX` | [Additional configuration](https://go-acme.github.io/lego/dns/dnsmadeeasy) |
|
| [Derak Cloud](https://derak.cloud/) | `derak` | `DERAK_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/derak) |
|
||||||
| [DNSimple](https://dnsimple.com) | `dnsimple` | `DNSIMPLE_OAUTH_TOKEN`, `DNSIMPLE_BASE_URL` | [Additional configuration](https://go-acme.github.io/lego/dns/dnsimple) |
|
| [deSEC](https://desec.io) | `desec` | `DESEC_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/desec) |
|
||||||
| [DNSPod](https://www.dnspod.com/) | `dnspod` | `DNSPOD_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/dnspod) |
|
| [DigitalOcean](https://www.digitalocean.com) | `digitalocean` | `DO_AUTH_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/digitalocean) |
|
||||||
| [Domain Offensive (do.de)](https://www.do.de/) | `dode` | `DODE_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/dode) |
|
| [DNS Made Easy](https://dnsmadeeasy.com) | `dnsmadeeasy` | `DNSMADEEASY_API_KEY`, `DNSMADEEASY_API_SECRET`, `DNSMADEEASY_SANDBOX` | [Additional configuration](https://go-acme.github.io/lego/dns/dnsmadeeasy) |
|
||||||
| [Domeneshop](https://domene.shop) | `domeneshop` | `DOMENESHOP_API_TOKEN`, `DOMENESHOP_API_SECRET` | [Additional configuration](https://go-acme.github.io/lego/dns/domeneshop) |
|
| [dnsHome.de](https://www.dnshome.de) | `dnsHomede` | `DNSHOMEDE_CREDENTIALS` | [Additional configuration](https://go-acme.github.io/lego/dns/dnshomede) |
|
||||||
| [DreamHost](https://www.dreamhost.com/) | `dreamhost` | `DREAMHOST_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/dreamhost) |
|
| [DNSimple](https://dnsimple.com) | `dnsimple` | `DNSIMPLE_OAUTH_TOKEN`, `DNSIMPLE_BASE_URL` | [Additional configuration](https://go-acme.github.io/lego/dns/dnsimple) |
|
||||||
| [Duck DNS](https://www.duckdns.org/) | `duckdns` | `DUCKDNS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/duckdns) |
|
| [DNSPod](https://www.dnspod.com/) | `dnspod` | `DNSPOD_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/dnspod) |
|
||||||
| [Dyn](https://dyn.com) | `dyn` | `DYN_CUSTOMER_NAME`, `DYN_USER_NAME`, `DYN_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/dyn) |
|
| [Domain Offensive (do.de)](https://www.do.de/) | `dode` | `DODE_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/dode) |
|
||||||
| [Dynu](https://www.dynu.com) | `dynu` | `DYNU_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/dynu) |
|
| [Domeneshop](https://domene.shop) | `domeneshop` | `DOMENESHOP_API_TOKEN`, `DOMENESHOP_API_SECRET` | [Additional configuration](https://go-acme.github.io/lego/dns/domeneshop) |
|
||||||
| [EasyDNS](https://easydns.com/) | `easydns` | `EASYDNS_TOKEN`, `EASYDNS_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/easydns) |
|
| [DreamHost](https://www.dreamhost.com/) | `dreamhost` | `DREAMHOST_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/dreamhost) |
|
||||||
| [EdgeDNS](https://www.akamai.com/) | `edgedns` | `AKAMAI_CLIENT_TOKEN`, `AKAMAI_CLIENT_SECRET`, `AKAMAI_ACCESS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/edgedns) |
|
| [Duck DNS](https://www.duckdns.org/) | `duckdns` | `DUCKDNS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/duckdns) |
|
||||||
| [Epik](https://www.epik.com) | `epik` | `EPIK_SIGNATURE` | [Additional configuration](https://go-acme.github.io/lego/dns/epik) |
|
| [Dyn](https://dyn.com) | `dyn` | `DYN_CUSTOMER_NAME`, `DYN_USER_NAME`, `DYN_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/dyn) |
|
||||||
| [Exoscale](https://www.exoscale.com) | `exoscale` | `EXOSCALE_API_KEY`, `EXOSCALE_API_SECRET`, `EXOSCALE_ENDPOINT` | [Additional configuration](https://go-acme.github.io/lego/dns/exoscale) |
|
| [Dynu](https://www.dynu.com) | `dynu` | `DYNU_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/dynu) |
|
||||||
| [Fast DNS](https://www.akamai.com/) | `fastdns` | `AKAMAI_CLIENT_TOKEN`, `AKAMAI_CLIENT_SECRET`, `AKAMAI_ACCESS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/edgedns) |
|
| [EasyDNS](https://easydns.com/) | `easydns` | `EASYDNS_TOKEN`, `EASYDNS_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/easydns) |
|
||||||
| [Freemyip.com](https://freemyip.com) | `freemyip` | `FREEMYIP_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/freemyip) |
|
| [EdgeDNS](https://www.akamai.com/) | `edgedns` | `AKAMAI_CLIENT_TOKEN`, `AKAMAI_CLIENT_SECRET`, `AKAMAI_ACCESS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/edgedns) |
|
||||||
| [G-Core Lab](https://gcorelabs.com/dns/) | `gcore` | `GCORE_PERMANENT_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/gcore) |
|
| [Epik](https://www.epik.com) | `epik` | `EPIK_SIGNATURE` | [Additional configuration](https://go-acme.github.io/lego/dns/epik) |
|
||||||
| [Gandi v5](https://doc.livedns.gandi.net) | `gandiv5` | `GANDIV5_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/gandiv5) |
|
| [Exoscale](https://www.exoscale.com) | `exoscale` | `EXOSCALE_API_KEY`, `EXOSCALE_API_SECRET`, `EXOSCALE_ENDPOINT` | [Additional configuration](https://go-acme.github.io/lego/dns/exoscale) |
|
||||||
| [Gandi](https://www.gandi.net) | `gandi` | `GANDI_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/gandi) |
|
| [Fast DNS](https://www.akamai.com/) | `fastdns` | `AKAMAI_CLIENT_TOKEN`, `AKAMAI_CLIENT_SECRET`, `AKAMAI_ACCESS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/edgedns) |
|
||||||
| [Glesys](https://glesys.com/) | `glesys` | `GLESYS_API_USER`, `GLESYS_API_KEY`, `GLESYS_DOMAIN` | [Additional configuration](https://go-acme.github.io/lego/dns/glesys) |
|
| [Freemyip.com](https://freemyip.com) | `freemyip` | `FREEMYIP_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/freemyip) |
|
||||||
| [GoDaddy](https://godaddy.com/) | `godaddy` | `GODADDY_API_KEY`, `GODADDY_API_SECRET` | [Additional configuration](https://go-acme.github.io/lego/dns/godaddy) |
|
| [G-Core Lab](https://gcorelabs.com/dns/) | `gcore` | `GCORE_PERMANENT_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/gcore) |
|
||||||
| [Google Cloud DNS](https://cloud.google.com/dns/docs/) | `gcloud` | `GCE_PROJECT`, Application Default Credentials [^2] [^3], [`GCE_SERVICE_ACCOUNT_FILE`] | [Additional configuration](https://go-acme.github.io/lego/dns/gcloud) |
|
| [Gandi v5](https://doc.livedns.gandi.net) | `gandiv5` | `GANDIV5_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/gandiv5) |
|
||||||
| [Hetzner](https://hetzner.com) | `hetzner` | `HETZNER_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/hetzner) |
|
| [Gandi](https://www.gandi.net) | `gandi` | `GANDI_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/gandi) |
|
||||||
| [hosting.de](https://www.hosting.de) | `hostingde` | `HOSTINGDE_API_KEY`, `HOSTINGDE_ZONE_NAME` | [Additional configuration](https://go-acme.github.io/lego/dns/hostingde) |
|
| [Glesys](https://glesys.com/) | `glesys` | `GLESYS_API_USER`, `GLESYS_API_KEY`, `GLESYS_DOMAIN` | [Additional configuration](https://go-acme.github.io/lego/dns/glesys) |
|
||||||
| [Hosttech](https://www.hosttech.eu) | `hosttech` | `HOSTTECH_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/hosttech) |
|
| [GoDaddy](https://www.godaddy.com) | `godaddy` | `GODADDY_API_KEY`, `GODADDY_API_SECRET` | [Additional configuration](https://go-acme.github.io/lego/dns/godaddy) |
|
||||||
| [Hurricane Electric](https://dns.he.net) | `hurricane` | `HURRICANE_TOKENS` [^6] | [Additional configuration](https://go-acme.github.io/lego/dns/hurricane) |
|
| [Google Domains](https://domains.google) | `googledomains` | `GOOGLE_DOMAINS_ACCESS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/googledomains) |
|
||||||
| [HyperOne](https://www.hyperone.com) | `hyperone` | `HYPERONE_PASSPORT_LOCATION`, `HYPERONE_LOCATION_ID` | [Additional configuration](https://go-acme.github.io/lego/dns/hyperone) |
|
| [Google Cloud DNS](https://cloud.google.com/dns/docs/) | `gcloud` | `GCE_PROJECT`, Application Default Credentials [^2] [^3], [`GCE_SERVICE_ACCOUNT_FILE`] | [Additional configuration](https://go-acme.github.io/lego/dns/gcloud) |
|
||||||
| [IBM Cloud (SoftLayer)](https://www.ibm.com/cloud/) | `ibmcloud` | `SOFTLAYER_USERNAME`, `SOFTLAYER_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ibmcloud) |
|
| [Hetzner](https://hetzner.com) | `hetzner` | `HETZNER_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/hetzner) |
|
||||||
| [IIJ DNS Platform Service](https://www.iij.ad.jp) | `iijdpf` | `IIJ_DPF_API_TOKEN` , `IIJ_DPF_DPM_SERVICE_CODE` | [Additional configuration](https://go-acme.github.io/lego/dns/iijdpf) |
|
| [hosting.de](https://www.hosting.de) | `hostingde` | `HOSTINGDE_API_KEY`, `HOSTINGDE_ZONE_NAME` | [Additional configuration](https://go-acme.github.io/lego/dns/hostingde) |
|
||||||
| [IIJ](https://www.iij.ad.jp/) | `iij` | `IIJ_API_ACCESS_KEY`, `IIJ_API_SECRET_KEY`, `IIJ_DO_SERVICE_CODE` | [Additional configuration](https://go-acme.github.io/lego/dns/iij) |
|
| [Hosttech](https://www.hosttech.eu) | `hosttech` | `HOSTTECH_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/hosttech) |
|
||||||
| [Infoblox](https://www.infoblox.com/) | `infoblox` | `INFOBLOX_USERNAME`, `INFOBLOX_PASSWORD`, `INFOBLOX_HOST` | [Additional configuration](https://go-acme.github.io/lego/dns/infoblox) |
|
| [Hurricane Electric](https://dns.he.net) | `hurricane` | `HURRICANE_TOKENS` [^6] | [Additional configuration](https://go-acme.github.io/lego/dns/hurricane) |
|
||||||
| [Infomaniak](https://www.infomaniak.com) | `infomaniak` | `INFOMANIAK_ACCESS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/infomaniak) |
|
| [HyperOne](https://www.hyperone.com) | `hyperone` | `HYPERONE_PASSPORT_LOCATION`, `HYPERONE_LOCATION_ID` | [Additional configuration](https://go-acme.github.io/lego/dns/hyperone) |
|
||||||
| [Internet.bs](https://internetbs.net) | `internetbs` | `INTERNET_BS_API_KEY`, `INTERNET_BS_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/internetbs) |
|
| [IBM Cloud (SoftLayer)](https://www.ibm.com/cloud/) | `ibmcloud` | `SOFTLAYER_USERNAME`, `SOFTLAYER_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ibmcloud) |
|
||||||
| [INWX](https://www.inwx.de/en) | `inwx` | `INWX_USERNAME`, `INWX_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/inwx) |
|
| [IIJ DNS Platform Service](https://www.iij.ad.jp) | `iijdpf` | `IIJ_DPF_API_TOKEN` , `IIJ_DPF_DPM_SERVICE_CODE` | [Additional configuration](https://go-acme.github.io/lego/dns/iijdpf) |
|
||||||
| [ionos](https://ionos.com/) | `ionos` | `IONOS_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ionos) |
|
| [IIJ](https://www.iij.ad.jp/) | `iij` | `IIJ_API_ACCESS_KEY`, `IIJ_API_SECRET_KEY`, `IIJ_DO_SERVICE_CODE` | [Additional configuration](https://go-acme.github.io/lego/dns/iij) |
|
||||||
| [iwantmyname](https://iwantmyname.com) | `iwantmyname` | `IWANTMYNAME_USERNAME` , `IWANTMYNAME_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/iwantmyname) |
|
| [Infoblox](https://www.infoblox.com/) | `infoblox` | `INFOBLOX_USERNAME`, `INFOBLOX_PASSWORD`, `INFOBLOX_HOST` | [Additional configuration](https://go-acme.github.io/lego/dns/infoblox) |
|
||||||
| [Joker.com](https://joker.com) | `joker` | `JOKER_API_MODE` with `JOKER_API_KEY` or `JOKER_USERNAME`, `JOKER_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/joker) |
|
| [Infomaniak](https://www.infomaniak.com) | `infomaniak` | `INFOMANIAK_ACCESS_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/infomaniak) |
|
||||||
| [Lightsail](https://aws.amazon.com/lightsail/) | `lightsail` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `DNS_ZONE` | [Additional configuration](https://go-acme.github.io/lego/dns/lightsail) |
|
| [Internet.bs](https://internetbs.net) | `internetbs` | `INTERNET_BS_API_KEY`, `INTERNET_BS_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/internetbs) |
|
||||||
| [Linode v4](https://www.linode.com) | `linode` | `LINODE_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/linode) |
|
| [INWX](https://www.inwx.de/en) | `inwx` | `INWX_USERNAME`, `INWX_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/inwx) |
|
||||||
| [Liquid Web](https://www.liquidweb.com/) | `liquidweb` | `LIQUID_WEB_PASSWORD`, `LIQUID_WEB_USERNAME`, `LIQUID_WEB_ZONE` | [Additional configuration](https://go-acme.github.io/lego/dns/liquidweb) |
|
| [ionos](https://ionos.com/) | `ionos` | `IONOS_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ionos) |
|
||||||
| [Loopia](https://loopia.com/) | `loopia` | `LOOPIA_API_PASSWORD`, `LOOPIA_API_USER` | [Additional configuration](https://go-acme.github.io/lego/dns/loopia) |
|
| [iwantmyname](https://iwantmyname.com) | `iwantmyname` | `IWANTMYNAME_USERNAME` , `IWANTMYNAME_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/iwantmyname) |
|
||||||
| [LuaDNS](https://luadns.com) | `luadns` | `LUADNS_API_USERNAME`, `LUADNS_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/luadns) |
|
| [Joker.com](https://joker.com) | `joker` | `JOKER_API_MODE` with `JOKER_API_KEY` or `JOKER_USERNAME`, `JOKER_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/joker) |
|
||||||
| [MyDNS.jp](https://www.mydns.jp/) | `mydnsjp` | `MYDNSJP_MASTER_ID`, `MYDNSJP_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/mydnsjp) |
|
| [Liara](https://liara.ir) | `liara` | `LIARA_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/liara) |
|
||||||
| [Mythic Beasts](https://www.mythic-beasts.com) | `mythicbeasts` | `MYTHICBEASTS_USER_NAME`, `MYTHICBEASTS_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/mythicbeasts) |
|
| [Lightsail](https://aws.amazon.com/lightsail/) | `lightsail` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `DNS_ZONE` | [Additional configuration](https://go-acme.github.io/lego/dns/lightsail) |
|
||||||
| [name.com](https://www.name.com/) | `namedotcom` | `NAMECOM_USERNAME`, `NAMECOM_API_TOKEN`, `NAMECOM_SERVER` | [Additional configuration](https://go-acme.github.io/lego/dns/namedotcom) |
|
| [Linode v4](https://www.linode.com) | `linode` | `LINODE_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/linode) |
|
||||||
| [Namecheap](https://www.namecheap.com) | `namecheap` | `NAMECHEAP_API_USER`, `NAMECHEAP_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/namecheap) |
|
| [Liquid Web](https://www.liquidweb.com/) | `liquidweb` | `LIQUID_WEB_PASSWORD`, `LIQUID_WEB_USERNAME`, `LIQUID_WEB_ZONE` | [Additional configuration](https://go-acme.github.io/lego/dns/liquidweb) |
|
||||||
| [Namesilo](https://www.namesilo.com/) | `namesilo` | `NAMESILO_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/namesilo) |
|
| [Loopia](https://loopia.com/) | `loopia` | `LOOPIA_API_PASSWORD`, `LOOPIA_API_USER` | [Additional configuration](https://go-acme.github.io/lego/dns/loopia) |
|
||||||
| [NearlyFreeSpeech.NET](https://www.nearlyfreespeech.net/) | `nearlyfreespeech` | `NEARLYFREESPEECH_API_KEY`, `NEARLYFREESPEECH_LOGIN` | [Additional configuration](https://go-acme.github.io/lego/dns/nearlyfreespeech) |
|
| [LuaDNS](https://luadns.com) | `luadns` | `LUADNS_API_USERNAME`, `LUADNS_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/luadns) |
|
||||||
| [Netcup](https://www.netcup.eu/) | `netcup` | `NETCUP_CUSTOMER_NUMBER`, `NETCUP_API_KEY`, `NETCUP_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/netcup) |
|
| [MyDNS.jp](https://www.mydns.jp/) | `mydnsjp` | `MYDNSJP_MASTER_ID`, `MYDNSJP_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/mydnsjp) |
|
||||||
| [Netlify](https://www.netlify.com) | `netlify` | `NETLIFY_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/netlify) |
|
| [Mythic Beasts](https://www.mythic-beasts.com) | `mythicbeasts` | `MYTHICBEASTS_USER_NAME`, `MYTHICBEASTS_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/mythicbeasts) |
|
||||||
| [Nicmanager](https://www.nicmanager.com) | `nicmanager` | `NICMANAGER_API_EMAIL`, `NICMANAGER_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/nicmanager) |
|
| [name.com](https://www.name.com/) | `namedotcom` | `NAMECOM_USERNAME`, `NAMECOM_API_TOKEN`, `NAMECOM_SERVER` | [Additional configuration](https://go-acme.github.io/lego/dns/namedotcom) |
|
||||||
| [NIFCloud](https://cloud.nifty.com/service/dns.htm) | `nifcloud` | `NIFCLOUD_ACCESS_KEY_ID`, `NIFCLOUD_SECRET_ACCESS_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/nifcloud) |
|
| [Namecheap](https://www.namecheap.com) | `namecheap` | `NAMECHEAP_API_USER`, `NAMECHEAP_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/namecheap) |
|
||||||
| [Njalla](https://njal.la) | `njalla` | `NJALLA_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/njalla) |
|
| [Namesilo](https://www.namesilo.com/) | `namesilo` | `NAMESILO_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/namesilo) |
|
||||||
| [NS1](https://ns1.com/) | `ns1` | `NS1_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ns1) |
|
| [NearlyFreeSpeech.NET](https://www.nearlyfreespeech.net/) | `nearlyfreespeech` | `NEARLYFREESPEECH_API_KEY`, `NEARLYFREESPEECH_LOGIN` | [Additional configuration](https://go-acme.github.io/lego/dns/nearlyfreespeech) |
|
||||||
| [Open Telekom Cloud](https://cloud.telekom.de) | `otc` | `OTC_DOMAIN_NAME`, `OTC_USER_NAME`, `OTC_PASSWORD`, `OTC_PROJECT_NAME`, `OTC_IDENTITY_ENDPOINT` | [Additional configuration](https://go-acme.github.io/lego/dns/otc) |
|
| [Netcup](https://www.netcup.eu/) | `netcup` | `NETCUP_CUSTOMER_NUMBER`, `NETCUP_API_KEY`, `NETCUP_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/netcup) |
|
||||||
| [Openstack Designate](https://docs.openstack.org/designate) | `designate` | `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, `OS_TENANT_NAME`, `OS_REGION_NAME` | [Additional configuration](https://go-acme.github.io/lego/dns/designate) |
|
| [Netlify](https://www.netlify.com) | `netlify` | `NETLIFY_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/netlify) |
|
||||||
| [Oracle Cloud](https://cloud.oracle.com/home) | `oraclecloud` | `OCI_COMPARTMENT_OCID`, `OCI_PRIVKEY_FILE`, `OCI_PRIVKEY_PASS`, `OCI_PUBKEY_FINGERPRINT`, `OCI_REGION`, `OCI_TENANCY_OCID`, `OCI_USER_OCID` | [Additional configuration](https://go-acme.github.io/lego/dns/oraclecloud) |
|
| [Nicmanager](https://www.nicmanager.com) | `nicmanager` | `NICMANAGER_API_EMAIL`, `NICMANAGER_API_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/nicmanager) |
|
||||||
| [OVH](https://www.ovh.com) | `ovh` | `OVH_ENDPOINT`, `OVH_APPLICATION_KEY`, `OVH_APPLICATION_SECRET`, `OVH_CONSUMER_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ovh) |
|
| [NIFCloud](https://cloud.nifty.com/service/dns.htm) | `nifcloud` | `NIFCLOUD_ACCESS_KEY_ID`, `NIFCLOUD_SECRET_ACCESS_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/nifcloud) |
|
||||||
| [Porkbun](https://porkbun.com/) | `porkbun` | `PORKBUN_SECRET_API_KEY`, `PORKBUN_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/porkbun) |
|
| [Njalla](https://njal.la) | `njalla` | `NJALLA_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/njalla) |
|
||||||
| [PowerDNS](https://www.powerdns.com) | `pdns` | `PDNS_API_KEY`, `PDNS_API_URL` | [Additional configuration](https://go-acme.github.io/lego/dns/pdns) |
|
| [Nodion](https://www.nodion.com) | `nodion` | `NODION_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/nodion) |
|
||||||
| [Rackspace](https://www.rackspace.com/cloud/dns) | `rackspace` | `RACKSPACE_USER`, `RACKSPACE_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/rackspace) |
|
| [NS1](https://ns1.com/) | `ns1` | `NS1_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ns1) |
|
||||||
| [reg.ru](https://www.reg.ru) | `regru` | `REGRU_USERNAME`, `REGRU_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/regru) |
|
| [Open Telekom Cloud](https://cloud.telekom.de) | `otc` | `OTC_DOMAIN_NAME`, `OTC_USER_NAME`, `OTC_PASSWORD`, `OTC_PROJECT_NAME`, `OTC_IDENTITY_ENDPOINT` | [Additional configuration](https://go-acme.github.io/lego/dns/otc) |
|
||||||
| [RFC2136](https://tools.ietf.org/html/rfc2136) | `rfc2136` | `RFC2136_TSIG_KEY`, `RFC2136_TSIG_SECRET`, `RFC2136_TSIG_ALGORITHM`, `RFC2136_NAMESERVER` | [Additional configuration](https://go-acme.github.io/lego/dns/rfc2136) |
|
| [Openstack Designate](https://docs.openstack.org/designate) | `designate` | `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, `OS_TENANT_NAME`, `OS_REGION_NAME` | [Additional configuration](https://go-acme.github.io/lego/dns/designate) |
|
||||||
| [RimuHosting](https://rimuhosting.com) | `rimuhosting` | `RIMUHOSTING_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/rimuhosting) |
|
| [Oracle Cloud](https://cloud.oracle.com/home) | `oraclecloud` | `OCI_COMPARTMENT_OCID`, `OCI_PRIVKEY_FILE`, `OCI_PRIVKEY_PASS`, `OCI_PUBKEY_FINGERPRINT`, `OCI_REGION`, `OCI_TENANCY_OCID`, `OCI_USER_OCID` | [Additional configuration](https://go-acme.github.io/lego/dns/oraclecloud) |
|
||||||
| [Route 53](https://aws.amazon.com/route53/) | `route53` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `[AWS_REGION]`, `[AWS_HOSTED_ZONE_ID]` or a configured user/instance IAM profile. | [Additional configuration](https://go-acme.github.io/lego/dns/route53) |
|
| [OVH](https://www.ovh.com) | `ovh` | `OVH_ENDPOINT`, `OVH_APPLICATION_KEY`, `OVH_APPLICATION_SECRET`, `OVH_CONSUMER_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/ovh) |
|
||||||
| [Sakura Cloud](https://cloud.sakura.ad.jp/) | `sakuracloud` | `SAKURACLOUD_ACCESS_TOKEN`, `SAKURACLOUD_ACCESS_TOKEN_SECRET` | [Additional configuration](https://go-acme.github.io/lego/dns/sakuracloud) |
|
| [Plesk](https://www.plesk.com) | `plesk` | `PLESK_SERVER_BASE_URL`, `PLESK_USERNAME`, `PLESK_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/plesk) |
|
||||||
| [Scaleway](https://www.scaleway.com) | `scaleway` | `SCALEWAY_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/scaleway) |
|
| [Porkbun](https://porkbun.com/) | `porkbun` | `PORKBUN_SECRET_API_KEY`, `PORKBUN_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/porkbun) |
|
||||||
| [Selectel](https://selectel.ru/en/) | `selectel` | `SELECTEL_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/selectel) |
|
| [PowerDNS](https://www.powerdns.com) | `pdns` | `PDNS_API_KEY`, `PDNS_API_URL` | [Additional configuration](https://go-acme.github.io/lego/dns/pdns) |
|
||||||
| [Servercow](https://servercow.de) | `servercow` | `SERVERCOW_USERNAME`, `SERVERCOW_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/servercow) |
|
| [Rackspace](https://www.rackspace.com/cloud/dns) | `rackspace` | `RACKSPACE_USER`, `RACKSPACE_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/rackspace) |
|
||||||
| [Simply.com](https://www.simply.com/en/domains/) | `simply` | `SIMPLY_ACCOUNT_NAME`, `SIMPLY_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/simply) |
|
| [reg.ru](https://www.reg.ru) | `regru` | `REGRU_USERNAME`, `REGRU_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/regru) |
|
||||||
| [Sonic](https://www.sonic.com/) | `sonic` | `SONIC_USER_ID`, `SONIC_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/sonic) |
|
| [RFC2136](https://tools.ietf.org/html/rfc2136) | `rfc2136` | `RFC2136_TSIG_KEY`, `RFC2136_TSIG_SECRET`, `RFC2136_TSIG_ALGORITHM`, `RFC2136_NAMESERVER` | [Additional configuration](https://go-acme.github.io/lego/dns/rfc2136) |
|
||||||
| [Stackpath](https://www.stackpath.com/) | `stackpath` | `STACKPATH_CLIENT_ID`, `STACKPATH_CLIENT_SECRET`, `STACKPATH_STACK_ID` | [Additional configuration](https://go-acme.github.io/lego/dns/stackpath) |
|
| [RimuHosting](https://rimuhosting.com) | `rimuhosting` | `RIMUHOSTING_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/rimuhosting) |
|
||||||
| [Tencent Cloud DNS](https://cloud.tencent.com/product/cns) | `tencentcloud` | `TENCENTCLOUD_SECRET_ID`, `TENCENTCLOUD_SECRET_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/tencentcloud) |
|
| [Route 53](https://aws.amazon.com/route53/) | `route53` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `[AWS_REGION]`, `[AWS_HOSTED_ZONE_ID]` or a configured user/instance IAM profile. | [Additional configuration](https://go-acme.github.io/lego/dns/route53) |
|
||||||
| [TransIP](https://www.transip.nl/) | `transip` | `TRANSIP_ACCOUNT_NAME`, `TRANSIP_PRIVATE_KEY_PATH` | [Additional configuration](https://go-acme.github.io/lego/dns/transip) |
|
| [Sakura Cloud](https://cloud.sakura.ad.jp/) | `sakuracloud` | `SAKURACLOUD_ACCESS_TOKEN`, `SAKURACLOUD_ACCESS_TOKEN_SECRET` | [Additional configuration](https://go-acme.github.io/lego/dns/sakuracloud) |
|
||||||
| [UKFast SafeDNS](https://www.ans.co.uk/cloud-and-infrastructure/dedicated-servers/dns-management/) | `safedns` | `SAFEDNS_AUTH_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/safedns) |
|
| [Scaleway](https://www.scaleway.com) | `scaleway` | `SCALEWAY_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/scaleway) |
|
||||||
| [Variomedia](https://www.variomedia.de/) | `variomedia` | `VARIOMEDIA_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/variomedia) |
|
| [Selectel](https://selectel.ru/en/) | `selectel` | `SELECTEL_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/selectel) |
|
||||||
| [VegaDNS](https://github.com/shupp/VegaDNS-API) | `vegadns` | `SECRET_VEGADNS_KEY`, `SECRET_VEGADNS_SECRET`, `VEGADNS_URL` | [Additional configuration](https://go-acme.github.io/lego/dns/vegadns) |
|
| [Servercow](https://servercow.de) | `servercow` | `SERVERCOW_USERNAME`, `SERVERCOW_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/servercow) |
|
||||||
| [Vercel](https://vercel.com) | `vercel` | `VERCEL_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/vercel) |
|
| [Simply.com](https://www.simply.com/en/domains/) | `simply` | `SIMPLY_ACCOUNT_NAME`, `SIMPLY_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/simply) |
|
||||||
| [Versio](https://www.versio.nl/domeinnamen) | `versio` | `VERSIO_USERNAME`, `VERSIO_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/versio) |
|
| [Sonic](https://www.sonic.com/) | `sonic` | `SONIC_USER_ID`, `SONIC_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/sonic) |
|
||||||
| [VinylDNS](https://www.vinyldns.io) | `vinyldns` | `VINYLDNS_ACCESS_KEY`, `VINYLDNS_SECRET_KEY`, `VINYLDNS_HOST` | [Additional configuration](https://go-acme.github.io/lego/dns/vinyldns) |
|
| [Stackpath](https://www.stackpath.com/) | `stackpath` | `STACKPATH_CLIENT_ID`, `STACKPATH_CLIENT_SECRET`, `STACKPATH_STACK_ID` | [Additional configuration](https://go-acme.github.io/lego/dns/stackpath) |
|
||||||
| [VK Cloud](https://mcs.mail.ru/) | `vkcloud` | `VK_CLOUD_PASSWORD`, `VK_CLOUD_PROJECT_ID`, `VK_CLOUD_USERNAME` | [Additional configuration](https://go-acme.github.io/lego/dns/vkcloud) |
|
| [Tencent Cloud DNS](https://cloud.tencent.com/product/cns) | `tencentcloud` | `TENCENTCLOUD_SECRET_ID`, `TENCENTCLOUD_SECRET_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/tencentcloud) |
|
||||||
| [Vscale](https://vscale.io/) | `vscale` | `VSCALE_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/vscale) |
|
| [TransIP](https://www.transip.nl/) | `transip` | `TRANSIP_ACCOUNT_NAME`, `TRANSIP_PRIVATE_KEY_PATH` | [Additional configuration](https://go-acme.github.io/lego/dns/transip) |
|
||||||
| [VULTR](https://www.vultr.com) | `vultr` | `VULTR_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/vultr) |
|
| [UKFast SafeDNS](https://docs.ukfast.co.uk/domains/safedns/index.html) | `safedns` | `SAFEDNS_AUTH_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/safedns) |
|
||||||
| [WEDOS](https://www.wedos.com) | `wedos` | `WEDOS_USERNAME`, `WEDOS_WAPI_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/wedos) |
|
| [Ultradns](https://neustarsecurityservices.com/dns-services) | `ultradns` | `ULTRADNS_USERNAME`, `ULTRADNS_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/ultradns) |
|
||||||
| [Yandex Cloud](https://cloud.yandex.com/en/) | `yandexcloud` | `YANDEX_CLOUD_FOLDER_ID`, `YANDEX_CLOUD_IAM_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/yandexcloud) |
|
| [Variomedia](https://www.variomedia.de/) | `variomedia` | `VARIOMEDIA_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/variomedia) |
|
||||||
| [Yandex](https://yandex.com) | `yandex` | `YANDEX_PDD_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/yandex) |
|
| [VegaDNS](https://github.com/shupp/VegaDNS-API) | `vegadns` | `SECRET_VEGADNS_KEY`, `SECRET_VEGADNS_SECRET`, `VEGADNS_URL` | [Additional configuration](https://go-acme.github.io/lego/dns/vegadns) |
|
||||||
| [Zone.ee](https://www.zone.ee) | `zoneee` | `ZONEEE_API_USER`, `ZONEEE_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/zoneee) |
|
| [Vercel](https://vercel.com) | `vercel` | `VERCEL_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/vercel) |
|
||||||
| [Zonomi](https://zonomi.com) | `zonomi` | `ZONOMI_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/zonomi) |
|
| [Versio](https://www.versio.nl/domeinnamen) | `versio` | `VERSIO_USERNAME`, `VERSIO_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/versio) |
|
||||||
| External Program | `exec` | `EXEC_PATH` | [Additional configuration](https://go-acme.github.io/lego/dns/exec) |
|
| [VinylDNS](https://www.vinyldns.io) | `vinyldns` | `VINYLDNS_ACCESS_KEY`, `VINYLDNS_SECRET_KEY`, `VINYLDNS_HOST` | [Additional configuration](https://go-acme.github.io/lego/dns/vinyldns) |
|
||||||
| HTTP request | `httpreq` | `HTTPREQ_ENDPOINT`, `HTTPREQ_MODE`, `HTTPREQ_USERNAME`, `HTTPREQ_PASSWORD` [^1] | [Additional configuration](https://go-acme.github.io/lego/dns/httpreq) |
|
| [VK Cloud](https://mcs.mail.ru/) | `vkcloud` | `VK_CLOUD_PASSWORD`, `VK_CLOUD_PROJECT_ID`, `VK_CLOUD_USERNAME` | [Additional configuration](https://go-acme.github.io/lego/dns/vkcloud) |
|
||||||
| manual | `manual` | none, but you need to run Traefik interactively [^4], turn on debug log to see instructions and press <kbd>Enter</kbd>. | |
|
| [Vscale](https://vscale.io/) | `vscale` | `VSCALE_API_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/vscale) |
|
||||||
|
| [VULTR](https://www.vultr.com) | `vultr` | `VULTR_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/vultr) |
|
||||||
|
| [Websupport](https://websupport.sk) | `websupport` | `WEBSUPPORT_API_KEY`, `WEBSUPPORT_SECRET` | [Additional configuration](https://go-acme.github.io/lego/dns/websupport) |
|
||||||
|
| [WEDOS](https://www.wedos.com) | `wedos` | `WEDOS_USERNAME`, `WEDOS_WAPI_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/wedos) |
|
||||||
|
| [Yandex Cloud](https://cloud.yandex.com/en/) | `yandexcloud` | `YANDEX_CLOUD_FOLDER_ID`, `YANDEX_CLOUD_IAM_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/yandexcloud) |
|
||||||
|
| [Yandex](https://yandex.com) | `yandex` | `YANDEX_PDD_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/yandex) |
|
||||||
|
| [Zone.ee](https://www.zone.ee) | `zoneee` | `ZONEEE_API_USER`, `ZONEEE_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/zoneee) |
|
||||||
|
| [Zonomi](https://zonomi.com) | `zonomi` | `ZONOMI_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/zonomi) |
|
||||||
|
| External Program | `exec` | `EXEC_PATH` | [Additional configuration](https://go-acme.github.io/lego/dns/exec) |
|
||||||
|
| HTTP request | `httpreq` | `HTTPREQ_ENDPOINT`, `HTTPREQ_MODE`, `HTTPREQ_USERNAME`, `HTTPREQ_PASSWORD` [^1] | [Additional configuration](https://go-acme.github.io/lego/dns/httpreq) |
|
||||||
|
| manual | `manual` | none, but you need to run Traefik interactively [^4], turn on debug log to see instructions and press <kbd>Enter</kbd>. | |
|
||||||
|
|
||||||
[^1]: More information about the HTTP message format can be found [here](https://go-acme.github.io/lego/dns/httpreq/).
|
[^1]: More information about the HTTP message format can be found [here](https://go-acme.github.io/lego/dns/httpreq/).
|
||||||
[^2]: [Providing credentials to your application](https://cloud.google.com/docs/authentication/production).
|
[^2]: [Providing credentials to your application](https://cloud.google.com/docs/authentication/production).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
## Dynamic configuration
|
## Dynamic configuration
|
||||||
labels:
|
labels:
|
||||||
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
||||||
@@ -22,7 +22,7 @@ deploy:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: blogtls
|
name: blogtls
|
||||||
@@ -43,27 +43,6 @@ spec:
|
|||||||
- '*.example.org'
|
- '*.example.org'
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
labels: {
|
|
||||||
"traefik.http.routers.blog.rule": "Host(`example.com`) && Path(`/blog`)",
|
|
||||||
"traefik.http.routers.blog.tls": "true",
|
|
||||||
"traefik.http.routers.blog.tls.certresolver": "myresolver",
|
|
||||||
"traefik.http.routers.blog.tls.domains[0].main": "example.com",
|
|
||||||
"traefik.http.routers.blog.tls.domains[0].sans": "*.example.com",
|
|
||||||
"traefik.http.services.blog-svc.loadbalancer.server.port": "8080"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
## Dynamic configuration
|
|
||||||
labels:
|
|
||||||
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
|
||||||
- traefik.http.routers.blog.tls=true
|
|
||||||
- traefik.http.routers.blog.tls.certresolver=myresolver
|
|
||||||
- traefik.http.routers.blog.tls.domains[0].main=example.org
|
|
||||||
- traefik.http.routers.blog.tls.domains[0].sans=*.example.org
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
## Dynamic configuration
|
## Dynamic configuration
|
||||||
http:
|
http:
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
## Dynamic configuration
|
## Dynamic configuration
|
||||||
labels:
|
labels:
|
||||||
- traefik.http.routers.blog.rule=(Host(`example.com`) && Path(`/blog`)) || Host(`blog.example.org`)
|
- traefik.http.routers.blog.rule=(Host(`example.com`) && Path(`/blog`)) || Host(`blog.example.org`)
|
||||||
@@ -18,7 +18,7 @@ deploy:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: blogtls
|
name: blogtls
|
||||||
@@ -35,23 +35,6 @@ spec:
|
|||||||
certResolver: myresolver
|
certResolver: myresolver
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
labels: {
|
|
||||||
"traefik.http.routers.blog.rule": "(Host(`example.com`) && Path(`/blog`)) || Host(`blog.example.org`)",
|
|
||||||
"traefik.http.routers.blog.tls": "true",
|
|
||||||
"traefik.http.routers.blog.tls.certresolver": "myresolver",
|
|
||||||
"traefik.http.services.blog-svc.loadbalancer.server.port": "8080"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
## Dynamic configuration
|
|
||||||
labels:
|
|
||||||
- traefik.http.routers.blog.rule=(Host(`example.com`) && Path(`/blog`)) || Host(`blog.example.org`)
|
|
||||||
- traefik.http.routers.blog.tls=true
|
|
||||||
- traefik.http.routers.blog.tls.certresolver=myresolver
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
## Dynamic configuration
|
## Dynamic configuration
|
||||||
http:
|
http:
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
## Dynamic configuration
|
## Dynamic configuration
|
||||||
labels:
|
labels:
|
||||||
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
||||||
@@ -18,7 +18,7 @@ deploy:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: blogtls
|
name: blogtls
|
||||||
@@ -35,23 +35,6 @@ spec:
|
|||||||
certResolver: myresolver
|
certResolver: myresolver
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
labels: {
|
|
||||||
"traefik.http.routers.blog.rule": "Host(`example.com`) && Path(`/blog`)",
|
|
||||||
"traefik.http.routers.blog.tls": "true",
|
|
||||||
"traefik.http.routers.blog.tls.certresolver": "myresolver",
|
|
||||||
"traefik.http.services.blog-svc.loadbalancer.server.port": "8080"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
## Dynamic configuration
|
|
||||||
labels:
|
|
||||||
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
|
||||||
- traefik.http.routers.blog.tls=true
|
|
||||||
- traefik.http.routers.blog.tls.certresolver=myresolver
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
## Dynamic configuration
|
## Dynamic configuration
|
||||||
http:
|
http:
|
||||||
|
56
docs/content/https/spiffe.md
Normal file
56
docs/content/https/spiffe.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik SPIFFE Documentation"
|
||||||
|
description: "Learn how to configure Traefik to use SPIFFE. Read the technical documentation."
|
||||||
|
---
|
||||||
|
|
||||||
|
# SPIFFE
|
||||||
|
|
||||||
|
Secure the backend connection with SPIFFE.
|
||||||
|
{: .subtitle }
|
||||||
|
|
||||||
|
[SPIFFE](https://spiffe.io/docs/latest/spiffe-about/overview/) (Secure Production Identity Framework For Everyone),
|
||||||
|
provides a secure identity in the form of a specially crafted X.509 certificate,
|
||||||
|
to every workload in an environment.
|
||||||
|
|
||||||
|
Traefik is able to connect to the Workload API to obtain an x509-SVID used to secure the connection with SPIFFE enabled backends.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
Enabling SPIFFE is part of the [static configuration](../getting-started/configuration-overview.md#the-static-configuration).
|
||||||
|
It can be defined by using a file (YAML or TOML) or CLI arguments.
|
||||||
|
|
||||||
|
### Workload API
|
||||||
|
|
||||||
|
The `workloadAPIAddr` configuration defines the address of the SPIFFE [Workload API](https://spiffe.io/docs/latest/spiffe-about/spiffe-concepts/#spiffe-workload-api).
|
||||||
|
|
||||||
|
!!! info "Enabling SPIFFE in ServersTransports"
|
||||||
|
|
||||||
|
Enabling SPIFFE does not imply that backend connections are going to use it automatically.
|
||||||
|
Each [ServersTransport](../routing/services/index.md#serverstransport_1) or [TCPServersTransport](../routing/services/index.md#serverstransport_2),
|
||||||
|
that is meant to be secured with SPIFFE,
|
||||||
|
must explicitly enable it (see [SPIFFE with ServersTransport](../routing/services/index.md#spiffe) or [SPIFFE with TCPServersTransport](../routing/services/index.md#spiffe_1)).
|
||||||
|
|
||||||
|
!!! warning "SPIFFE can cause Traefik to stall"
|
||||||
|
When using SPIFFE,
|
||||||
|
Traefik will wait for the first SVID to be delivered before starting.
|
||||||
|
If Traefik is hanging when waiting on SPIFFE SVID delivery,
|
||||||
|
please double check that it is correctly registered as workload in your SPIFFE infrastructure.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
## Static configuration
|
||||||
|
spiffe:
|
||||||
|
workloadAPIAddr: localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
## Static configuration
|
||||||
|
[spiffe]
|
||||||
|
workloadAPIAddr: localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
## Static configuration
|
||||||
|
--spiffe.workloadAPIAddr=localhost
|
||||||
|
```
|
207
docs/content/https/tailscale.md
Normal file
207
docs/content/https/tailscale.md
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik Tailscale Documentation"
|
||||||
|
description: "Learn how to configure Traefik Proxy to resolve TLS certificates for your Tailscale services. Read the technical documentation."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Tailscale
|
||||||
|
|
||||||
|
Provision TLS certificates for your internal Tailscale services.
|
||||||
|
{: .subtitle }
|
||||||
|
|
||||||
|
To protect a service with TLS, a certificate from a public Certificate Authority is needed.
|
||||||
|
In addition to its vpn role, Tailscale can also [provide certificates](https://tailscale.com/kb/1153/enabling-https/) for the machines in your Tailscale network.
|
||||||
|
|
||||||
|
## Certificate resolvers
|
||||||
|
|
||||||
|
To obtain a TLS certificate from the Tailscale daemon,
|
||||||
|
a Tailscale certificate resolver needs to be configured as below.
|
||||||
|
|
||||||
|
!!! info "Referencing a certificate resolver"
|
||||||
|
|
||||||
|
Defining a certificate resolver does not imply that routers are going to use it automatically.
|
||||||
|
Each router or entrypoint that is meant to use the resolver must explicitly [reference](../routing/routers/index.md#certresolver) it.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
tailscale: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.tailscale]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--certificatesresolvers.myresolver.tailscale=true
|
||||||
|
```
|
||||||
|
|
||||||
|
## Domain Definition
|
||||||
|
|
||||||
|
A certificate resolver requests certificates for a set of domain names inferred from routers, according to the following:
|
||||||
|
|
||||||
|
- If the router has a [`tls.domains`](../routing/routers/index.md#domains) option set,
|
||||||
|
then the certificate resolver derives this router domain name from the `main` option of `tls.domains`.
|
||||||
|
|
||||||
|
- Otherwise, the certificate resolver derives the domain name from any `Host()` or `HostSNI()` matchers
|
||||||
|
in the [router's rule](../routing/routers/index.md#rule).
|
||||||
|
|
||||||
|
!!! info "Tailscale Domain Format"
|
||||||
|
|
||||||
|
The domain is only taken into account if it is a Tailscale-specific one,
|
||||||
|
i.e. of the form `machine-name.domains-alias.ts.net`.
|
||||||
|
|
||||||
|
## Configuration Example
|
||||||
|
|
||||||
|
!!! example "Enabling Tailscale certificate resolution"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
entryPoints:
|
||||||
|
web:
|
||||||
|
address: ":80"
|
||||||
|
|
||||||
|
websecure:
|
||||||
|
address: ":443"
|
||||||
|
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
tailscale: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[entryPoints]
|
||||||
|
[entryPoints.web]
|
||||||
|
address = ":80"
|
||||||
|
|
||||||
|
[entryPoints.websecure]
|
||||||
|
address = ":443"
|
||||||
|
|
||||||
|
[certificatesResolvers.myresolver.tailscale]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--entrypoints.web.address=:80
|
||||||
|
--entrypoints.websecure.address=:443
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.tailscale=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! example "Domain from Router's Rule Example"
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
## Dynamic configuration
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.blog.rule=Host(`monitoring.yak-bebop.ts.net`) && Path(`/metrics`)
|
||||||
|
- traefik.http.routers.blog.tls.certresolver=myresolver
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Docker (Swarm)"
|
||||||
|
## Dynamic configuration
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.blog.rule=Host(`monitoring.yak-bebop.ts.net`) && Path(`/metrics`)
|
||||||
|
- traefik.http.routers.blog.tls.certresolver=myresolver
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: blogtls
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
routes:
|
||||||
|
- match: Host(`monitoring.yak-bebop.ts.net`) && Path(`/metrics`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: blog
|
||||||
|
port: 8080
|
||||||
|
tls:
|
||||||
|
certResolver: myresolver
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
## Dynamic configuration
|
||||||
|
http:
|
||||||
|
routers:
|
||||||
|
blog:
|
||||||
|
rule: "Host(`monitoring.yak-bebop.ts.net`) && Path(`/metrics`)"
|
||||||
|
tls:
|
||||||
|
certResolver: myresolver
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
## Dynamic configuration
|
||||||
|
[http.routers]
|
||||||
|
[http.routers.blog]
|
||||||
|
rule = "Host(`monitoring.yak-bebop.ts.net`) && Path(`/metrics`)"
|
||||||
|
[http.routers.blog.tls]
|
||||||
|
certResolver = "myresolver"
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! example "Domain from Router's tls.domain Example"
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
## Dynamic configuration
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.blog.rule=Path(`/metrics`)
|
||||||
|
- traefik.http.routers.blog.tls.certresolver=myresolver
|
||||||
|
- traefik.http.routers.blog.tls.domains[0].main=monitoring.yak-bebop.ts.net
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Docker (Swarm)"
|
||||||
|
## Dynamic configuration
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.blog.rule=Path(`/metrics`)
|
||||||
|
- traefik.http.routers.blog.tls.certresolver=myresolver
|
||||||
|
- traefik.http.routers.blog.tls.domains[0].main=monitoring.yak-bebop.ts.net
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: blogtls
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
routes:
|
||||||
|
- match: Path(`/metrics`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: blog
|
||||||
|
port: 8080
|
||||||
|
tls:
|
||||||
|
certResolver: myresolver
|
||||||
|
domains:
|
||||||
|
- main: monitoring.yak-bebop.ts.net
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
## Dynamic configuration
|
||||||
|
http:
|
||||||
|
routers:
|
||||||
|
blog:
|
||||||
|
rule: "Path(`/metrics`)"
|
||||||
|
tls:
|
||||||
|
certResolver: myresolver
|
||||||
|
domains:
|
||||||
|
- main: "monitoring.yak-bebop.ts.net"
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
## Dynamic configuration
|
||||||
|
[http.routers]
|
||||||
|
[http.routers.blog]
|
||||||
|
rule = "Path(`/metrics`)"
|
||||||
|
[http.routers.blog.tls]
|
||||||
|
certResolver = "myresolver"
|
||||||
|
[[http.routers.blog.tls.domains]]
|
||||||
|
main = "monitoring.yak-bebop.ts.net"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Automatic Renewals
|
||||||
|
|
||||||
|
Traefik automatically tracks the expiry date of each Tailscale certificate it fetches,
|
||||||
|
and starts to renew a certificate 14 days before its expiry to match Tailscale daemon renew policy.
|
@@ -134,7 +134,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSStore
|
kind: TLSStore
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -195,7 +195,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSStore
|
kind: TLSStore
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -211,7 +211,7 @@ spec:
|
|||||||
- bar.example.org
|
- bar.example.org
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
## Dynamic configuration
|
## Dynamic configuration
|
||||||
labels:
|
labels:
|
||||||
- "traefik.tls.stores.default.defaultgeneratedcert.resolver=myresolver"
|
- "traefik.tls.stores.default.defaultgeneratedcert.resolver=myresolver"
|
||||||
@@ -219,14 +219,6 @@ labels:
|
|||||||
- "traefik.tls.stores.default.defaultgeneratedcert.domain.sans=foo.example.org, bar.example.org"
|
- "traefik.tls.stores.default.defaultgeneratedcert.domain.sans=foo.example.org, bar.example.org"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
labels: {
|
|
||||||
"traefik.tls.stores.default.defaultgeneratedcert.resolver": "myresolver",
|
|
||||||
"traefik.tls.stores.default.defaultgeneratedcert.domain.main": "example.org",
|
|
||||||
"traefik.tls.stores.default.defaultgeneratedcert.domain.sans": "foo.example.org, bar.example.org",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## TLS Options
|
## TLS Options
|
||||||
|
|
||||||
The TLS options allow one to configure some parameters of the TLS connection.
|
The TLS options allow one to configure some parameters of the TLS connection.
|
||||||
@@ -277,7 +269,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -287,7 +279,7 @@ spec:
|
|||||||
minVersion: VersionTLS12
|
minVersion: VersionTLS12
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: mintls13
|
name: mintls13
|
||||||
@@ -328,7 +320,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -338,7 +330,7 @@ spec:
|
|||||||
maxVersion: VersionTLS13
|
maxVersion: VersionTLS13
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: maxtls12
|
name: maxtls12
|
||||||
@@ -373,7 +365,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -418,7 +410,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -454,7 +446,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -493,7 +485,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
@@ -509,15 +501,17 @@ spec:
|
|||||||
|
|
||||||
Traefik supports mutual authentication, through the `clientAuth` section.
|
Traefik supports mutual authentication, through the `clientAuth` section.
|
||||||
|
|
||||||
For authentication policies that require verification of the client certificate, the certificate authority for the certificate should be set in `clientAuth.caFiles`.
|
For authentication policies that require verification of the client certificate, the certificate authority for the certificates should be set in `clientAuth.caFiles`.
|
||||||
|
|
||||||
|
In Kubernetes environment, CA certificate can be set in `clientAuth.secretNames`. See [TLSOption resource](../../routing/providers/kubernetes-crd#kind-tlsoption) for more details.
|
||||||
|
|
||||||
The `clientAuth.clientAuthType` option governs the behaviour as follows:
|
The `clientAuth.clientAuthType` option governs the behaviour as follows:
|
||||||
|
|
||||||
- `NoClientCert`: disregards any client certificate.
|
- `NoClientCert`: disregards any client certificate.
|
||||||
- `RequestClientCert`: asks for a certificate but proceeds anyway if none is provided.
|
- `RequestClientCert`: asks for a certificate but proceeds anyway if none is provided.
|
||||||
- `RequireAnyClientCert`: requires a certificate but does not verify if it is signed by a CA listed in `clientAuth.caFiles`.
|
- `RequireAnyClientCert`: requires a certificate but does not verify if it is signed by a CA listed in `clientAuth.caFiles` or in `clientAuth.secretNames`.
|
||||||
- `VerifyClientCertIfGiven`: if a certificate is provided, verifies if it is signed by a CA listed in `clientAuth.caFiles`. Otherwise proceeds without any certificate.
|
- `VerifyClientCertIfGiven`: if a certificate is provided, verifies if it is signed by a CA listed in `clientAuth.caFiles` or in `clientAuth.secretNames`. Otherwise proceeds without any certificate.
|
||||||
- `RequireAndVerifyClientCert`: requires a certificate, which must be signed by a CA listed in `clientAuth.caFiles`.
|
- `RequireAndVerifyClientCert`: requires a certificate, which must be signed by a CA listed in `clientAuth.caFiles` or in `clientAuth.secretNames`.
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Dynamic configuration
|
# Dynamic configuration
|
||||||
@@ -545,7 +539,7 @@ tls:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
|
3
docs/content/includes/kubernetes-requirements.md
Normal file
3
docs/content/includes/kubernetes-requirements.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Traefik follows the [Kubernetes support policy](https://kubernetes.io/releases/version-skew-policy/#supported-versions),
|
||||||
|
and supports at least the latest three minor versions of Kubernetes.
|
||||||
|
General functionality cannot be guaranteed for versions older than that.
|
11
docs/content/includes/traefik-api-management-kubernetes.md
Normal file
11
docs/content/includes/traefik-api-management-kubernetes.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
!!! question "Managing APIs in Kubernetes?"
|
||||||
|
|
||||||
|
If your organization is publishing, securing, and managing APIs, consider [Traefik Hub](https://traefik.io/traefik-hub/) for your API management solution.
|
||||||
|
|
||||||
|
- K8s services auto-discovery, 100% CRDs configuration, & full GitOps compliance
|
||||||
|
- Centralized control plane for all APIs, users, & infrastructure components
|
||||||
|
- Self-serve API portal with API discovery, documentation, testing, & access control
|
||||||
|
|
||||||
|
Traefik Hub makes managing APIs easier than ever before. See for yourself in this [short video walkthrough](https://info.traefik.io/watch-traefik-hub-demo).
|
@@ -2,15 +2,10 @@
|
|||||||
|
|
||||||
!!! question "Using Traefik for Business Applications?"
|
!!! question "Using Traefik for Business Applications?"
|
||||||
|
|
||||||
If you are using Traefik for commercial applications,
|
If you are using Traefik in your organization, consider [Traefik Enterprise](https://traefik.io/traefik-enterprise/). You can use it as your:
|
||||||
consider the [Enterprise Edition](https://traefik.io/traefik-enterprise/).
|
|
||||||
You can use it as your:
|
|
||||||
|
|
||||||
|
- [API Gateway](https://traefik.io/solutions/api-gateway/)
|
||||||
- [Kubernetes Ingress Controller](https://traefik.io/solutions/kubernetes-ingress/)
|
- [Kubernetes Ingress Controller](https://traefik.io/solutions/kubernetes-ingress/)
|
||||||
- [Docker Swarm Ingress Controller](https://traefik.io/solutions/docker-swarm-ingress/)
|
- [Docker Swarm Ingress Controller](https://traefik.io/solutions/docker-swarm-ingress/)
|
||||||
- [API Gateway](https://traefik.io/solutions/api-gateway/)
|
|
||||||
|
|
||||||
Traefik Enterprise enables centralized access management,
|
Traefik Enterprise simplifies the discovery, security, and deployment of APIs and microservices across any environment. See it in action in [this short video walkthrough](https://info.traefik.io/watch-traefikee-demo).
|
||||||
distributed Let's Encrypt,
|
|
||||||
and other advanced capabilities.
|
|
||||||
Learn more in [this 15-minute technical walkthrough](https://info.traefik.io/watch-traefikee-demo).
|
|
||||||
|
@@ -13,7 +13,7 @@ It receives requests on behalf of your system and finds out which components are
|
|||||||
What sets Traefik apart, besides its many features, is that it automatically discovers the right configuration for your services.
|
What sets Traefik apart, besides its many features, is that it automatically discovers the right configuration for your services.
|
||||||
The magic happens when Traefik inspects your infrastructure, where it finds relevant information and discovers which service serves which request.
|
The magic happens when Traefik inspects your infrastructure, where it finds relevant information and discovers which service serves which request.
|
||||||
|
|
||||||
Traefik is natively compliant with every major cluster technology, such as Kubernetes, Docker, Docker Swarm, AWS, Mesos, Marathon, and [the list goes on](providers/overview.md); and can handle many at the same time. (It even works for legacy software running on bare metal.)
|
Traefik is natively compliant with every major cluster technology, such as Kubernetes, Docker, Docker Swarm, AWS, and [the list goes on](providers/overview.md); and can handle many at the same time. (It even works for legacy software running on bare metal.)
|
||||||
|
|
||||||
With Traefik, there is no need to maintain and synchronize a separate configuration file: everything happens automatically, in real time (no restarts, no connection interruptions).
|
With Traefik, there is no need to maintain and synchronize a separate configuration file: everything happens automatically, in real time (no restarts, no connection interruptions).
|
||||||
With Traefik, you spend time developing and deploying new features to your system, not on configuring and maintaining its working state.
|
With Traefik, you spend time developing and deploying new features to your system, not on configuring and maintaining its working state.
|
||||||
@@ -24,10 +24,8 @@ Developing Traefik, our main goal is to make it simple to use, and we're sure yo
|
|||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
|
|
||||||
Join our user friendly and active [Community Forum](https://community.traefik.io) to discuss, learn, and connect with the traefik community.
|
Join our user friendly and active [Community Forum](https://community.traefik.io "Link to Traefik Community Forum") to discuss, learn, and connect with the traefik community.
|
||||||
|
|
||||||
Using Traefik for commercial applications?
|
Using Traefik in your organization? Consider [Traefik Enterprise](https://traefik.io/traefik-enterprise/ "Lino to Traefik Enterprise"), our unified API Gateway and Ingress that simplifies the discovery, security, and deployment of APIs and microservices across any environment.
|
||||||
Consider the [Enterprise Edition](https://traefik.io/traefik-enterprise/) of Traefik as your [Kubernetes Ingress](https://traefik.io/solutions/kubernetes-ingress/),
|
|
||||||
your [Docker Swarm Load Balancer](https://traefik.io/solutions/docker-swarm-ingress/),
|
See it in action in [this short video walkthrough](https://info.traefik.io/watch-traefikee-demo "Link to video walkthrough").
|
||||||
or your [API gateway](https://traefik.io/solutions/api-gateway/).
|
|
||||||
Get started with a [free 30-day trial](https://info.traefik.io/get-traefik-enterprise-free-for-30-days).
|
|
||||||
|
@@ -14,7 +14,7 @@ The AddPrefix middleware updates the path of a request before forwarding it.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Prefixing with /foo
|
# Prefixing with /foo
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.add-foo.addprefix.prefix=/foo"
|
- "traefik.http.middlewares.add-foo.addprefix.prefix=/foo"
|
||||||
@@ -22,7 +22,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Prefixing with /foo
|
# Prefixing with /foo
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: add-foo
|
name: add-foo
|
||||||
@@ -36,18 +36,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.add-foo.addprefix.prefix=/foo"
|
- "traefik.http.middlewares.add-foo.addprefix.prefix=/foo"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.add-foo.addprefix.prefix": "/foo"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Prefixing with /foo
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.add-foo.addprefix.prefix=/foo"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Prefixing with /foo
|
# Prefixing with /foo
|
||||||
http:
|
http:
|
||||||
|
@@ -14,7 +14,7 @@ The BasicAuth middleware restricts access to your services to known users.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
#
|
#
|
||||||
# Note: when used in docker-compose.yml all dollar signs in the hash need to be doubled for escaping.
|
# Note: when used in docker-compose.yml all dollar signs in the hash need to be doubled for escaping.
|
||||||
@@ -28,7 +28,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -41,18 +41,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
- "traefik.http.middlewares.test-auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.basicauth.users": "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Declaring the user list
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
http:
|
http:
|
||||||
@@ -100,7 +88,7 @@ The `users` option is an array of authorized users. Each user must be declared u
|
|||||||
Please note that these keys are not hashed or encrypted in any way, and therefore is less secure than other methods.
|
Please note that these keys are not hashed or encrypted in any way, and therefore is less secure than other methods.
|
||||||
You can find more information on the [Kubernetes Basic Authentication Secret Documentation](https://kubernetes.io/docs/concepts/configuration/secret/#basic-authentication-secret)
|
You can find more information on the [Kubernetes Basic Authentication Secret Documentation](https://kubernetes.io/docs/concepts/configuration/secret/#basic-authentication-secret)
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
#
|
#
|
||||||
# Note: when used in docker-compose.yml all dollar signs in the hash need to be doubled for escaping.
|
# Note: when used in docker-compose.yml all dollar signs in the hash need to be doubled for escaping.
|
||||||
@@ -114,7 +102,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -157,18 +145,6 @@ data:
|
|||||||
- "traefik.http.middlewares.test-auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
- "traefik.http.middlewares.test-auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.basicauth.users": "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Declaring the user list
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
http:
|
http:
|
||||||
@@ -201,13 +177,13 @@ The file content is a list of `name:hashed-password`.
|
|||||||
- If both `users` and `usersFile` are provided, the two are merged. The contents of `usersFile` have precedence over the values in `users`.
|
- If both `users` and `usersFile` are provided, the two are merged. The contents of `usersFile` have precedence over the values in `users`.
|
||||||
- Because it does not make much sense to refer to a file path on Kubernetes, the `usersFile` field doesn't exist for Kubernetes IngressRoute, and one should use the `secret` field instead.
|
- Because it does not make much sense to refer to a file path on Kubernetes, the `usersFile` field doesn't exist for Kubernetes IngressRoute, and one should use the `secret` field instead.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.usersfile=/path/to/my/usersfile"
|
- "traefik.http.middlewares.test-auth.basicauth.usersfile=/path/to/my/usersfile"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -232,17 +208,6 @@ data:
|
|||||||
- "traefik.http.middlewares.test-auth.basicauth.usersfile=/path/to/my/usersfile"
|
- "traefik.http.middlewares.test-auth.basicauth.usersfile=/path/to/my/usersfile"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.basicauth.usersfile": "/path/to/my/usersfile"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.usersfile=/path/to/my/usersfile"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -268,13 +233,13 @@ http:
|
|||||||
|
|
||||||
You can customize the realm for the authentication with the `realm` option. The default value is `traefik`.
|
You can customize the realm for the authentication with the `realm` option. The default value is `traefik`.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.realm=MyRealm"
|
- "traefik.http.middlewares.test-auth.basicauth.realm=MyRealm"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -287,17 +252,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.basicauth.realm=MyRealm"
|
- "traefik.http.middlewares.test-auth.basicauth.realm=MyRealm"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.basicauth.realm": "MyRealm"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.realm=MyRealm"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -316,13 +270,13 @@ http:
|
|||||||
|
|
||||||
You can define a header field to store the authenticated user using the `headerField`option.
|
You can define a header field to store the authenticated user using the `headerField`option.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.my-auth.basicauth.headerField=X-WebAuth-User"
|
- "traefik.http.middlewares.my-auth.basicauth.headerField=X-WebAuth-User"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: my-auth
|
name: my-auth
|
||||||
@@ -336,12 +290,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.my-auth.basicauth.headerField=X-WebAuth-User"
|
- "traefik.http.middlewares.my-auth.basicauth.headerField=X-WebAuth-User"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.my-auth.basicauth.headerField": "X-WebAuth-User"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -361,13 +309,13 @@ http:
|
|||||||
|
|
||||||
Set the `removeHeader` option to `true` to remove the authorization header before forwarding the request to your service. (Default value is `false`.)
|
Set the `removeHeader` option to `true` to remove the authorization header before forwarding the request to your service. (Default value is `false`.)
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.removeheader=true"
|
- "traefik.http.middlewares.test-auth.basicauth.removeheader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -380,17 +328,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.basicauth.removeheader=true"
|
- "traefik.http.middlewares.test-auth.basicauth.removeheader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.basicauth.removeheader": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.removeheader=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@@ -18,7 +18,7 @@ This can help services avoid large amounts of data (`multipart/form-data` for ex
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Sets the maximum request body to 2MB
|
# Sets the maximum request body to 2MB
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
||||||
@@ -26,7 +26,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Sets the maximum request body to 2MB
|
# Sets the maximum request body to 2MB
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: limit
|
name: limit
|
||||||
@@ -40,18 +40,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.limit.buffering.maxRequestBodyBytes": "2000000"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Sets the maximum request body to 2MB
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Sets the maximum request body to 2MB
|
# Sets the maximum request body to 2MB
|
||||||
http:
|
http:
|
||||||
@@ -78,13 +66,13 @@ The `maxRequestBodyBytes` option configures the maximum allowed body size for th
|
|||||||
|
|
||||||
If the request exceeds the allowed size, it is not forwarded to the service, and the client gets a `413` (Request Entity Too Large) response.
|
If the request exceeds the allowed size, it is not forwarded to the service, and the client gets a `413` (Request Entity Too Large) response.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: limit
|
name: limit
|
||||||
@@ -97,17 +85,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.limit.buffering.maxRequestBodyBytes": "2000000"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=2000000"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -128,13 +105,13 @@ _Optional, Default=1048576_
|
|||||||
|
|
||||||
You can configure a threshold (in bytes) from which the request will be buffered on disk instead of in memory with the `memRequestBodyBytes` option.
|
You can configure a threshold (in bytes) from which the request will be buffered on disk instead of in memory with the `memRequestBodyBytes` option.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.limit.buffering.memRequestBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.memRequestBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: limit
|
name: limit
|
||||||
@@ -147,17 +124,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.limit.buffering.memRequestBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.memRequestBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.limit.buffering.memRequestBodyBytes": "2000000"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.limit.buffering.memRequestBodyBytes=2000000"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -180,13 +146,13 @@ The `maxResponseBodyBytes` option configures the maximum allowed response size f
|
|||||||
|
|
||||||
If the response exceeds the allowed size, it is not forwarded to the client. The client gets a `500` (Internal Server Error) response instead.
|
If the response exceeds the allowed size, it is not forwarded to the client. The client gets a `500` (Internal Server Error) response instead.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.limit.buffering.maxResponseBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.maxResponseBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: limit
|
name: limit
|
||||||
@@ -199,17 +165,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.limit.buffering.maxResponseBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.maxResponseBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.limit.buffering.maxResponseBodyBytes": "2000000"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.limit.buffering.maxResponseBodyBytes=2000000"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -230,13 +185,13 @@ _Optional, Default=1048576_
|
|||||||
|
|
||||||
You can configure a threshold (in bytes) from which the response will be buffered on disk instead of in memory with the `memResponseBodyBytes` option.
|
You can configure a threshold (in bytes) from which the response will be buffered on disk instead of in memory with the `memResponseBodyBytes` option.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.limit.buffering.memResponseBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.memResponseBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: limit
|
name: limit
|
||||||
@@ -249,17 +204,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.limit.buffering.memResponseBodyBytes=2000000"
|
- "traefik.http.middlewares.limit.buffering.memResponseBodyBytes=2000000"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.limit.buffering.memResponseBodyBytes": "2000000"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.limit.buffering.memResponseBodyBytes=2000000"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -282,13 +226,13 @@ You can have the Buffering middleware replay the request using `retryExpression`
|
|||||||
|
|
||||||
??? example "Retries once in the case of a network error"
|
??? example "Retries once in the case of a network error"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.limit.buffering.retryExpression=IsNetworkError() && Attempts() < 2"
|
- "traefik.http.middlewares.limit.buffering.retryExpression=IsNetworkError() && Attempts() < 2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: limit
|
name: limit
|
||||||
@@ -301,17 +245,6 @@ You can have the Buffering middleware replay the request using `retryExpression`
|
|||||||
- "traefik.http.middlewares.limit.buffering.retryExpression=IsNetworkError() && Attempts() < 2"
|
- "traefik.http.middlewares.limit.buffering.retryExpression=IsNetworkError() && Attempts() < 2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.limit.buffering.retryExpression": "IsNetworkError() && Attempts() < 2"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.limit.buffering.retryExpression=IsNetworkError() && Attempts() < 2"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@@ -15,9 +15,9 @@ It makes reusing the same groups easier.
|
|||||||
|
|
||||||
## Configuration Example
|
## Configuration Example
|
||||||
|
|
||||||
Below is an example of a Chain containing `WhiteList`, `BasicAuth`, and `RedirectScheme`.
|
Below is an example of a Chain containing `AllowList`, `BasicAuth`, and `RedirectScheme`.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.routers.router1.service=service1"
|
- "traefik.http.routers.router1.service=service1"
|
||||||
- "traefik.http.routers.router1.middlewares=secured"
|
- "traefik.http.routers.router1.middlewares=secured"
|
||||||
@@ -25,12 +25,12 @@ labels:
|
|||||||
- "traefik.http.middlewares.secured.chain.middlewares=https-only,known-ips,auth-users"
|
- "traefik.http.middlewares.secured.chain.middlewares=https-only,known-ips,auth-users"
|
||||||
- "traefik.http.middlewares.auth-users.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
|
- "traefik.http.middlewares.auth-users.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
|
||||||
- "traefik.http.middlewares.https-only.redirectscheme.scheme=https"
|
- "traefik.http.middlewares.https-only.redirectscheme.scheme=https"
|
||||||
- "traefik.http.middlewares.known-ips.ipwhitelist.sourceRange=192.168.1.7,127.0.0.1/32"
|
- "traefik.http.middlewares.known-ips.ipallowlist.sourceRange=192.168.1.7,127.0.0.1/32"
|
||||||
- "traefik.http.services.service1.loadbalancer.server.port=80"
|
- "traefik.http.services.service1.loadbalancer.server.port=80"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: test
|
name: test
|
||||||
@@ -47,7 +47,7 @@ spec:
|
|||||||
middlewares:
|
middlewares:
|
||||||
- name: secured
|
- name: secured
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: secured
|
name: secured
|
||||||
@@ -58,7 +58,7 @@ spec:
|
|||||||
- name: known-ips
|
- name: known-ips
|
||||||
- name: auth-users
|
- name: auth-users
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: auth-users
|
name: auth-users
|
||||||
@@ -67,7 +67,7 @@ spec:
|
|||||||
users:
|
users:
|
||||||
- test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/
|
- test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: https-only
|
name: https-only
|
||||||
@@ -75,12 +75,12 @@ spec:
|
|||||||
redirectScheme:
|
redirectScheme:
|
||||||
scheme: https
|
scheme: https
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: known-ips
|
name: known-ips
|
||||||
spec:
|
spec:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- 192.168.1.7
|
- 192.168.1.7
|
||||||
- 127.0.0.1/32
|
- 127.0.0.1/32
|
||||||
@@ -93,35 +93,10 @@ spec:
|
|||||||
- "traefik.http.middlewares.secured.chain.middlewares=https-only,known-ips,auth-users"
|
- "traefik.http.middlewares.secured.chain.middlewares=https-only,known-ips,auth-users"
|
||||||
- "traefik.http.middlewares.auth-users.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
|
- "traefik.http.middlewares.auth-users.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
|
||||||
- "traefik.http.middlewares.https-only.redirectscheme.scheme=https"
|
- "traefik.http.middlewares.https-only.redirectscheme.scheme=https"
|
||||||
- "traefik.http.middlewares.known-ips.ipwhitelist.sourceRange=192.168.1.7,127.0.0.1/32"
|
- "traefik.http.middlewares.known-ips.ipallowlist.sourceRange=192.168.1.7,127.0.0.1/32"
|
||||||
- "traefik.http.services.service1.loadbalancer.server.port=80"
|
- "traefik.http.services.service1.loadbalancer.server.port=80"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.routers.router1.service": "service1",
|
|
||||||
"traefik.http.routers.router1.middlewares": "secured",
|
|
||||||
"traefik.http.routers.router1.rule": "Host(`mydomain`)",
|
|
||||||
"traefik.http.middlewares.secured.chain.middlewares": "https-only,known-ips,auth-users",
|
|
||||||
"traefik.http.middlewares.auth-users.basicauth.users": "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
|
|
||||||
"traefik.http.middlewares.https-only.redirectscheme.scheme": "https",
|
|
||||||
"traefik.http.middlewares.known-ips.ipwhitelist.sourceRange": "192.168.1.7,127.0.0.1/32",
|
|
||||||
"traefik.http.services.service1.loadbalancer.server.port": "80"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.routers.router1.service=service1"
|
|
||||||
- "traefik.http.routers.router1.middlewares=secured"
|
|
||||||
- "traefik.http.routers.router1.rule=Host(`mydomain`)"
|
|
||||||
- "traefik.http.middlewares.secured.chain.middlewares=https-only,known-ips,auth-users"
|
|
||||||
- "traefik.http.middlewares.auth-users.basicauth.users=test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
|
|
||||||
- "traefik.http.middlewares.https-only.redirectscheme.scheme=https"
|
|
||||||
- "traefik.http.middlewares.known-ips.ipwhitelist.sourceRange=192.168.1.7,127.0.0.1/32"
|
|
||||||
- "traefik.http.services.service1.loadbalancer.server.port=80"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# ...
|
# ...
|
||||||
http:
|
http:
|
||||||
@@ -150,7 +125,7 @@ http:
|
|||||||
scheme: https
|
scheme: https
|
||||||
|
|
||||||
known-ips:
|
known-ips:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- "192.168.1.7"
|
- "192.168.1.7"
|
||||||
- "127.0.0.1/32"
|
- "127.0.0.1/32"
|
||||||
@@ -180,7 +155,7 @@ http:
|
|||||||
[http.middlewares.https-only.redirectScheme]
|
[http.middlewares.https-only.redirectScheme]
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
|
|
||||||
[http.middlewares.known-ips.ipWhiteList]
|
[http.middlewares.known-ips.ipAllowList]
|
||||||
sourceRange = ["192.168.1.7", "127.0.0.1/32"]
|
sourceRange = ["192.168.1.7", "127.0.0.1/32"]
|
||||||
|
|
||||||
[http.services]
|
[http.services]
|
||||||
|
@@ -30,7 +30,7 @@ To assess if your system is healthy, the circuit breaker constantly monitors the
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Latency Check
|
# Latency Check
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.latency-check.circuitbreaker.expression=LatencyAtQuantileMS(50.0) > 100"
|
- "traefik.http.middlewares.latency-check.circuitbreaker.expression=LatencyAtQuantileMS(50.0) > 100"
|
||||||
@@ -38,7 +38,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Latency Check
|
# Latency Check
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: latency-check
|
name: latency-check
|
||||||
@@ -52,18 +52,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.latency-check.circuitbreaker.expression=LatencyAtQuantileMS(50.0) > 100"
|
- "traefik.http.middlewares.latency-check.circuitbreaker.expression=LatencyAtQuantileMS(50.0) > 100"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.latency-check.circuitbreaker.expression": "LatencyAtQuantileMS(50.0) > 100"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Latency Check
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.latency-check.circuitbreaker.expression=LatencyAtQuantileMS(50.0) > 100"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Latency Check
|
# Latency Check
|
||||||
http:
|
http:
|
||||||
|
@@ -5,24 +5,25 @@ description: "Traefik Proxy's HTTP middleware lets you compress responses before
|
|||||||
|
|
||||||
# Compress
|
# Compress
|
||||||
|
|
||||||
Compress Responses before Sending them to the Client
|
Compress Allows Compressing Responses before Sending them to the Client
|
||||||
{: .subtitle }
|
{: .subtitle }
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The Compress middleware uses gzip compression.
|
The Compress middleware supports gzip and Brotli compression.
|
||||||
|
The activation of compression, and the compression method choice rely (among other things) on the request's `Accept-Encoding` header.
|
||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Enable gzip compression
|
# Enable compression
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-compress.compress=true"
|
- "traefik.http.middlewares.test-compress.compress=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Enable gzip compression
|
# Enable compression
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-compress
|
name: test-compress
|
||||||
@@ -31,24 +32,12 @@ spec:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Enable gzip compression
|
# Enable compression
|
||||||
- "traefik.http.middlewares.test-compress.compress=true"
|
- "traefik.http.middlewares.test-compress.compress=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-compress.compress": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Enable gzip compression
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-compress.compress=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Enable gzip compression
|
# Enable compression
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
test-compress:
|
test-compress:
|
||||||
@@ -56,7 +45,7 @@ http:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# Enable gzip compression
|
# Enable compression
|
||||||
[http.middlewares]
|
[http.middlewares]
|
||||||
[http.middlewares.test-compress.compress]
|
[http.middlewares.test-compress.compress]
|
||||||
```
|
```
|
||||||
@@ -65,30 +54,41 @@ http:
|
|||||||
|
|
||||||
Responses are compressed when the following criteria are all met:
|
Responses are compressed when the following criteria are all met:
|
||||||
|
|
||||||
* The response body is larger than the configured minimum amount of bytes (default is `1024`).
|
* The `Accept-Encoding` request header contains `gzip`, `*`, and/or `br` with or without [quality values](https://developer.mozilla.org/en-US/docs/Glossary/Quality_values).
|
||||||
* The `Accept-Encoding` request header contains `gzip`.
|
If the `Accept-Encoding` request header is absent, it is meant as br compression is requested.
|
||||||
|
If it is present, but its value is the empty string, then compression is disabled.
|
||||||
* The response is not already compressed, i.e. the `Content-Encoding` response header is not already set.
|
* The response is not already compressed, i.e. the `Content-Encoding` response header is not already set.
|
||||||
|
* The response`Content-Type` header is not one among the [excludedContentTypes options](#excludedcontenttypes).
|
||||||
If the `Content-Type` header is not defined, or empty, the compress middleware will automatically [detect](https://mimesniff.spec.whatwg.org/) a content type.
|
* The response body is larger than the [configured minimum amount of bytes](#minresponsebodybytes) (default is `1024`).
|
||||||
It will also set the `Content-Type` header according to the detected MIME type.
|
|
||||||
|
|
||||||
## Configuration Options
|
## Configuration Options
|
||||||
|
|
||||||
### `excludedContentTypes`
|
### `excludedContentTypes`
|
||||||
|
|
||||||
|
_Optional, Default=""_
|
||||||
|
|
||||||
`excludedContentTypes` specifies a list of content types to compare the `Content-Type` header of the incoming requests and responses before compressing.
|
`excludedContentTypes` specifies a list of content types to compare the `Content-Type` header of the incoming requests and responses before compressing.
|
||||||
|
|
||||||
The responses with content types defined in `excludedContentTypes` are not compressed.
|
The responses with content types defined in `excludedContentTypes` are not compressed.
|
||||||
|
|
||||||
Content types are compared in a case-insensitive, whitespace-ignored manner.
|
Content types are compared in a case-insensitive, whitespace-ignored manner.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
!!! info "In the case of gzip"
|
||||||
|
|
||||||
|
If the `Content-Type` header is not defined, or empty, the compress middleware will automatically [detect](https://mimesniff.spec.whatwg.org/) a content type.
|
||||||
|
It will also set the `Content-Type` header according to the detected MIME type.
|
||||||
|
|
||||||
|
!!! info "gRPC"
|
||||||
|
|
||||||
|
Note that `application/grpc` is never compressed.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-compress.compress.excludedcontenttypes=text/event-stream"
|
- "traefik.http.middlewares.test-compress.compress.excludedcontenttypes=text/event-stream"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-compress
|
name: test-compress
|
||||||
@@ -102,17 +102,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-compress.compress.excludedcontenttypes=text/event-stream"
|
- "traefik.http.middlewares.test-compress.compress.excludedcontenttypes=text/event-stream"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-compress.compress.excludedcontenttypes": "text/event-stream"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-compress.compress.excludedcontenttypes=text/event-stream"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -130,19 +119,19 @@ http:
|
|||||||
|
|
||||||
### `minResponseBodyBytes`
|
### `minResponseBodyBytes`
|
||||||
|
|
||||||
`minResponseBodyBytes` specifies the minimum amount of bytes a response body must have to be compressed.
|
_Optional, Default=1024_
|
||||||
|
|
||||||
The default value is `1024`, which should be a reasonable value for most cases.
|
`minResponseBodyBytes` specifies the minimum amount of bytes a response body must have to be compressed.
|
||||||
|
|
||||||
Responses smaller than the specified values will not be compressed.
|
Responses smaller than the specified values will not be compressed.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-compress.compress.minresponsebodybytes=1200"
|
- "traefik.http.middlewares.test-compress.compress.minresponsebodybytes=1200"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-compress
|
name: test-compress
|
||||||
@@ -155,17 +144,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-compress.compress.minresponsebodybytes=1200"
|
- "traefik.http.middlewares.test-compress.compress.minresponsebodybytes=1200"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-compress.compress.minresponsebodybytes": 1200
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-compress.compress.minresponsebodybytes=1200"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Traefik ContentType Documentation"
|
title: "Traefik ContentType Documentation"
|
||||||
description: "Traefik Proxy's HTTP middleware can automatically specify the content-type header if it has not been defined by the backend. Read the technical documentation."
|
description: "Traefik Proxy's HTTP middleware automatically sets the `Content-Type` header value when it is not set by the backend. Read the technical documentation."
|
||||||
---
|
---
|
||||||
|
|
||||||
# ContentType
|
# ContentType
|
||||||
@@ -8,84 +8,47 @@ description: "Traefik Proxy's HTTP middleware can automatically specify the cont
|
|||||||
Handling Content-Type auto-detection
|
Handling Content-Type auto-detection
|
||||||
{: .subtitle }
|
{: .subtitle }
|
||||||
|
|
||||||
The Content-Type middleware - or rather its `autoDetect` option -
|
The Content-Type middleware sets the `Content-Type` header value to the media type detected from the response content,
|
||||||
specifies whether to let the `Content-Type` header,
|
when it is not set by the backend.
|
||||||
if it has not been defined by the backend,
|
|
||||||
be automatically set to a value derived from the contents of the response.
|
|
||||||
|
|
||||||
As a proxy, the default behavior should be to leave the header alone,
|
|
||||||
regardless of what the backend did with it.
|
|
||||||
However, the historic default was to always auto-detect and set the header if it was not already defined,
|
|
||||||
and altering this behavior would be a breaking change which would impact many users.
|
|
||||||
|
|
||||||
This middleware exists to enable the correct behavior until at least the default one can be changed in a future version.
|
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
|
|
||||||
As explained above, for compatibility reasons the default behavior on a router (without this middleware),
|
|
||||||
is still to automatically set the `Content-Type` header.
|
|
||||||
Therefore, given the default value of the `autoDetect` option (false),
|
|
||||||
simply enabling this middleware for a router switches the router's behavior.
|
|
||||||
|
|
||||||
The scope of the Content-Type middleware is the MIME type detection done by the core of Traefik (the server part).
|
The scope of the Content-Type middleware is the MIME type detection done by the core of Traefik (the server part).
|
||||||
Therefore, it has no effect against any other `Content-Type` header modifications (e.g.: in another middleware such as compress).
|
Therefore, it has no effect against any other `Content-Type` header modifications (e.g.: in another middleware such as compress).
|
||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Disable auto-detection
|
# Enable auto-detection
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.autodetect.contenttype.autodetect=false"
|
- "traefik.http.middlewares.autodetect.contenttype=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Disable auto-detection
|
# Enable auto-detection
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: autodetect
|
name: autodetect
|
||||||
spec:
|
spec:
|
||||||
contentType:
|
contentType: {}
|
||||||
autoDetect: false
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Disable auto-detection
|
# Enable auto-detection
|
||||||
- "traefik.http.middlewares.autodetect.contenttype.autodetect=false"
|
- "traefik.http.middlewares.autodetect.contenttype=true"
|
||||||
```
|
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.autodetect.contenttype.autodetect": "false"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Disable auto-detection
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.autodetect.contenttype.autodetect=false"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Disable auto-detection
|
# Enable auto-detection
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
autodetect:
|
autodetect:
|
||||||
contentType:
|
contentType: {}
|
||||||
autoDetect: false
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# Disable auto-detection
|
# Enable auto-detection
|
||||||
[http.middlewares]
|
[http.middlewares]
|
||||||
[http.middlewares.autodetect.contentType]
|
[http.middlewares.autodetect.contentType]
|
||||||
autoDetect=false
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration Options
|
|
||||||
|
|
||||||
### `autoDetect`
|
|
||||||
|
|
||||||
`autoDetect` specifies whether to let the `Content-Type` header,
|
|
||||||
if it has not been set by the backend,
|
|
||||||
be automatically set to a value derived from the contents of the response.
|
|
||||||
|
@@ -14,7 +14,7 @@ The DigestAuth middleware restricts access to your services to known users.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
||||||
@@ -22,7 +22,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -36,18 +36,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.digestauth.users": "test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Declaring the user list
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
http:
|
http:
|
||||||
@@ -84,13 +72,13 @@ The `users` option is an array of authorized users. Each user will be declared u
|
|||||||
- If both `users` and `usersFile` are provided, the two are merged. The contents of `usersFile` have precedence over the values in `users`.
|
- If both `users` and `usersFile` are provided, the two are merged. The contents of `usersFile` have precedence over the values in `users`.
|
||||||
- For security reasons, the field `users` doesn't exist for Kubernetes IngressRoute, and one should use the `secret` field instead.
|
- For security reasons, the field `users` doesn't exist for Kubernetes IngressRoute, and one should use the `secret` field instead.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -114,17 +102,6 @@ data:
|
|||||||
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.digestauth.users": "test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.users=test:traefik:a2688e031edb4be6a3797f3882655c05,test2:traefik:518845800f9e2bfb1f1f740ec24f074e"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -155,13 +132,13 @@ The file content is a list of `name:realm:encoded-password`.
|
|||||||
- If both `users` and `usersFile` are provided, the two are merged. The contents of `usersFile` have precedence over the values in `users`.
|
- If both `users` and `usersFile` are provided, the two are merged. The contents of `usersFile` have precedence over the values in `users`.
|
||||||
- Because it does not make much sense to refer to a file path on Kubernetes, the `usersFile` field doesn't exist for Kubernetes IngressRoute, and one should use the `secret` field instead.
|
- Because it does not make much sense to refer to a file path on Kubernetes, the `usersFile` field doesn't exist for Kubernetes IngressRoute, and one should use the `secret` field instead.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.usersfile=/path/to/my/usersfile"
|
- "traefik.http.middlewares.test-auth.digestauth.usersfile=/path/to/my/usersfile"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -186,17 +163,6 @@ data:
|
|||||||
- "traefik.http.middlewares.test-auth.digestauth.usersfile=/path/to/my/usersfile"
|
- "traefik.http.middlewares.test-auth.digestauth.usersfile=/path/to/my/usersfile"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.digestauth.usersfile": "/path/to/my/usersfile"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.usersfile=/path/to/my/usersfile"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -222,13 +188,13 @@ http:
|
|||||||
|
|
||||||
You can customize the realm for the authentication with the `realm` option. The default value is `traefik`.
|
You can customize the realm for the authentication with the `realm` option. The default value is `traefik`.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.realm=MyRealm"
|
- "traefik.http.middlewares.test-auth.digestauth.realm=MyRealm"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -241,17 +207,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.digestauth.realm=MyRealm"
|
- "traefik.http.middlewares.test-auth.digestauth.realm=MyRealm"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.digestauth.realm": "MyRealm"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.realm=MyRealm"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -270,13 +225,13 @@ http:
|
|||||||
|
|
||||||
You can customize the header field for the authenticated user using the `headerField`option.
|
You can customize the header field for the authenticated user using the `headerField`option.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.my-auth.digestauth.headerField=X-WebAuth-User"
|
- "traefik.http.middlewares.my-auth.digestauth.headerField=X-WebAuth-User"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: my-auth
|
name: my-auth
|
||||||
@@ -290,17 +245,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.my-auth.digestauth.headerField=X-WebAuth-User"
|
- "traefik.http.middlewares.my-auth.digestauth.headerField=X-WebAuth-User"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.my-auth.digestauth.headerField": "X-WebAuth-User"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.my-auth.digestauth.headerField=X-WebAuth-User"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -320,13 +264,13 @@ http:
|
|||||||
|
|
||||||
Set the `removeHeader` option to `true` to remove the authorization header before forwarding the request to your service. (Default value is `false`.)
|
Set the `removeHeader` option to `true` to remove the authorization header before forwarding the request to your service. (Default value is `false`.)
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.removeheader=true"
|
- "traefik.http.middlewares.test-auth.digestauth.removeheader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -339,17 +283,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.digestauth.removeheader=true"
|
- "traefik.http.middlewares.test-auth.digestauth.removeheader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.digestauth.removeheader": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.digestauth.removeheader=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@@ -18,7 +18,7 @@ The Errors middleware returns a custom page in lieu of the default, according to
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Dynamic Custom Error Page for 5XX Status Code
|
# Dynamic Custom Error Page for 5XX Status Code
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-errors.errors.status=500-599"
|
- "traefik.http.middlewares.test-errors.errors.status=500-599"
|
||||||
@@ -27,7 +27,7 @@ labels:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-errors
|
name: test-errors
|
||||||
@@ -48,22 +48,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-errors.errors.query=/{status}.html"
|
- "traefik.http.middlewares.test-errors.errors.query=/{status}.html"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-errors.errors.status": "500-599",
|
|
||||||
"traefik.http.middlewares.test-errors.errors.service": "serviceError",
|
|
||||||
"traefik.http.middlewares.test-errors.errors.query": "/{status}.html"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Dynamic Custom Error Page for 5XX Status Code
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-errors.errors.status=500-599"
|
|
||||||
- "traefik.http.middlewares.test-errors.errors.service=serviceError"
|
|
||||||
- "traefik.http.middlewares.test-errors.errors.query=/{status}.html"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Custom Error Page for 5XX
|
# Custom Error Page for 5XX
|
||||||
http:
|
http:
|
||||||
|
@@ -16,7 +16,7 @@ Otherwise, the response from the authentication server is returned.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Forward authentication to example.com
|
# Forward authentication to example.com
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
||||||
@@ -24,7 +24,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Forward authentication to example.com
|
# Forward authentication to example.com
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -38,18 +38,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.address": "https://example.com/auth"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Forward authentication to example.com
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Forward authentication to example.com
|
# Forward authentication to example.com
|
||||||
http:
|
http:
|
||||||
@@ -84,13 +72,13 @@ The following request properties are provided to the forward-auth target endpoin
|
|||||||
|
|
||||||
The `address` option defines the authentication server address.
|
The `address` option defines the authentication server address.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -103,17 +91,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.address": "https://example.com/auth"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.address=https://example.com/auth"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -132,13 +109,13 @@ http:
|
|||||||
|
|
||||||
Set the `trustForwardHeader` option to `true` to trust all `X-Forwarded-*` headers.
|
Set the `trustForwardHeader` option to `true` to trust all `X-Forwarded-*` headers.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.trustForwardHeader=true"
|
- "traefik.http.middlewares.test-auth.forwardauth.trustForwardHeader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -152,17 +129,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.trustForwardHeader=true"
|
- "traefik.http.middlewares.test-auth.forwardauth.trustForwardHeader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.trustForwardHeader": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.trustForwardHeader=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -184,13 +150,13 @@ http:
|
|||||||
The `authResponseHeaders` option is the list of headers to copy from the authentication server response and set on
|
The `authResponseHeaders` option is the list of headers to copy from the authentication server response and set on
|
||||||
forwarded request, replacing any existing conflicting headers.
|
forwarded request, replacing any existing conflicting headers.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeaders=X-Auth-User, X-Secret"
|
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeaders=X-Auth-User, X-Secret"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -206,17 +172,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeaders=X-Auth-User, X-Secret"
|
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeaders=X-Auth-User, X-Secret"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.authResponseHeaders": "X-Auth-User,X-Secret"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeaders=X-Auth-User, X-Secret"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -242,13 +197,13 @@ set on forwarded request, after stripping all headers that match the regex.
|
|||||||
It allows partial matching of the regular expression against the header key.
|
It allows partial matching of the regular expression against the header key.
|
||||||
The start of string (`^`) and end of string (`$`) anchors should be used to ensure a full match against the header key.
|
The start of string (`^`) and end of string (`$`) anchors should be used to ensure a full match against the header key.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeadersRegex=^X-"
|
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeadersRegex=^X-"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -262,17 +217,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeadersRegex=^X-"
|
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeadersRegex=^X-"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.authResponseHeadersRegex": "^X-"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.authResponseHeadersRegex=^X-"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -301,13 +245,13 @@ The `authRequestHeaders` option is the list of the headers to copy from the requ
|
|||||||
It allows filtering headers that should not be passed to the authentication server.
|
It allows filtering headers that should not be passed to the authentication server.
|
||||||
If not set or empty then all request headers are passed.
|
If not set or empty then all request headers are passed.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.authRequestHeaders=Accept,X-CustomHeader"
|
- "traefik.http.middlewares.test-auth.forwardauth.authRequestHeaders=Accept,X-CustomHeader"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -323,17 +267,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.authRequestHeaders=Accept,X-CustomHeader"
|
- "traefik.http.middlewares.test-auth.forwardauth.authRequestHeaders=Accept,X-CustomHeader"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.authRequestHeaders": "Accept,X-CustomHeader"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.authRequestHeaders=Accept,X-CustomHeader"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -365,13 +298,13 @@ _Optional_
|
|||||||
`ca` is the path to the certificate authority used for the secured connection to the authentication server,
|
`ca` is the path to the certificate authority used for the secured connection to the authentication server,
|
||||||
it defaults to the system bundle.
|
it defaults to the system bundle.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.ca=path/to/local.crt"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.ca=path/to/local.crt"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -397,17 +330,6 @@ data:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.ca=path/to/local.crt"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.ca=path/to/local.crt"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.tls.ca": "path/to/local.crt"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.ca=path/to/local.crt"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -433,14 +355,14 @@ _Optional_
|
|||||||
`cert` is the path to the public certificate used for the secure connection to the authentication server.
|
`cert` is the path to the public certificate used for the secure connection to the authentication server.
|
||||||
When using this option, setting the `key` option is required.
|
When using this option, setting the `key` option is required.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.cert=path/to/foo.cert"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.cert=path/to/foo.cert"
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -467,19 +389,6 @@ data:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.tls.cert": "path/to/foo.cert",
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.tls.key": "path/to/foo.key"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.cert=path/to/foo.cert"
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -511,14 +420,14 @@ _Optional_
|
|||||||
`key` is the path to the private key used for the secure connection to the authentication server.
|
`key` is the path to the private key used for the secure connection to the authentication server.
|
||||||
When using this option, setting the `cert` option is required.
|
When using this option, setting the `cert` option is required.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.cert=path/to/foo.cert"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.cert=path/to/foo.cert"
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -545,19 +454,6 @@ data:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.tls.cert": "path/to/foo.cert",
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.tls.key": "path/to/foo.key"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.cert=path/to/foo.cert"
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.key=path/to/foo.key"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -588,13 +484,13 @@ _Optional, Default=false_
|
|||||||
|
|
||||||
If `insecureSkipVerify` is `true`, the TLS connection to the authentication server accepts any certificate presented by the server regardless of the hostnames it covers.
|
If `insecureSkipVerify` is `true`, the TLS connection to the authentication server accepts any certificate presented by the server regardless of the hostnames it covers.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.insecureSkipVerify=true"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.insecureSkipVerify=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-auth
|
name: test-auth
|
||||||
@@ -609,17 +505,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.InsecureSkipVerify=true"
|
- "traefik.http.middlewares.test-auth.forwardauth.tls.InsecureSkipVerify=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-auth.forwardauth.tls.insecureSkipVerify": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-auth.forwardauth.tls.InsecureSkipVerify=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
66
docs/content/middlewares/http/grpcweb.md
Normal file
66
docs/content/middlewares/http/grpcweb.md
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik GrpcWeb Documentation"
|
||||||
|
description: "In Traefik Proxy's HTTP middleware, GrpcWeb converts a gRPC Web requests to HTTP/2 gRPC requests. Read the technical documentation."
|
||||||
|
---
|
||||||
|
|
||||||
|
# GrpcWeb
|
||||||
|
|
||||||
|
Converting gRPC Web requests to HTTP/2 gRPC requests.
|
||||||
|
{: .subtitle }
|
||||||
|
|
||||||
|
The GrpcWeb middleware converts gRPC Web requests to HTTP/2 gRPC requests before forwarding them to the backends.
|
||||||
|
|
||||||
|
!!! tip
|
||||||
|
|
||||||
|
Please note, that Traefik needs to communicate using gRPC with the backends (h2c or HTTP/2 over TLS).
|
||||||
|
Check out the [gRPC](../../user-guides/grpc.md) user guide for more details.
|
||||||
|
|
||||||
|
## Configuration Examples
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-grpcweb.grpcweb.allowOrigins=*"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-grpcweb
|
||||||
|
spec:
|
||||||
|
grpcWeb:
|
||||||
|
allowOrigins:
|
||||||
|
- "*"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-grpcweb.grpcWeb.allowOrigins=*"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-grpcweb:
|
||||||
|
grpcWeb:
|
||||||
|
allowOrigins:
|
||||||
|
- "*"
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-grpcweb.grpcWeb]
|
||||||
|
allowOrigins = ["*"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration Options
|
||||||
|
|
||||||
|
### `allowOrigins`
|
||||||
|
|
||||||
|
The `allowOrigins` contains the list of allowed origins.
|
||||||
|
A wildcard origin `*` can also be configured to match all requests.
|
||||||
|
|
||||||
|
More information including how to use the settings can be found at:
|
||||||
|
|
||||||
|
- [Mozilla.org](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)
|
||||||
|
- [w3](https://fetch.spec.whatwg.org/#http-access-control-allow-origin)
|
||||||
|
- [IETF](https://tools.ietf.org/html/rfc6454#section-7.1)
|
@@ -20,14 +20,14 @@ A set of forwarded headers are automatically added by default. See the [FAQ](../
|
|||||||
|
|
||||||
The following example adds the `X-Script-Name` header to the proxied request and the `X-Custom-Response-Header` header to the response
|
The following example adds the `X-Script-Name` header to the proxied request and the `X-Custom-Response-Header` header to the response
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.testHeader.headers.customrequestheaders.X-Script-Name=test"
|
- "traefik.http.middlewares.testHeader.headers.customrequestheaders.X-Script-Name=test"
|
||||||
- "traefik.http.middlewares.testHeader.headers.customresponseheaders.X-Custom-Response-Header=value"
|
- "traefik.http.middlewares.testHeader.headers.customresponseheaders.X-Custom-Response-Header=value"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-header
|
name: test-header
|
||||||
@@ -44,19 +44,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header=value"
|
- "traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header=value"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.testheader.headers.customrequestheaders.X-Script-Name": "test",
|
|
||||||
"traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header": "value"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Script-Name=test"
|
|
||||||
- "traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header=value"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -82,7 +69,7 @@ http:
|
|||||||
In the following example, requests are proxied with an extra `X-Script-Name` header while their `X-Custom-Request-Header` header gets stripped,
|
In the following example, requests are proxied with an extra `X-Script-Name` header while their `X-Custom-Request-Header` header gets stripped,
|
||||||
and responses are stripped of their `X-Custom-Response-Header` header.
|
and responses are stripped of their `X-Custom-Response-Header` header.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Script-Name=test"
|
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Script-Name=test"
|
||||||
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Custom-Request-Header="
|
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Custom-Request-Header="
|
||||||
@@ -90,7 +77,7 @@ labels:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-header
|
name: test-header
|
||||||
@@ -109,21 +96,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header="
|
- "traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header="
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.testheader.headers.customrequestheaders.X-Script-Name": "test",
|
|
||||||
"traefik.http.middlewares.testheader.headers.customrequestheaders.X-Custom-Request-Header": "",
|
|
||||||
"traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header": "",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Script-Name=test"
|
|
||||||
- "traefik.http.middlewares.testheader.headers.customrequestheaders.X-Custom-Request-Header="
|
|
||||||
- "traefik.http.middlewares.testheader.headers.customresponseheaders.X-Custom-Response-Header="
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -151,14 +123,14 @@ http:
|
|||||||
Security-related headers (HSTS headers, Browser XSS filter, etc) can be managed similarly to custom headers as shown above.
|
Security-related headers (HSTS headers, Browser XSS filter, etc) can be managed similarly to custom headers as shown above.
|
||||||
This functionality makes it possible to easily use security features by adding headers.
|
This functionality makes it possible to easily use security features by adding headers.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.testHeader.headers.framedeny=true"
|
- "traefik.http.middlewares.testHeader.headers.framedeny=true"
|
||||||
- "traefik.http.middlewares.testHeader.headers.browserxssfilter=true"
|
- "traefik.http.middlewares.testHeader.headers.browserxssfilter=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-header
|
name: test-header
|
||||||
@@ -173,19 +145,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.testheader.headers.browserxssfilter=true"
|
- "traefik.http.middlewares.testheader.headers.browserxssfilter=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.testheader.headers.framedeny": "true",
|
|
||||||
"traefik.http.middlewares.testheader.headers.browserxssfilter": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.testheader.headers.framedeny=true"
|
|
||||||
- "traefik.http.middlewares.testheader.headers.browserxssfilter=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -208,17 +167,20 @@ CORS (Cross-Origin Resource Sharing) headers can be added and configured in a ma
|
|||||||
This functionality allows for more advanced security features to quickly be set.
|
This functionality allows for more advanced security features to quickly be set.
|
||||||
If CORS headers are set, then the middleware does not pass preflight requests to any service,
|
If CORS headers are set, then the middleware does not pass preflight requests to any service,
|
||||||
instead the response will be generated and sent back to the client directly.
|
instead the response will be generated and sent back to the client directly.
|
||||||
|
Please note that the example below is by no means authoritative or exhaustive,
|
||||||
|
and should not be used as is for production.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
|
- "traefik.http.middlewares.testheader.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
|
||||||
|
- "traefik.http.middlewares.testheader.headers.accesscontrolallowheaders=*"
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolalloworiginlist=https://foo.bar.org,https://example.org"
|
- "traefik.http.middlewares.testheader.headers.accesscontrolalloworiginlist=https://foo.bar.org,https://example.org"
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolmaxage=100"
|
- "traefik.http.middlewares.testheader.headers.accesscontrolmaxage=100"
|
||||||
- "traefik.http.middlewares.testheader.headers.addvaryheader=true"
|
- "traefik.http.middlewares.testheader.headers.addvaryheader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-header
|
name: test-header
|
||||||
@@ -228,6 +190,7 @@ spec:
|
|||||||
- "GET"
|
- "GET"
|
||||||
- "OPTIONS"
|
- "OPTIONS"
|
||||||
- "PUT"
|
- "PUT"
|
||||||
|
accessControlAllowHeaders: "*"
|
||||||
accessControlAllowOriginList:
|
accessControlAllowOriginList:
|
||||||
- "https://foo.bar.org"
|
- "https://foo.bar.org"
|
||||||
- "https://example.org"
|
- "https://example.org"
|
||||||
@@ -237,28 +200,12 @@ spec:
|
|||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
|
- "traefik.http.middlewares.testheader.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
|
||||||
|
- "traefik.http.middlewares.testheader.headers.accesscontrolallowheaders=*"
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolalloworiginlist=https://foo.bar.org,https://example.org"
|
- "traefik.http.middlewares.testheader.headers.accesscontrolalloworiginlist=https://foo.bar.org,https://example.org"
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolmaxage=100"
|
- "traefik.http.middlewares.testheader.headers.accesscontrolmaxage=100"
|
||||||
- "traefik.http.middlewares.testheader.headers.addvaryheader=true"
|
- "traefik.http.middlewares.testheader.headers.addvaryheader=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.testheader.headers.accesscontrolallowmethods": "GET,OPTIONS,PUT",
|
|
||||||
"traefik.http.middlewares.testheader.headers.accesscontrolalloworiginlist": "https://foo.bar.org,https://example.org",
|
|
||||||
"traefik.http.middlewares.testheader.headers.accesscontrolmaxage": "100",
|
|
||||||
"traefik.http.middlewares.testheader.headers.addvaryheader": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
|
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolalloworiginlist=https://foo.bar.org,https://example.org"
|
|
||||||
- "traefik.http.middlewares.testheader.headers.accesscontrolmaxage=100"
|
|
||||||
- "traefik.http.middlewares.testheader.headers.addvaryheader=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -268,6 +215,7 @@ http:
|
|||||||
- GET
|
- GET
|
||||||
- OPTIONS
|
- OPTIONS
|
||||||
- PUT
|
- PUT
|
||||||
|
accessControlAllowHeaders: "*"
|
||||||
accessControlAllowOriginList:
|
accessControlAllowOriginList:
|
||||||
- https://foo.bar.org
|
- https://foo.bar.org
|
||||||
- https://example.org
|
- https://example.org
|
||||||
@@ -279,6 +227,7 @@ http:
|
|||||||
[http.middlewares]
|
[http.middlewares]
|
||||||
[http.middlewares.testHeader.headers]
|
[http.middlewares.testHeader.headers]
|
||||||
accessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
|
accessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
|
||||||
|
accessControlAllowHeaders= "*"
|
||||||
accessControlAllowOriginList = ["https://foo.bar.org","https://example.org"]
|
accessControlAllowOriginList = ["https://foo.bar.org","https://example.org"]
|
||||||
accessControlMaxAge = 100
|
accessControlMaxAge = 100
|
||||||
addVaryHeader = true
|
addVaryHeader = true
|
||||||
@@ -364,43 +313,11 @@ The `allowedHosts` option lists fully qualified domain names that are allowed.
|
|||||||
|
|
||||||
The `hostsProxyHeaders` option is a set of header keys that may hold a proxied hostname value for the request.
|
The `hostsProxyHeaders` option is a set of header keys that may hold a proxied hostname value for the request.
|
||||||
|
|
||||||
### `sslRedirect`
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
Deprecated in favor of [EntryPoint redirection](../../routing/entrypoints.md#redirection) or the [RedirectScheme middleware](./redirectscheme.md).
|
|
||||||
|
|
||||||
The `sslRedirect` only allow HTTPS requests when set to `true`.
|
|
||||||
|
|
||||||
### `sslTemporaryRedirect`
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
Deprecated in favor of [EntryPoint redirection](../../routing/entrypoints.md#redirection) or the [RedirectScheme middleware](./redirectscheme.md).
|
|
||||||
|
|
||||||
Set `sslTemporaryRedirect` to `true` to force an SSL redirection using a 302 (instead of a 301).
|
|
||||||
|
|
||||||
### `sslHost`
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
Deprecated in favor of the [RedirectRegex middleware](./redirectregex.md).
|
|
||||||
|
|
||||||
The `sslHost` option is the host name that is used to redirect HTTP requests to HTTPS.
|
|
||||||
|
|
||||||
### `sslProxyHeaders`
|
### `sslProxyHeaders`
|
||||||
|
|
||||||
The `sslProxyHeaders` option is set of header keys with associated values that would indicate a valid HTTPS request.
|
The `sslProxyHeaders` option is set of header keys with associated values that would indicate a valid HTTPS request.
|
||||||
It can be useful when using other proxies (example: `"X-Forwarded-Proto": "https"`).
|
It can be useful when using other proxies (example: `"X-Forwarded-Proto": "https"`).
|
||||||
|
|
||||||
### `sslForceHost`
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
Deprecated in favor of the [RedirectRegex middleware](./redirectregex.md).
|
|
||||||
|
|
||||||
Set `sslForceHost` to `true` and set `sslHost` to force requests to use `SSLHost` regardless of whether they already use SSL.
|
|
||||||
|
|
||||||
### `stsSeconds`
|
### `stsSeconds`
|
||||||
|
|
||||||
The `stsSeconds` is the max-age of the `Strict-Transport-Security` header.
|
The `stsSeconds` is the max-age of the `Strict-Transport-Security` header.
|
||||||
@@ -452,14 +369,6 @@ The `publicKey` implements HPKP to prevent MITM attacks with forged certificates
|
|||||||
|
|
||||||
The `referrerPolicy` allows sites to control whether browsers forward the `Referer` header to other sites.
|
The `referrerPolicy` allows sites to control whether browsers forward the `Referer` header to other sites.
|
||||||
|
|
||||||
### `featurePolicy`
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
Deprecated in favor of `permissionsPolicy`
|
|
||||||
|
|
||||||
The `featurePolicy` allows sites to control browser features.
|
|
||||||
|
|
||||||
### `permissionsPolicy`
|
### `permissionsPolicy`
|
||||||
|
|
||||||
The `permissionsPolicy` allows sites to control browser features.
|
The `permissionsPolicy` allows sites to control browser features.
|
||||||
|
@@ -14,13 +14,13 @@ To proactively prevent services from being overwhelmed with high load, the numbe
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-inflightreq
|
name: test-inflightreq
|
||||||
@@ -34,18 +34,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-inflightreq.inflightreq.amount": "10"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Limiting to 10 simultaneous connections
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Limiting to 10 simultaneous connections
|
# Limiting to 10 simultaneous connections
|
||||||
http:
|
http:
|
||||||
@@ -69,13 +57,13 @@ http:
|
|||||||
The `amount` option defines the maximum amount of allowed simultaneous in-flight request.
|
The `amount` option defines the maximum amount of allowed simultaneous in-flight request.
|
||||||
The middleware responds with `HTTP 429 Too Many Requests` if there are already `amount` requests in progress (based on the same `sourceCriterion` strategy).
|
The middleware responds with `HTTP 429 Too Many Requests` if there are already `amount` requests in progress (based on the same `sourceCriterion` strategy).
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-inflightreq
|
name: test-inflightreq
|
||||||
@@ -89,18 +77,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-inflightreq.inflightreq.amount": "10"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Limiting to 10 simultaneous connections
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.amount=10"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Limiting to 10 simultaneous connections
|
# Limiting to 10 simultaneous connections
|
||||||
http:
|
http:
|
||||||
@@ -127,6 +103,8 @@ If none are set, the default is to use the `requestHost`.
|
|||||||
|
|
||||||
The `ipStrategy` option defines two parameters that configures how Traefik determines the client IP: `depth`, and `excludedIPs`.
|
The `ipStrategy` option defines two parameters that configures how Traefik determines the client IP: `depth`, and `excludedIPs`.
|
||||||
|
|
||||||
|
!!! important "As a middleware, InFlightReq happens before the actual proxying to the backend takes place. In addition, the previous network hop only gets appended to `X-Forwarded-For` during the last stages of proxying, i.e. after it has already passed through the middleware. Therefore, during InFlightReq, as the previous network hop is not yet present in `X-Forwarded-For`, it cannot be used and/or relied upon."
|
||||||
|
|
||||||
##### `ipStrategy.depth`
|
##### `ipStrategy.depth`
|
||||||
|
|
||||||
The `depth` option tells Traefik to use the `X-Forwarded-For` header and select the IP located at the `depth` position (starting from the right).
|
The `depth` option tells Traefik to use the `X-Forwarded-For` header and select the IP located at the `depth` position (starting from the right).
|
||||||
@@ -144,13 +122,13 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and select
|
|||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `3` | `"11.0.0.1"` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `3` | `"11.0.0.1"` |
|
||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `5` | `""` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `5` | `""` |
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.depth=2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-inflightreq
|
name: test-inflightreq
|
||||||
@@ -165,17 +143,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.depth=2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.depth": "2"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.depth=2"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -209,13 +176,13 @@ http:
|
|||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"15.0.0.1,16.0.0.1"` | `"13.0.0.1"` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"15.0.0.1,16.0.0.1"` | `"13.0.0.1"` |
|
||||||
| `"10.0.0.1,11.0.0.1"` | `"10.0.0.1,11.0.0.1"` | `""` |
|
| `"10.0.0.1,11.0.0.1"` | `"10.0.0.1,11.0.0.1"` | `""` |
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-inflightreq
|
name: test-inflightreq
|
||||||
@@ -232,17 +199,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.excludedips": "127.0.0.1/32, 192.168.1.7"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -266,13 +222,13 @@ http:
|
|||||||
|
|
||||||
Name of the header used to group incoming requests.
|
Name of the header used to group incoming requests.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requestheadername=username"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requestheadername=username"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-inflightreq
|
name: test-inflightreq
|
||||||
@@ -286,17 +242,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requestheadername=username"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requestheadername=username"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requestheadername": "username"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requestheadername=username"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -317,13 +262,13 @@ http:
|
|||||||
|
|
||||||
Whether to consider the request host as the source.
|
Whether to consider the request host as the source.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requesthost=true"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requesthost=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-inflightreq
|
name: test-inflightreq
|
||||||
@@ -337,17 +282,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requesthost=true"
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requesthost=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requesthost": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.requesthost=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@@ -1,32 +1,30 @@
|
|||||||
---
|
---
|
||||||
title: "Traefik HTTP Middlewares IPWhiteList"
|
title: "Traefik HTTP Middlewares IPAllowList"
|
||||||
description: "Learn how to use IPWhiteList in HTTP middleware for limiting clients to specific IPs in Traefik Proxy. Read the technical documentation."
|
description: "Learn how to use IPAllowList in HTTP middleware for limiting clients to specific IPs in Traefik Proxy. Read the technical documentation."
|
||||||
---
|
---
|
||||||
|
|
||||||
# IPWhiteList
|
# IPAllowList
|
||||||
|
|
||||||
Limiting Clients to Specific IPs
|
Limiting Clients to Specific IPs
|
||||||
{: .subtitle }
|
{: .subtitle }
|
||||||
|
|
||||||

|
IPAllowList accepts / refuses requests based on the client IP.
|
||||||
|
|
||||||
IPWhitelist accepts / refuses requests based on the client IP.
|
|
||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Accepts request from defined IP
|
# Accepts request from defined IP
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ipwhitelist
|
name: test-ipallowlist
|
||||||
spec:
|
spec:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- 127.0.0.1/32
|
- 127.0.0.1/32
|
||||||
- 192.168.1.7
|
- 192.168.1.7
|
||||||
@@ -34,27 +32,15 @@ spec:
|
|||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Accepts request from defined IP
|
# Accepts request from defined IP
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange": "127.0.0.1/32,192.168.1.7"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Accepts request from defined IP
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Accepts request from defined IP
|
# Accepts request from defined IP
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
test-ipwhitelist:
|
test-ipallowlist:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- "127.0.0.1/32"
|
- "127.0.0.1/32"
|
||||||
- "192.168.1.7"
|
- "192.168.1.7"
|
||||||
@@ -63,7 +49,7 @@ http:
|
|||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# Accepts request from defined IP
|
# Accepts request from defined IP
|
||||||
[http.middlewares]
|
[http.middlewares]
|
||||||
[http.middlewares.test-ipwhitelist.ipWhiteList]
|
[http.middlewares.test-ipallowlist.ipAllowList]
|
||||||
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -76,6 +62,9 @@ The `sourceRange` option sets the allowed IPs (or ranges of allowed IPs by using
|
|||||||
### `ipStrategy`
|
### `ipStrategy`
|
||||||
|
|
||||||
The `ipStrategy` option defines two parameters that set how Traefik determines the client IP: `depth`, and `excludedIPs`.
|
The `ipStrategy` option defines two parameters that set how Traefik determines the client IP: `depth`, and `excludedIPs`.
|
||||||
|
If no strategy is set, the default behavior is to match `sourceRange` against the Remote address found in the request.
|
||||||
|
|
||||||
|
!!! important "As a middleware, whitelisting happens before the actual proxying to the backend takes place. In addition, the previous network hop only gets appended to `X-Forwarded-For` during the last stages of proxying, i.e. after it has already passed through whitelisting. Therefore, during whitelisting, as the previous network hop is not yet present in `X-Forwarded-For`, it cannot be matched against `sourceRange`."
|
||||||
|
|
||||||
#### `ipStrategy.depth`
|
#### `ipStrategy.depth`
|
||||||
|
|
||||||
@@ -86,7 +75,7 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and take th
|
|||||||
|
|
||||||
!!! example "Examples of Depth & X-Forwarded-For"
|
!!! example "Examples of Depth & X-Forwarded-For"
|
||||||
|
|
||||||
If `depth` is set to 2, and the request `X-Forwarded-For` header is `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` then the "real" client IP is `"10.0.0.1"` (at depth 4) but the IP used for the whitelisting is `"12.0.0.1"` (`depth=2`).
|
If `depth` is set to 2, and the request `X-Forwarded-For` header is `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` then the "real" client IP is `"10.0.0.1"` (at depth 4) but the IP used is `"12.0.0.1"` (`depth=2`).
|
||||||
|
|
||||||
| `X-Forwarded-For` | `depth` | clientIP |
|
| `X-Forwarded-For` | `depth` | clientIP |
|
||||||
|-----------------------------------------|---------|--------------|
|
|-----------------------------------------|---------|--------------|
|
||||||
@@ -94,21 +83,21 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and take th
|
|||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `3` | `"11.0.0.1"` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `3` | `"11.0.0.1"` |
|
||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `5` | `""` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `5` | `""` |
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
# Allowlisting Based on `X-Forwarded-For` with `depth=2`
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.depth=2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
# Allowlisting Based on `X-Forwarded-For` with `depth=2`
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ipwhitelist
|
name: test-ipallowlist
|
||||||
spec:
|
spec:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- 127.0.0.1/32
|
- 127.0.0.1/32
|
||||||
- 192.168.1.7
|
- 192.168.1.7
|
||||||
@@ -117,31 +106,17 @@ spec:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
# Allowlisting Based on `X-Forwarded-For` with `depth=2`
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.depth=2"
|
||||||
```
|
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange": "127.0.0.1/32, 192.168.1.7",
|
|
||||||
"traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.depth": "2"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.depth=2"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
# Allowlisting Based on `X-Forwarded-For` with `depth=2`
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
test-ipwhitelist:
|
test-ipallowlist:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- "127.0.0.1/32"
|
- "127.0.0.1/32"
|
||||||
- "192.168.1.7"
|
- "192.168.1.7"
|
||||||
@@ -150,11 +125,11 @@ http:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
# Allowlisting Based on `X-Forwarded-For` with `depth=2`
|
||||||
[http.middlewares]
|
[http.middlewares]
|
||||||
[http.middlewares.test-ipwhitelist.ipWhiteList]
|
[http.middlewares.test-ipallowlist.ipAllowList]
|
||||||
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
||||||
[http.middlewares.test-ipwhitelist.ipWhiteList.ipStrategy]
|
[http.middlewares.test-ipallowlist.ipAllowList.ipStrategy]
|
||||||
depth = 2
|
depth = 2
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -174,20 +149,20 @@ http:
|
|||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"15.0.0.1,16.0.0.1"` | `"13.0.0.1"` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `"15.0.0.1,16.0.0.1"` | `"13.0.0.1"` |
|
||||||
| `"10.0.0.1,11.0.0.1"` | `"10.0.0.1,11.0.0.1"` | `""` |
|
| `"10.0.0.1,11.0.0.1"` | `"10.0.0.1,11.0.0.1"` | `""` |
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Exclude from `X-Forwarded-For`
|
# Exclude from `X-Forwarded-For`
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Exclude from `X-Forwarded-For`
|
# Exclude from `X-Forwarded-For`
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ipwhitelist
|
name: test-ipallowlist
|
||||||
spec:
|
spec:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
ipStrategy:
|
ipStrategy:
|
||||||
excludedIPs:
|
excludedIPs:
|
||||||
- 127.0.0.1/32
|
- 127.0.0.1/32
|
||||||
@@ -196,27 +171,15 @@ spec:
|
|||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Exclude from `X-Forwarded-For`
|
# Exclude from `X-Forwarded-For`
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips": "127.0.0.1/32, 192.168.1.7"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Exclude from `X-Forwarded-For`
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Exclude from `X-Forwarded-For`
|
# Exclude from `X-Forwarded-For`
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
test-ipwhitelist:
|
test-ipallowlist:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
ipStrategy:
|
ipStrategy:
|
||||||
excludedIPs:
|
excludedIPs:
|
||||||
- "127.0.0.1/32"
|
- "127.0.0.1/32"
|
||||||
@@ -226,7 +189,7 @@ http:
|
|||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# Exclude from `X-Forwarded-For`
|
# Exclude from `X-Forwarded-For`
|
||||||
[http.middlewares]
|
[http.middlewares]
|
||||||
[http.middlewares.test-ipwhitelist.ipWhiteList]
|
[http.middlewares.test-ipallowlist.ipAllowList]
|
||||||
[http.middlewares.test-ipwhitelist.ipWhiteList.ipStrategy]
|
[http.middlewares.test-ipallowlist.ipAllowList.ipStrategy]
|
||||||
excludedIPs = ["127.0.0.1/32", "192.168.1.7"]
|
excludedIPs = ["127.0.0.1/32", "192.168.1.7"]
|
||||||
```
|
```
|
@@ -12,7 +12,7 @@ Controlling connections
|
|||||||
|
|
||||||
## Configuration Example
|
## Configuration Example
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# As a Docker Label
|
# As a Docker Label
|
||||||
whoami:
|
whoami:
|
||||||
# A container that exposes an API to show its IP address
|
# A container that exposes an API to show its IP address
|
||||||
@@ -26,21 +26,8 @@ whoami:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes IngressRoute"
|
```yaml tab="Kubernetes IngressRoute"
|
||||||
# As a Kubernetes Traefik IngressRoute
|
# As a Kubernetes Traefik IngressRoute
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
|
||||||
kind: CustomResourceDefinition
|
|
||||||
metadata:
|
|
||||||
name: middlewares.traefik.containo.us
|
|
||||||
spec:
|
|
||||||
group: traefik.containo.us
|
|
||||||
version: v1alpha1
|
|
||||||
names:
|
|
||||||
kind: Middleware
|
|
||||||
plural: middlewares
|
|
||||||
singular: middleware
|
|
||||||
scope: Namespaced
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: stripprefix
|
name: stripprefix
|
||||||
@@ -50,7 +37,7 @@ spec:
|
|||||||
- /stripit
|
- /stripit
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: ingressroute
|
name: ingressroute
|
||||||
@@ -69,22 +56,6 @@ spec:
|
|||||||
- "traefik.http.routers.router1.middlewares=foo-add-prefix@consulcatalog"
|
- "traefik.http.routers.router1.middlewares=foo-add-prefix@consulcatalog"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.foo-add-prefix.addprefix.prefix": "/foo",
|
|
||||||
"traefik.http.routers.router1.middlewares": "foo-add-prefix@marathon"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# As a Rancher Label
|
|
||||||
labels:
|
|
||||||
# Create a middleware named `foo-add-prefix`
|
|
||||||
- "traefik.http.middlewares.foo-add-prefix.addprefix.prefix=/foo"
|
|
||||||
# Apply the middleware named `foo-add-prefix` to the router named `router1`
|
|
||||||
- "traefik.http.routers.router1.middlewares=foo-add-prefix@rancher"
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# As TOML Configuration File
|
# As TOML Configuration File
|
||||||
[http.routers]
|
[http.routers]
|
||||||
@@ -142,7 +113,7 @@ http:
|
|||||||
| [Errors](errorpages.md) | Defines custom error pages | Request Lifecycle |
|
| [Errors](errorpages.md) | Defines custom error pages | Request Lifecycle |
|
||||||
| [ForwardAuth](forwardauth.md) | Delegates Authentication | Security, Authentication |
|
| [ForwardAuth](forwardauth.md) | Delegates Authentication | Security, Authentication |
|
||||||
| [Headers](headers.md) | Adds / Updates headers | Security |
|
| [Headers](headers.md) | Adds / Updates headers | Security |
|
||||||
| [IPWhiteList](ipwhitelist.md) | Limits the allowed client IPs | Security, Request lifecycle |
|
| [IPAllowList](ipallowlist.md) | Limits the allowed client IPs | Security, Request lifecycle |
|
||||||
| [InFlightReq](inflightreq.md) | Limits the number of simultaneous connections | Security, Request lifecycle |
|
| [InFlightReq](inflightreq.md) | Limits the number of simultaneous connections | Security, Request lifecycle |
|
||||||
| [PassTLSClientCert](passtlsclientcert.md) | Adds Client Certificates in a Header | Security |
|
| [PassTLSClientCert](passtlsclientcert.md) | Adds Client Certificates in a Header | Security |
|
||||||
| [RateLimit](ratelimit.md) | Limits the call frequency | Security, Request lifecycle |
|
| [RateLimit](ratelimit.md) | Limits the call frequency | Security, Request lifecycle |
|
||||||
|
@@ -18,14 +18,14 @@ PassTLSClientCert adds the selected data from the passed client TLS certificate
|
|||||||
|
|
||||||
Pass the pem in the `X-Forwarded-Tls-Client-Cert` header.
|
Pass the pem in the `X-Forwarded-Tls-Client-Cert` header.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Pass the pem in the `X-Forwarded-Tls-Client-Cert` header.
|
# Pass the pem in the `X-Forwarded-Tls-Client-Cert` header.
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.pem=true"
|
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.pem=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-passtlsclientcert
|
name: test-passtlsclientcert
|
||||||
@@ -39,18 +39,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.pem=true"
|
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.pem=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.pem": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Pass the pem in the `X-Forwarded-Tls-Client-Cert` header.
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.pem=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Pass the pem in the `X-Forwarded-Tls-Client-Cert` header.
|
# Pass the pem in the `X-Forwarded-Tls-Client-Cert` header.
|
||||||
http:
|
http:
|
||||||
@@ -69,7 +57,7 @@ http:
|
|||||||
|
|
||||||
??? example "Pass the pem in the `X-Forwarded-Tls-Client-Cert` header"
|
??? example "Pass the pem in the `X-Forwarded-Tls-Client-Cert` header"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
|
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notafter=true"
|
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notafter=true"
|
||||||
@@ -95,7 +83,7 @@ http:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
|
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-passtlsclientcert
|
name: test-passtlsclientcert
|
||||||
@@ -146,52 +134,6 @@ http:
|
|||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.serialnumber=true"
|
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.serialnumber=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notafter": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notbefore": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.sans": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.commonname": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.country": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.domaincomponent": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.locality": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.organization": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.organizationalunit": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.province": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.serialnumber": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.commonname": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.country": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.domaincomponent": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.locality": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.organization": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.province": "true",
|
|
||||||
"traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.serialnumber": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notafter=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.notbefore=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.sans=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.commonname=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.country=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.domaincomponent=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.locality=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.organization=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.organizationalunit=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.province=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.subject.serialnumber=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.commonname=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.country=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.domaincomponent=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.locality=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.organization=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.province=true"
|
|
||||||
- "traefik.http.middlewares.test-passtlsclientcert.passtlsclientcert.info.issuer.serialnumber=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
|
# Pass all the available info in the `X-Forwarded-Tls-Client-Cert-Info` header
|
||||||
http:
|
http:
|
||||||
|
@@ -10,9 +10,11 @@ To Control the Number of Requests Going to a Service
|
|||||||
|
|
||||||
The RateLimit middleware ensures that services will receive a _fair_ amount of requests, and allows one to define what fair is.
|
The RateLimit middleware ensures that services will receive a _fair_ amount of requests, and allows one to define what fair is.
|
||||||
|
|
||||||
|
It is based on a [token bucket](https://en.wikipedia.org/wiki/Token_bucket) implementation. In this analogy, the [average](#average) parameter (defined below) is the rate at which the bucket refills, and the [burst](#burst) is the size (volume) of the bucket.
|
||||||
|
|
||||||
## Configuration Example
|
## Configuration Example
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 50 requests is allowed.
|
||||||
labels:
|
labels:
|
||||||
@@ -23,7 +25,7 @@ labels:
|
|||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 50 requests is allowed.
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -40,21 +42,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=50"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=50"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.average": "100",
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.burst": "50"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Here, an average of 100 requests per second is allowed.
|
|
||||||
# In addition, a burst of 50 requests is allowed.
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=50"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 50 requests is allowed.
|
||||||
@@ -86,7 +73,7 @@ It defaults to `0`, which means no rate limiting.
|
|||||||
The rate is actually defined by dividing `average` by `period`.
|
The rate is actually defined by dividing `average` by `period`.
|
||||||
So for a rate below 1 req/s, one needs to define a `period` larger than a second.
|
So for a rate below 1 req/s, one needs to define a `period` larger than a second.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# 100 reqs/s
|
# 100 reqs/s
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
||||||
@@ -94,7 +81,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# 100 reqs/s
|
# 100 reqs/s
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -108,17 +95,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.average": "100",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# 100 reqs/s
|
# 100 reqs/s
|
||||||
http:
|
http:
|
||||||
@@ -145,7 +121,7 @@ r = average / period
|
|||||||
|
|
||||||
It defaults to `1` second.
|
It defaults to `1` second.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# 6 reqs/minute
|
# 6 reqs/minute
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=6"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=6"
|
||||||
@@ -154,7 +130,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# 6 reqs/minute
|
# 6 reqs/minute
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -170,20 +146,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.period=1m"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.period=1m"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.average": "6",
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.period": "1m",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# 6 reqs/minute
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=6"
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.period=1m"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# 6 reqs/minute
|
# 6 reqs/minute
|
||||||
http:
|
http:
|
||||||
@@ -208,13 +170,13 @@ http:
|
|||||||
|
|
||||||
It defaults to `1`.
|
It defaults to `1`.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=100"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=100"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -227,17 +189,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=100"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=100"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.burst": "100",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=100"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -262,6 +213,8 @@ If none are set, the default is to use the request's remote address field (as an
|
|||||||
|
|
||||||
The `ipStrategy` option defines two parameters that configures how Traefik determines the client IP: `depth`, and `excludedIPs`.
|
The `ipStrategy` option defines two parameters that configures how Traefik determines the client IP: `depth`, and `excludedIPs`.
|
||||||
|
|
||||||
|
!!! important "As a middleware, rate-limiting happens before the actual proxying to the backend takes place. In addition, the previous network hop only gets appended to `X-Forwarded-For` during the last stages of proxying, i.e. after it has already passed through rate-limiting. Therefore, during rate-limiting, as the previous network hop is not yet present in `X-Forwarded-For`, it cannot be found and/or relied upon."
|
||||||
|
|
||||||
##### `ipStrategy.depth`
|
##### `ipStrategy.depth`
|
||||||
|
|
||||||
The `depth` option tells Traefik to use the `X-Forwarded-For` header and select the IP located at the `depth` position (starting from the right).
|
The `depth` option tells Traefik to use the `X-Forwarded-For` header and select the IP located at the `depth` position (starting from the right).
|
||||||
@@ -279,13 +232,13 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and select
|
|||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `3` | `"11.0.0.1"` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `3` | `"11.0.0.1"` |
|
||||||
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `5` | `""` |
|
| `"10.0.0.1,11.0.0.1,12.0.0.1,13.0.0.1"` | `5` | `""` |
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -300,17 +253,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.depth": "2"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=2"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -371,13 +313,13 @@ and the first IP that is _not_ in the pool (if any) is returned.
|
|||||||
| `"10.0.0.1,11.0.0.1,13.0.0.1"` | `"15.0.0.1,16.0.0.1"` | `"13.0.0.1"` |
|
| `"10.0.0.1,11.0.0.1,13.0.0.1"` | `"15.0.0.1,16.0.0.1"` | `"13.0.0.1"` |
|
||||||
| `"10.0.0.1,11.0.0.1"` | `"10.0.0.1,11.0.0.1"` | `""` |
|
| `"10.0.0.1,11.0.0.1"` | `"10.0.0.1,11.0.0.1"` | `""` |
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -394,17 +336,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.excludedips": "127.0.0.1/32, 192.168.1.7"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -428,13 +359,13 @@ http:
|
|||||||
|
|
||||||
Name of the header used to group incoming requests.
|
Name of the header used to group incoming requests.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requestheadername=username"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requestheadername=username"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -448,17 +379,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requestheadername=username"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requestheadername=username"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requestheadername": "username"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requestheadername=username"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
@@ -479,13 +399,13 @@ http:
|
|||||||
|
|
||||||
Whether to consider the request host as the source.
|
Whether to consider the request host as the source.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requesthost=true"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requesthost=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ratelimit
|
name: test-ratelimit
|
||||||
@@ -499,17 +419,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requesthost=true"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requesthost=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requesthost": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.sourcecriterion.requesthost=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@@ -16,7 +16,7 @@ The RedirectRegex redirects a request using regex matching and replacement.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Redirect with domain replacement
|
# Redirect with domain replacement
|
||||||
# Note: all dollar signs need to be doubled for escaping.
|
# Note: all dollar signs need to be doubled for escaping.
|
||||||
labels:
|
labels:
|
||||||
@@ -26,7 +26,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Redirect with domain replacement
|
# Redirect with domain replacement
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-redirectregex
|
name: test-redirectregex
|
||||||
@@ -43,21 +43,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-redirectregex.redirectregex.replacement=http://mydomain/$${1}"
|
- "traefik.http.middlewares.test-redirectregex.redirectregex.replacement=http://mydomain/$${1}"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-redirectregex.redirectregex.regex": "^http://localhost/(.*)",
|
|
||||||
"traefik.http.middlewares.test-redirectregex.redirectregex.replacement": "http://mydomain/${1}"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Redirect with domain replacement
|
|
||||||
# Note: all dollar signs need to be doubled for escaping.
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-redirectregex.redirectregex.regex=^http://localhost/(.*)"
|
|
||||||
- "traefik.http.middlewares.test-redirectregex.redirectregex.replacement=http://mydomain/$${1}"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Redirect with domain replacement
|
# Redirect with domain replacement
|
||||||
http:
|
http:
|
||||||
|
@@ -25,7 +25,7 @@ The RedirectScheme middleware redirects the request if the request scheme is dif
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
||||||
@@ -34,7 +34,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-redirectscheme
|
name: test-redirectscheme
|
||||||
@@ -51,20 +51,6 @@ labels:
|
|||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent=true"
|
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme": "https"
|
|
||||||
"traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Redirect to https
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
|
||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
http:
|
http:
|
||||||
@@ -89,7 +75,7 @@ http:
|
|||||||
|
|
||||||
Set the `permanent` option to `true` to apply a permanent redirection.
|
Set the `permanent` option to `true` to apply a permanent redirection.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
labels:
|
labels:
|
||||||
# ...
|
# ...
|
||||||
@@ -98,7 +84,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-redirectscheme
|
name: test-redirectscheme
|
||||||
@@ -115,20 +101,6 @@ labels:
|
|||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent=true"
|
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent=true"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
|
|
||||||
"traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent": "true"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Redirect to https
|
|
||||||
labels:
|
|
||||||
# ...
|
|
||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.permanent=true"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
http:
|
http:
|
||||||
@@ -151,7 +123,7 @@ http:
|
|||||||
|
|
||||||
The `scheme` option defines the scheme of the new URL.
|
The `scheme` option defines the scheme of the new URL.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
||||||
@@ -159,7 +131,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-redirectscheme
|
name: test-redirectscheme
|
||||||
@@ -174,18 +146,6 @@ labels:
|
|||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme": "https"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Redirect to https
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.scheme=https"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
http:
|
http:
|
||||||
@@ -206,7 +166,7 @@ http:
|
|||||||
|
|
||||||
The `port` option defines the port of the new URL.
|
The `port` option defines the port of the new URL.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
labels:
|
labels:
|
||||||
# ...
|
# ...
|
||||||
@@ -215,7 +175,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-redirectscheme
|
name: test-redirectscheme
|
||||||
@@ -232,20 +192,6 @@ labels:
|
|||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.port=443"
|
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.port=443"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
|
|
||||||
"traefik.http.middlewares.test-redirectscheme.redirectscheme.port": "443"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Redirect to https
|
|
||||||
labels:
|
|
||||||
# ...
|
|
||||||
- "traefik.http.middlewares.test-redirectscheme.redirectscheme.port=443"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Redirect to https
|
# Redirect to https
|
||||||
http:
|
http:
|
||||||
|
@@ -16,7 +16,7 @@ Replace the path of the request URL.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Replace the path with /foo
|
# Replace the path with /foo
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
|
- "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
|
||||||
@@ -24,7 +24,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Replace the path with /foo
|
# Replace the path with /foo
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-replacepath
|
name: test-replacepath
|
||||||
@@ -38,18 +38,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
|
- "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-replacepath.replacepath.path": "/foo"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Replace the path with /foo
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Replace the path with /foo
|
# Replace the path with /foo
|
||||||
http:
|
http:
|
||||||
|
@@ -16,7 +16,7 @@ The ReplaceRegex replaces the path of a URL using regex matching and replacement
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Replace path with regex
|
# Replace path with regex
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-replacepathregex.replacepathregex.regex=^/foo/(.*)"
|
- "traefik.http.middlewares.test-replacepathregex.replacepathregex.regex=^/foo/(.*)"
|
||||||
@@ -25,7 +25,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Replace path with regex
|
# Replace path with regex
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-replacepathregex
|
name: test-replacepathregex
|
||||||
@@ -41,20 +41,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-replacepathregex.replacepathregex.replacement=/bar/$1"
|
- "traefik.http.middlewares.test-replacepathregex.replacepathregex.replacement=/bar/$1"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-replacepathregex.replacepathregex.regex": "^/foo/(.*)",
|
|
||||||
"traefik.http.middlewares.test-replacepathregex.replacepathregex.replacement": "/bar/$1"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Replace path with regex
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-replacepathregex.replacepathregex.regex=^/foo/(.*)"
|
|
||||||
- "traefik.http.middlewares.test-replacepathregex.replacepathregex.replacement=/bar/$1"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Replace path with regex
|
# Replace path with regex
|
||||||
http:
|
http:
|
||||||
|
@@ -18,7 +18,7 @@ The Retry middleware has an optional configuration to enable an exponential back
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Retry 4 times with exponential backoff
|
# Retry 4 times with exponential backoff
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-retry.retry.attempts=4"
|
- "traefik.http.middlewares.test-retry.retry.attempts=4"
|
||||||
@@ -27,7 +27,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Retry 4 times with exponential backoff
|
# Retry 4 times with exponential backoff
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-retry
|
name: test-retry
|
||||||
@@ -43,20 +43,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-retry.retry.initialinterval=100ms"
|
- "traefik.http.middlewares.test-retry.retry.initialinterval=100ms"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-retry.retry.attempts": "4",
|
|
||||||
"traefik.http.middlewares.test-retry.retry.initialinterval": "100ms",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Retry 4 times with exponential backoff
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-retry.retry.attempts=4"
|
|
||||||
- "traefik.http.middlewares.test-retry.retry.initialinterval=100ms"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Retry 4 times with exponential backoff
|
# Retry 4 times with exponential backoff
|
||||||
http:
|
http:
|
||||||
|
@@ -16,7 +16,7 @@ Remove the specified prefixes from the URL path.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Strip prefix /foobar and /fiibar
|
# Strip prefix /foobar and /fiibar
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-stripprefix.stripprefix.prefixes=/foobar,/fiibar"
|
- "traefik.http.middlewares.test-stripprefix.stripprefix.prefixes=/foobar,/fiibar"
|
||||||
@@ -24,7 +24,7 @@ labels:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Strip prefix /foobar and /fiibar
|
# Strip prefix /foobar and /fiibar
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-stripprefix
|
name: test-stripprefix
|
||||||
@@ -40,18 +40,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-stripprefix.stripprefix.prefixes=/foobar,/fiibar"
|
- "traefik.http.middlewares.test-stripprefix.stripprefix.prefixes=/foobar,/fiibar"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-stripprefix.stripprefix.prefixes": "/foobar,/fiibar"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Strip prefix /foobar and /fiibar
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-stripprefix.stripprefix.prefixes=/foobar,/fiibar"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Strip prefix /foobar and /fiibar
|
# Strip prefix /foobar and /fiibar
|
||||||
http:
|
http:
|
||||||
@@ -88,85 +76,3 @@ For instance, `/products` also matches `/products/shoes` and `/products/shirts`.
|
|||||||
|
|
||||||
If your backend is serving assets (e.g., images or JavaScript files), it can use the `X-Forwarded-Prefix` header to properly construct relative URLs.
|
If your backend is serving assets (e.g., images or JavaScript files), it can use the `X-Forwarded-Prefix` header to properly construct relative URLs.
|
||||||
Using the previous example, the backend should return `/products/shoes/image.png` (and not `/image.png`, which Traefik would likely not be able to associate with the same backend).
|
Using the previous example, the backend should return `/products/shoes/image.png` (and not `/image.png`, which Traefik would likely not be able to associate with the same backend).
|
||||||
|
|
||||||
### `forceSlash`
|
|
||||||
|
|
||||||
_Optional, Default=true_
|
|
||||||
|
|
||||||
The `forceSlash` option ensures the resulting stripped path is not the empty string, by replacing it with `/` when necessary.
|
|
||||||
|
|
||||||
This option was added to keep the initial (non-intuitive) behavior of this middleware, in order to avoid introducing a breaking change.
|
|
||||||
|
|
||||||
It is recommended to explicitly set `forceSlash` to `false`.
|
|
||||||
|
|
||||||
??? info "Behavior examples"
|
|
||||||
|
|
||||||
- `forceSlash=true`
|
|
||||||
|
|
||||||
| Path | Prefix to strip | Result |
|
|
||||||
|------------|-----------------|--------|
|
|
||||||
| `/` | `/` | `/` |
|
|
||||||
| `/foo` | `/foo` | `/` |
|
|
||||||
| `/foo/` | `/foo` | `/` |
|
|
||||||
| `/foo/` | `/foo/` | `/` |
|
|
||||||
| `/bar` | `/foo` | `/bar` |
|
|
||||||
| `/foo/bar` | `/foo` | `/bar` |
|
|
||||||
|
|
||||||
- `forceSlash=false`
|
|
||||||
|
|
||||||
| Path | Prefix to strip | Result |
|
|
||||||
|------------|-----------------|--------|
|
|
||||||
| `/` | `/` | empty |
|
|
||||||
| `/foo` | `/foo` | empty |
|
|
||||||
| `/foo/` | `/foo` | `/` |
|
|
||||||
| `/foo/` | `/foo/` | empty |
|
|
||||||
| `/bar` | `/foo` | `/bar` |
|
|
||||||
| `/foo/bar` | `/foo` | `/bar` |
|
|
||||||
|
|
||||||
```yaml tab="Docker"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.example.stripprefix.prefixes=/foobar"
|
|
||||||
- "traefik.http.middlewares.example.stripprefix.forceSlash=false"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
|
||||||
kind: Middleware
|
|
||||||
metadata:
|
|
||||||
name: example
|
|
||||||
spec:
|
|
||||||
stripPrefix:
|
|
||||||
prefixes:
|
|
||||||
- "/foobar"
|
|
||||||
forceSlash: false
|
|
||||||
```
|
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.example.stripprefix.prefixes": "/foobar",
|
|
||||||
"traefik.http.middlewares.example.stripprefix.forceSlash": "false"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.example.stripprefix.prefixes=/foobar"
|
|
||||||
- "traefik.http.middlewares.example.stripprefix.forceSlash=false"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
http:
|
|
||||||
middlewares:
|
|
||||||
example:
|
|
||||||
stripPrefix:
|
|
||||||
prefixes:
|
|
||||||
- "/foobar"
|
|
||||||
forceSlash: false
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[http.middlewares]
|
|
||||||
[http.middlewares.example.stripPrefix]
|
|
||||||
prefixes = ["/foobar"]
|
|
||||||
forceSlash = false
|
|
||||||
```
|
|
||||||
|
@@ -12,13 +12,13 @@ Remove the matching prefixes from the URL path.
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-stripprefixregex.stripprefixregex.regex=/foo/[a-z0-9]+/[0-9]+/"
|
- "traefik.http.middlewares.test-stripprefixregex.stripprefixregex.regex=/foo/[a-z0-9]+/[0-9]+/"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: test-stripprefixregex
|
name: test-stripprefixregex
|
||||||
@@ -32,17 +32,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-stripprefixregex.stripprefixregex.regex=/foo/[a-z0-9]+/[0-9]+/"
|
- "traefik.http.middlewares.test-stripprefixregex.stripprefixregex.regex=/foo/[a-z0-9]+/[0-9]+/"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-stripprefixregex.stripprefixregex.regex": "/foo/[a-z0-9]+/[0-9]+/"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-stripprefixregex.stripprefixregex.regex=/foo/[a-z0-9]+/[0-9]+/"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@@ -23,7 +23,7 @@ Middlewares that use the same protocol can be combined into chains to fit every
|
|||||||
|
|
||||||
## Configuration Example
|
## Configuration Example
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# As a Docker Label
|
# As a Docker Label
|
||||||
whoami:
|
whoami:
|
||||||
# A container that exposes an API to show its IP address
|
# A container that exposes an API to show its IP address
|
||||||
@@ -37,7 +37,7 @@ whoami:
|
|||||||
|
|
||||||
```yaml tab="Kubernetes IngressRoute"
|
```yaml tab="Kubernetes IngressRoute"
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: stripprefix
|
name: stripprefix
|
||||||
@@ -47,7 +47,7 @@ spec:
|
|||||||
- /stripit
|
- /stripit
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: ingressroute
|
name: ingressroute
|
||||||
@@ -66,22 +66,6 @@ spec:
|
|||||||
- "traefik.http.routers.router1.middlewares=foo-add-prefix@consulcatalog"
|
- "traefik.http.routers.router1.middlewares=foo-add-prefix@consulcatalog"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.foo-add-prefix.addprefix.prefix": "/foo",
|
|
||||||
"traefik.http.routers.router1.middlewares": "foo-add-prefix@marathon"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# As a Rancher Label
|
|
||||||
labels:
|
|
||||||
# Create a middleware named `foo-add-prefix`
|
|
||||||
- "traefik.http.middlewares.foo-add-prefix.addprefix.prefix=/foo"
|
|
||||||
# Apply the middleware named `foo-add-prefix` to the router named `router1`
|
|
||||||
- "traefik.http.routers.router1.middlewares=foo-add-prefix@rancher"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# As YAML Configuration File
|
# As YAML Configuration File
|
||||||
http:
|
http:
|
||||||
|
@@ -7,13 +7,13 @@ To proactively prevent services from being overwhelmed with high load, the numbe
|
|||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
|
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: MiddlewareTCP
|
kind: MiddlewareTCP
|
||||||
metadata:
|
metadata:
|
||||||
name: test-inflightconn
|
name: test-inflightconn
|
||||||
@@ -27,18 +27,6 @@ spec:
|
|||||||
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
|
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.tcp.middlewares.test-inflightconn.inflightconn.amount": "10"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Limiting to 10 simultaneous connections.
|
|
||||||
labels:
|
|
||||||
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Limiting to 10 simultaneous connections.
|
# Limiting to 10 simultaneous connections.
|
||||||
tcp:
|
tcp:
|
||||||
|
@@ -1,30 +1,30 @@
|
|||||||
---
|
---
|
||||||
title: "Traefik TCP Middlewares IPWhiteList"
|
title: "Traefik TCP Middlewares IPAllowList"
|
||||||
description: "Learn how to use IPWhiteList in TCP middleware for limiting clients to specific IPs in Traefik Proxy. Read the technical documentation."
|
description: "Learn how to use IPAllowList in TCP middleware for limiting clients to specific IPs in Traefik Proxy. Read the technical documentation."
|
||||||
---
|
---
|
||||||
|
|
||||||
# IPWhiteList
|
# IPAllowList
|
||||||
|
|
||||||
Limiting Clients to Specific IPs
|
Limiting Clients to Specific IPs
|
||||||
{: .subtitle }
|
{: .subtitle }
|
||||||
|
|
||||||
IPWhitelist accepts / refuses connections based on the client IP.
|
IPAllowList accepts / refuses connections based on the client IP.
|
||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Accepts connections from defined IP
|
# Accepts connections from defined IP
|
||||||
labels:
|
labels:
|
||||||
- "traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.tcp.middlewares.test-ipallowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: MiddlewareTCP
|
kind: MiddlewareTCP
|
||||||
metadata:
|
metadata:
|
||||||
name: test-ipwhitelist
|
name: test-ipallowlist
|
||||||
spec:
|
spec:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- 127.0.0.1/32
|
- 127.0.0.1/32
|
||||||
- 192.168.1.7
|
- 192.168.1.7
|
||||||
@@ -32,25 +32,13 @@ spec:
|
|||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Accepts request from defined IP
|
# Accepts request from defined IP
|
||||||
- "traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.tcp.middlewares.test-ipallowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
```
|
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.sourcerange": "127.0.0.1/32,192.168.1.7"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Accepts request from defined IP
|
|
||||||
labels:
|
|
||||||
- "traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# Accepts request from defined IP
|
# Accepts request from defined IP
|
||||||
[tcp.middlewares]
|
[tcp.middlewares]
|
||||||
[tcp.middlewares.test-ipwhitelist.ipWhiteList]
|
[tcp.middlewares.test-ipallowlist.ipAllowList]
|
||||||
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -58,8 +46,8 @@ labels:
|
|||||||
# Accepts request from defined IP
|
# Accepts request from defined IP
|
||||||
tcp:
|
tcp:
|
||||||
middlewares:
|
middlewares:
|
||||||
test-ipwhitelist:
|
test-ipallowlist:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- "127.0.0.1/32"
|
- "127.0.0.1/32"
|
||||||
- "192.168.1.7"
|
- "192.168.1.7"
|
@@ -12,46 +12,33 @@ Controlling connections
|
|||||||
|
|
||||||
## Configuration Example
|
## Configuration Example
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# As a Docker Label
|
# As a Docker Label
|
||||||
whoami:
|
whoami:
|
||||||
# A container that exposes an API to show its IP address
|
# A container that exposes an API to show its IP address
|
||||||
image: traefik/whoami
|
image: traefik/whoami
|
||||||
labels:
|
labels:
|
||||||
# Create a middleware named `foo-ip-whitelist`
|
# Create a middleware named `foo-ip-allowlist`
|
||||||
- "traefik.tcp.middlewares.foo-ip-whitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.tcp.middlewares.foo-ip-allowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
# Apply the middleware named `foo-ip-whitelist` to the router named `router1`
|
# Apply the middleware named `foo-ip-allowlist` to the router named `router1`
|
||||||
- "traefik.tcp.routers.router1.middlewares=foo-ip-whitelist@docker"
|
- "traefik.tcp.routers.router1.middlewares=foo-ip-allowlist@docker"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes IngressRoute"
|
```yaml tab="Kubernetes IngressRoute"
|
||||||
# As a Kubernetes Traefik IngressRoute
|
# As a Kubernetes Traefik IngressRoute
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
|
||||||
kind: CustomResourceDefinition
|
|
||||||
metadata:
|
|
||||||
name: middlewaretcps.traefik.containo.us
|
|
||||||
spec:
|
|
||||||
group: traefik.containo.us
|
|
||||||
version: v1alpha1
|
|
||||||
names:
|
|
||||||
kind: MiddlewareTCP
|
|
||||||
plural: middlewaretcps
|
|
||||||
singular: middlewaretcp
|
|
||||||
scope: Namespaced
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: MiddlewareTCP
|
kind: MiddlewareTCP
|
||||||
metadata:
|
metadata:
|
||||||
name: foo-ip-whitelist
|
name: foo-ip-allowlist
|
||||||
spec:
|
spec:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourcerange:
|
sourcerange:
|
||||||
- 127.0.0.1/32
|
- 127.0.0.1/32
|
||||||
- 192.168.1.7
|
- 192.168.1.7
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRouteTCP
|
kind: IngressRouteTCP
|
||||||
metadata:
|
metadata:
|
||||||
name: ingressroute
|
name: ingressroute
|
||||||
@@ -60,30 +47,14 @@ spec:
|
|||||||
routes:
|
routes:
|
||||||
# more fields...
|
# more fields...
|
||||||
middlewares:
|
middlewares:
|
||||||
- name: foo-ip-whitelist
|
- name: foo-ip-allowlist
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Create a middleware named `foo-ip-whitelist`
|
# Create a middleware named `foo-ip-allowlist`
|
||||||
- "traefik.tcp.middlewares.foo-ip-whitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.tcp.middlewares.foo-ip-allowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
||||||
# Apply the middleware named `foo-ip-whitelist` to the router named `router1`
|
# Apply the middleware named `foo-ip-allowlist` to the router named `router1`
|
||||||
- "traefik.tcp.routers.router1.middlewares=foo-ip-whitelist@consulcatalog"
|
- "traefik.tcp.routers.router1.middlewares=foo-ip-allowlist@consulcatalog"
|
||||||
```
|
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.tcp.middlewares.foo-ip-whitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7",
|
|
||||||
"traefik.tcp.routers.router1.middlewares=foo-ip-whitelist@marathon"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# As a Rancher Label
|
|
||||||
labels:
|
|
||||||
# Create a middleware named `foo-ip-whitelist`
|
|
||||||
- "traefik.tcp.middlewares.foo-ip-whitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
|
||||||
# Apply the middleware named `foo-ip-whitelist` to the router named `router1`
|
|
||||||
- "traefik.tcp.routers.router1.middlewares=foo-ip-whitelist@rancher"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
@@ -91,11 +62,11 @@ labels:
|
|||||||
[tcp.routers]
|
[tcp.routers]
|
||||||
[tcp.routers.router1]
|
[tcp.routers.router1]
|
||||||
service = "myService"
|
service = "myService"
|
||||||
middlewares = ["foo-ip-whitelist"]
|
middlewares = ["foo-ip-allowlist"]
|
||||||
rule = "Host(`example.com`)"
|
rule = "Host(`example.com`)"
|
||||||
|
|
||||||
[tcp.middlewares]
|
[tcp.middlewares]
|
||||||
[tcp.middlewares.foo-ip-whitelist.ipWhiteList]
|
[tcp.middlewares.foo-ip-allowlist.ipAllowList]
|
||||||
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
sourceRange = ["127.0.0.1/32", "192.168.1.7"]
|
||||||
|
|
||||||
[tcp.services]
|
[tcp.services]
|
||||||
@@ -114,12 +85,12 @@ tcp:
|
|||||||
router1:
|
router1:
|
||||||
service: myService
|
service: myService
|
||||||
middlewares:
|
middlewares:
|
||||||
- "foo-ip-whitelist"
|
- "foo-ip-allowlist"
|
||||||
rule: "Host(`example.com`)"
|
rule: "Host(`example.com`)"
|
||||||
|
|
||||||
middlewares:
|
middlewares:
|
||||||
foo-ip-whitelist:
|
foo-ip-allowlist:
|
||||||
ipWhiteList:
|
ipAllowList:
|
||||||
sourceRange:
|
sourceRange:
|
||||||
- "127.0.0.1/32"
|
- "127.0.0.1/32"
|
||||||
- "192.168.1.7"
|
- "192.168.1.7"
|
||||||
@@ -137,4 +108,4 @@ tcp:
|
|||||||
| Middleware | Purpose | Area |
|
| Middleware | Purpose | Area |
|
||||||
|-------------------------------------------|---------------------------------------------------|-----------------------------|
|
|-------------------------------------------|---------------------------------------------------|-----------------------------|
|
||||||
| [InFlightConn](inflightconn.md) | Limits the number of simultaneous connections. | Security, Request lifecycle |
|
| [InFlightConn](inflightconn.md) | Limits the number of simultaneous connections. | Security, Request lifecycle |
|
||||||
| [IPWhiteList](ipwhitelist.md) | Limit the allowed client IPs. | Security, Request lifecycle |
|
| [IPAllowList](ipallowlist.md) | Limit the allowed client IPs. | Security, Request lifecycle |
|
||||||
|
@@ -38,7 +38,7 @@ Then any router can refer to an instance of the wanted middleware.
|
|||||||
|
|
||||||
!!! info "v1"
|
!!! info "v1"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.frontend.rule=Host:test.localhost;PathPrefix:/test"
|
- "traefik.frontend.rule=Host:test.localhost;PathPrefix:/test"
|
||||||
- "traefik.frontend.auth.basic.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
- "traefik.frontend.auth.basic.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
||||||
@@ -100,7 +100,7 @@ Then any router can refer to an instance of the wanted middleware.
|
|||||||
|
|
||||||
!!! info "v2"
|
!!! info "v2"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.routers.router0.rule=Host(`test.localhost`) && PathPrefix(`/test`)"
|
- "traefik.http.routers.router0.rule=Host(`test.localhost`) && PathPrefix(`/test`)"
|
||||||
- "traefik.http.routers.router0.middlewares=auth"
|
- "traefik.http.routers.router0.middlewares=auth"
|
||||||
@@ -110,7 +110,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://doc.traefik.io/traefik/reference/dynamic-configuration/kubernetes-crd/#definitions
|
# https://doc.traefik.io/traefik/reference/dynamic-configuration/kubernetes-crd/#definitions
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: basicauth
|
name: basicauth
|
||||||
@@ -123,7 +123,7 @@ Then any router can refer to an instance of the wanted middleware.
|
|||||||
- test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0
|
- test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: ingressroutebar
|
name: ingressroutebar
|
||||||
@@ -281,7 +281,7 @@ Then, a [router's TLS field](../routing/routers/index.md#tls) can refer to one o
|
|||||||
```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://doc.traefik.io/traefik/reference/dynamic-configuration/kubernetes-crd/#definitions
|
# https://doc.traefik.io/traefik/reference/dynamic-configuration/kubernetes-crd/#definitions
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: TLSOption
|
kind: TLSOption
|
||||||
metadata:
|
metadata:
|
||||||
name: mytlsoption
|
name: mytlsoption
|
||||||
@@ -297,7 +297,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
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: ingressroutebar
|
name: ingressroutebar
|
||||||
@@ -317,7 +317,7 @@ Then, a [router's TLS field](../routing/routers/index.md#tls) can refer to one o
|
|||||||
namespace: default
|
namespace: default
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
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.
|
||||||
# see the cross provider section
|
# see the cross provider section
|
||||||
@@ -428,7 +428,7 @@ To apply a redirection:
|
|||||||
|
|
||||||
!!! info "v2"
|
!!! info "v2"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
traefik.http.routers.app.rule: Host(`example.net`)
|
traefik.http.routers.app.rule: Host(`example.net`)
|
||||||
traefik.http.routers.app.entrypoints: web
|
traefik.http.routers.app.entrypoints: web
|
||||||
@@ -443,7 +443,7 @@ To apply a redirection:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="K8s IngressRoute"
|
```yaml tab="K8s IngressRoute"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: http-redirect-ingressroute
|
name: http-redirect-ingressroute
|
||||||
@@ -461,7 +461,7 @@ To apply a redirection:
|
|||||||
- name: https-redirect
|
- name: https-redirect
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: https-ingressroute
|
name: https-ingressroute
|
||||||
@@ -478,7 +478,7 @@ To apply a redirection:
|
|||||||
tls: {}
|
tls: {}
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: https-redirect
|
name: https-redirect
|
||||||
@@ -556,7 +556,7 @@ with the path `/admin` stripped, e.g. to `http://<IP>:<port>/`. In this case, yo
|
|||||||
|
|
||||||
!!! info "v1"
|
!!! info "v1"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.frontend.rule=Host:example.org;PathPrefixStrip:/admin"
|
- "traefik.frontend.rule=Host:example.org;PathPrefixStrip:/admin"
|
||||||
```
|
```
|
||||||
@@ -588,7 +588,7 @@ with the path `/admin` stripped, e.g. to `http://<IP>:<port>/`. In this case, yo
|
|||||||
|
|
||||||
!!! info "v2"
|
!!! info "v2"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.routers.admin.rule=Host(`example.org`) && PathPrefix(`/admin`)"
|
- "traefik.http.routers.admin.rule=Host(`example.org`) && PathPrefix(`/admin`)"
|
||||||
- "traefik.http.routers.admin.middlewares=admin-stripprefix"
|
- "traefik.http.routers.admin.middlewares=admin-stripprefix"
|
||||||
@@ -597,7 +597,7 @@ with the path `/admin` stripped, e.g. to `http://<IP>:<port>/`. In this case, yo
|
|||||||
|
|
||||||
```yaml tab="Kubernetes IngressRoute"
|
```yaml tab="Kubernetes IngressRoute"
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: http-redirect-ingressroute
|
name: http-redirect-ingressroute
|
||||||
@@ -614,7 +614,7 @@ with the path `/admin` stripped, e.g. to `http://<IP>:<port>/`. In this case, yo
|
|||||||
middlewares:
|
middlewares:
|
||||||
- name: admin-stripprefix
|
- name: admin-stripprefix
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: admin-stripprefix
|
name: admin-stripprefix
|
||||||
@@ -1044,7 +1044,7 @@ To activate the dashboard, you can either:
|
|||||||
|
|
||||||
!!! info "v2"
|
!!! info "v2"
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# dynamic configuration
|
# dynamic configuration
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.routers.api.rule=Host(`traefik.docker.localhost`)"
|
- "traefik.http.routers.api.rule=Host(`traefik.docker.localhost`)"
|
||||||
|
108
docs/content/migration/v2-to-v3.md
Normal file
108
docs/content/migration/v2-to-v3.md
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik V3 Migration Documentation"
|
||||||
|
description: "Migrate from Traefik Proxy v2 to v3 and update all the necessary configurations to take advantage of all the improvements. Read the technical documentation."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Migration Guide: From v2 to v3
|
||||||
|
|
||||||
|
How to Migrate from Traefik v2 to Traefik v3.
|
||||||
|
{: .subtitle }
|
||||||
|
|
||||||
|
The version 3 of Traefik introduces a number of breaking changes,
|
||||||
|
which require one to update their configuration when they migrate from v2 to v3.
|
||||||
|
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 v2, and how it now looks like in v3.
|
||||||
|
|
||||||
|
## IPWhiteList
|
||||||
|
|
||||||
|
In v3, we renamed the `IPWhiteList` middleware to `IPAllowList` without changing anything to the configuration.
|
||||||
|
|
||||||
|
## gRPC Metrics
|
||||||
|
|
||||||
|
In v3, the reported status code for gRPC requests is now the value of the `Grpc-Status` header.
|
||||||
|
|
||||||
|
## Deprecated Options Removal
|
||||||
|
|
||||||
|
- The `pilot` option has been removed from the static configuration.
|
||||||
|
- The `tracing.datadog.globaltag` option has been removed.
|
||||||
|
- The `namespace` option of Consul, Consul Catalog and Nomad providers has been removed.
|
||||||
|
- The `tls.caOptional` option has been removed from the ForwardAuth middleware, as well as from the HTTP, Consul, Etcd, Redis, ZooKeeper, Consul Catalog, and Docker providers.
|
||||||
|
- `sslRedirect`, `sslTemporaryRedirect`, `sslHost`, `sslForceHost` and `featurePolicy` options of the Headers middleware have been removed.
|
||||||
|
- The `forceSlash` option of the StripPrefix middleware has been removed.
|
||||||
|
- The `preferServerCipherSuites` option has been removed.
|
||||||
|
|
||||||
|
## Matchers
|
||||||
|
|
||||||
|
In v3, the `Headers` and `HeadersRegexp` matchers have been renamed to `Header` and `HeaderRegexp` respectively.
|
||||||
|
|
||||||
|
`PathPrefix` no longer uses regular expressions to match path prefixes.
|
||||||
|
|
||||||
|
`QueryRegexp` has been introduced to match query values using a regular expression.
|
||||||
|
|
||||||
|
`HeaderRegexp`, `HostRegexp`, `PathRegexp`, `QueryRegexp`, and `HostSNIRegexp` matchers now uses the [Go regexp syntax](https://golang.org/pkg/regexp/syntax/).
|
||||||
|
|
||||||
|
All matchers now take a single value (except `Header`, `HeaderRegexp`, `Query`, and `QueryRegexp` which take two)
|
||||||
|
and should be explicitly combined using logical operators to mimic previous behavior.
|
||||||
|
|
||||||
|
`Query` can take a single value to match is the query value that has no value (e.g. `/search?mobile`).
|
||||||
|
|
||||||
|
`HostHeader` has been removed, use `Host` instead.
|
||||||
|
|
||||||
|
## Content-Type Auto-Detection
|
||||||
|
|
||||||
|
In v3, the `Content-Type` header is not auto-detected anymore when it is not set by the backend.
|
||||||
|
One should use the `ContentType` middleware to enable the `Content-Type` header value auto-detection.
|
||||||
|
|
||||||
|
## HTTP/3
|
||||||
|
|
||||||
|
In v3, HTTP/3 is no longer an experimental feature.
|
||||||
|
The `experimental.http3` option has been removed from the static configuration.
|
||||||
|
|
||||||
|
## TCP ServersTransport
|
||||||
|
|
||||||
|
In v3, the support of `TCPServersTransport` has been introduced.
|
||||||
|
When using the KubernetesCRD provider, it is therefore necessary to update [RBAC](../reference/dynamic-configuration/kubernetes-crd.md#rbac) and [CRD](../reference/dynamic-configuration/kubernetes-crd.md) manifests.
|
||||||
|
|
||||||
|
### TCP LoadBalancer `terminationDelay` option
|
||||||
|
|
||||||
|
The TCP LoadBalancer `terminationDelay` option has been removed.
|
||||||
|
This option can now be configured directly on the `TCPServersTransport` level, please take a look at this [documentation](../routing/services/index.md#terminationdelay)
|
||||||
|
|
||||||
|
## Rancher v1
|
||||||
|
|
||||||
|
In v3, the rancher v1 provider has been removed because Rancher v1 is [no longer actively maintaned](https://rancher.com/docs/os/v1.x/en/support/) and v2 is supported as a standard Kubernetes provider.
|
||||||
|
|
||||||
|
Rancher 2.x requires Kubernetes and does not have a metadata endpoint of its own for Traefik to query.
|
||||||
|
As such, Rancher 2.x users should utilize the [Kubernetes CRD provider](../providers/kubernetes-crd.md) directly.
|
||||||
|
|
||||||
|
## Marathon provider
|
||||||
|
|
||||||
|
In v3, the Marathon provider has been removed.
|
||||||
|
|
||||||
|
## InfluxDB v1
|
||||||
|
|
||||||
|
In v3, the InfluxDB v1 metrics provider has been removed because InfluxDB v1.x maintenance [ended in 2021](https://www.influxdata.com/blog/influxdb-oss-and-enterprise-roadmap-update-from-influxdays-emea/).
|
||||||
|
|
||||||
|
### Kubernetes CRDs API Group `traefik.containo.us`
|
||||||
|
|
||||||
|
In v3, the Kubernetes CRDs API Group `traefik.containo.us` has been removed.
|
||||||
|
Please use the API Group `traefik.io` instead.
|
||||||
|
|
||||||
|
## Docker & Docker Swarm
|
||||||
|
|
||||||
|
In v3, the provider Docker has been split into 2 providers:
|
||||||
|
|
||||||
|
- Docker provider (without Swarm support)
|
||||||
|
- Swarm provider (Swarm support only)
|
||||||
|
|
||||||
|
### Kubernetes Ingress API Group `networking.k8s.io/v1beta1`
|
||||||
|
|
||||||
|
In v3, the Kubernetes Ingress API Group `networking.k8s.io/v1beta1` ([removed since Kubernetes v1.22](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122)) support has been removed.
|
||||||
|
|
||||||
|
Please use the API Group `networking.k8s.io/v1` instead.
|
||||||
|
|
||||||
|
### Traefik CRD API Version `apiextensions.k8s.io/v1beta1`
|
||||||
|
|
||||||
|
In v3, the Traefik CRD API Version `apiextensions.k8s.io/v1beta1` ([removed since Kubernetes v1.22](https://kubernetes.io/docs/reference/using-api/deprecation-guide/#customresourcedefinition-v122)) support has been removed.
|
||||||
|
|
||||||
|
Please use the CRD definition with the API Version `apiextensions.k8s.io/v1` instead.
|
@@ -65,13 +65,19 @@ rules:
|
|||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
|
- traefik.io
|
||||||
- traefik.containo.us
|
- traefik.containo.us
|
||||||
resources:
|
resources:
|
||||||
- middlewares
|
- middlewares
|
||||||
|
- middlewaretcps
|
||||||
- ingressroutes
|
- ingressroutes
|
||||||
- traefikservices
|
- traefikservices
|
||||||
- ingressroutetcps
|
- ingressroutetcps
|
||||||
|
- ingressrouteudps
|
||||||
- tlsoptions
|
- tlsoptions
|
||||||
|
- tlsstores
|
||||||
|
- serverstransports
|
||||||
|
- serverstransporttcps
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
@@ -164,20 +170,23 @@ rules:
|
|||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
|
- traefik.io
|
||||||
- traefik.containo.us
|
- traefik.containo.us
|
||||||
resources:
|
resources:
|
||||||
- middlewares
|
- middlewares
|
||||||
|
- middlewaretcps
|
||||||
- ingressroutes
|
- ingressroutes
|
||||||
- traefikservices
|
- traefikservices
|
||||||
- ingressroutetcps
|
- ingressroutetcps
|
||||||
- ingressrouteudps
|
- ingressrouteudps
|
||||||
- tlsoptions
|
- tlsoptions
|
||||||
- tlsstores
|
- tlsstores
|
||||||
|
- serverstransports
|
||||||
|
- serverstransporttcps
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
After having both resources applied, Traefik will work properly.
|
After having both resources applied, Traefik will work properly.
|
||||||
@@ -490,3 +499,30 @@ In `v2.8.2`, Traefik now reject certificates signed with the SHA-1 hash function
|
|||||||
### Traefik Pilot
|
### Traefik Pilot
|
||||||
|
|
||||||
In `v2.9`, Traefik Pilot support has been removed.
|
In `v2.9`, Traefik Pilot support has been removed.
|
||||||
|
|
||||||
|
## v2.10
|
||||||
|
|
||||||
|
### Nomad Namespace
|
||||||
|
|
||||||
|
In `v2.10`, the `namespace` option of the Nomad provider is deprecated, please use the `namespaces` options instead.
|
||||||
|
|
||||||
|
### Kubernetes CRDs
|
||||||
|
|
||||||
|
In `v2.10`, the Kubernetes CRDs API Group `traefik.containo.us` is deprecated, and its support will end starting with Traefik v3. Please use the API Group `traefik.io` instead.
|
||||||
|
|
||||||
|
As the Kubernetes CRD provider still works with both API Versions (`traefik.io/v1alpha1` and `traefik.containo.us/v1alpha1`),
|
||||||
|
it means that for the same kind, namespace and name, the provider will only keep the `traefik.io/v1alpha1` resource.
|
||||||
|
|
||||||
|
In addition, the Kubernetes CRDs API Version `traefik.io/v1alpha1` will not be supported in Traefik v3 itself.
|
||||||
|
|
||||||
|
Please note that it is a requirement to update the CRDs and the RBAC in the cluster before upgrading Traefik.
|
||||||
|
To do so, please apply the required [CRDs](https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml) and [RBAC](https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml) manifests for v2.10:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml
|
||||||
|
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Traefik Hub
|
||||||
|
|
||||||
|
In `v2.10`, Traefik Hub configuration has been removed because Traefik Hub v2 doesn't require this configuration.
|
||||||
|
@@ -154,9 +154,9 @@ accessLog:
|
|||||||
headers:
|
headers:
|
||||||
defaultMode: keep
|
defaultMode: keep
|
||||||
names:
|
names:
|
||||||
User-Agent: redact
|
User-Agent: redact
|
||||||
Authorization: drop
|
Authorization: drop
|
||||||
Content-Type: keep
|
Content-Type: keep
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
@@ -229,6 +229,7 @@ accessLog:
|
|||||||
| `RetryAttempts` | The amount of attempts the request was retried. |
|
| `RetryAttempts` | The amount of attempts the request was retried. |
|
||||||
| `TLSVersion` | The TLS version used by the connection (e.g. `1.2`) (if connection is TLS). |
|
| `TLSVersion` | The TLS version used by the connection (e.g. `1.2`) (if connection is TLS). |
|
||||||
| `TLSCipher` | The TLS cipher used by the connection (e.g. `TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA`) (if connection is TLS) |
|
| `TLSCipher` | The TLS cipher used by the connection (e.g. `TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA`) (if connection is TLS) |
|
||||||
|
| `TLSClientSubject` | The string representation of the TLS client certificate's Subject (e.g. `CN=username,O=organization`) |
|
||||||
|
|
||||||
## Log Rotation
|
## Log Rotation
|
||||||
|
|
||||||
@@ -254,7 +255,7 @@ version: "3.7"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
traefik:
|
traefik:
|
||||||
image: traefik:v2.9
|
image: traefik:v3.0
|
||||||
environment:
|
environment:
|
||||||
- TZ=US/Alaska
|
- TZ=US/Alaska
|
||||||
command:
|
command:
|
||||||
|
@@ -64,7 +64,9 @@ log:
|
|||||||
|
|
||||||
#### `level`
|
#### `level`
|
||||||
|
|
||||||
By default, the `level` is set to `ERROR`. Alternative logging levels are `DEBUG`, `PANIC`, `FATAL`, `ERROR`, `WARN`, and `INFO`.
|
By default, the `level` is set to `ERROR`.
|
||||||
|
|
||||||
|
Alternative logging levels are `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`, and `PANIC`.
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
log:
|
log:
|
||||||
@@ -80,10 +82,101 @@ log:
|
|||||||
--log.level=DEBUG
|
--log.level=DEBUG
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `noColor`
|
||||||
|
|
||||||
|
When using the 'common' format, disables the colorized output.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
noColor: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
noColor = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.nocolor=true
|
||||||
|
```
|
||||||
|
|
||||||
## Log Rotation
|
## Log Rotation
|
||||||
|
|
||||||
Traefik will close and reopen its log files, assuming they're configured, on receipt of a USR1 signal.
|
The rotation of the log files can be configured with the following options.
|
||||||
This allows the logs to be rotated and processed by an external program, such as `logrotate`.
|
|
||||||
|
|
||||||
!!! warning
|
### `maxSize`
|
||||||
This does not work on Windows due to the lack of USR signals.
|
|
||||||
|
`maxSize` is the maximum size in megabytes of the log file before it gets rotated.
|
||||||
|
It defaults to 100 megabytes.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
maxSize: 1
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
maxSize = 1
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.maxsize=1
|
||||||
|
```
|
||||||
|
|
||||||
|
### `maxBackups`
|
||||||
|
|
||||||
|
`maxBackups` is the maximum number of old log files to retain.
|
||||||
|
The default is to retain all old log files (though `maxAge` may still cause them to get deleted).
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
maxBackups: 3
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
maxBackups = 3
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.maxbackups=3
|
||||||
|
```
|
||||||
|
|
||||||
|
### `maxAge`
|
||||||
|
|
||||||
|
`maxAge` is the maximum number of days to retain old log files based on the timestamp encoded in their filename.
|
||||||
|
Note that a day is defined as 24 hours and may not exactly correspond to calendar days due to daylight savings, leap seconds, etc.
|
||||||
|
The default is not to remove old log files based on age.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
maxAge: 3
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
maxAge = 3
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.maxage=3
|
||||||
|
```
|
||||||
|
|
||||||
|
### `compress`
|
||||||
|
|
||||||
|
`compress` determines if the rotated log files should be compressed using gzip.
|
||||||
|
The default is not to perform compression.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
compress: 3
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
compress = 3
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.compress=3
|
||||||
|
```
|
||||||
|
@@ -1,268 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Traefik InfluxDB Documentation"
|
|
||||||
description: "Traefik supports several metrics backends, including InfluxDB. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
|
||||||
---
|
|
||||||
|
|
||||||
# InfluxDB
|
|
||||||
|
|
||||||
To enable the InfluxDB:
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB: {}
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `address`
|
|
||||||
|
|
||||||
_Required, Default="localhost:8089"_
|
|
||||||
|
|
||||||
Address instructs exporter to send metrics to influxdb at this address.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
address: localhost:8089
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
address = "localhost:8089"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.address=localhost:8089
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `protocol`
|
|
||||||
|
|
||||||
_Required, Default="udp"_
|
|
||||||
|
|
||||||
InfluxDB's address protocol (udp or http).
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
protocol: udp
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
protocol = "udp"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.protocol=udp
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `database`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
InfluxDB database used when protocol is http.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
database: db
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
database = "db"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.database=db
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `retentionPolicy`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
InfluxDB retention policy used when protocol is http.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
retentionPolicy: two_hours
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
retentionPolicy = "two_hours"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.retentionPolicy=two_hours
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `username`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
InfluxDB username (only with http).
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
username: john
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
username = "john"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.username=john
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `password`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
InfluxDB password (only with http).
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
password: secret
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
password = "secret"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.password=secret
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `addEntryPointsLabels`
|
|
||||||
|
|
||||||
_Optional, Default=true_
|
|
||||||
|
|
||||||
Enable metrics on entry points.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
addEntryPointsLabels: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
addEntryPointsLabels = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.addEntryPointsLabels=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `addRoutersLabels`
|
|
||||||
|
|
||||||
_Optional, Default=false_
|
|
||||||
|
|
||||||
Enable metrics on routers.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
addRoutersLabels: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
addRoutersLabels = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.addrouterslabels=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `addServicesLabels`
|
|
||||||
|
|
||||||
_Optional, Default=true_
|
|
||||||
|
|
||||||
Enable metrics on services.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
addServicesLabels: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
addServicesLabels = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.addServicesLabels=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `pushInterval`
|
|
||||||
|
|
||||||
_Optional, Default=10s_
|
|
||||||
|
|
||||||
The interval used by the exporter to push metrics to influxdb.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
pushInterval: 10s
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
pushInterval = "10s"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.pushInterval=10s
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `additionalLabels`
|
|
||||||
|
|
||||||
_Optional, Default={}_
|
|
||||||
|
|
||||||
Additional labels (influxdb tags) on all metrics.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
metrics:
|
|
||||||
influxDB:
|
|
||||||
additionalLabels:
|
|
||||||
host: example.com
|
|
||||||
environment: production
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[metrics]
|
|
||||||
[metrics.influxDB]
|
|
||||||
[metrics.influxDB.additionalLabels]
|
|
||||||
host = "example.com"
|
|
||||||
environment = "production"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--metrics.influxdb.additionallabels.host=example.com --metrics.influxdb.additionallabels.environment=production
|
|
||||||
```
|
|
353
docs/content/observability/metrics/opentelemetry.md
Normal file
353
docs/content/observability/metrics/opentelemetry.md
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik OpenTelemetry Documentation"
|
||||||
|
description: "Traefik supports several metrics backends, including OpenTelemetry. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
||||||
|
---
|
||||||
|
|
||||||
|
# OpenTelemetry
|
||||||
|
|
||||||
|
To enable the OpenTelemetry:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! info "The OpenTelemetry exporter will export metrics to the collector by using HTTP by default, see the [gRPC Section](#grpc-configuration) to use gRPC."
|
||||||
|
|
||||||
|
#### `address`
|
||||||
|
|
||||||
|
_Required, Default="localhost:4318", Format="`<host>:<port>`"_
|
||||||
|
|
||||||
|
Address of the OpenTelemetry Collector to send metrics to.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
address: localhost:4318
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
address = "localhost:4318"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.address=localhost:4318
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `addEntryPointsLabels`
|
||||||
|
|
||||||
|
_Optional, Default=true_
|
||||||
|
|
||||||
|
Enable metrics on entry points.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
addEntryPointsLabels: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
addEntryPointsLabels = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.addEntryPointsLabels=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `addRoutersLabels`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Enable metrics on routers.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
addRoutersLabels: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
addRoutersLabels = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.addRoutersLabels=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `addServicesLabels`
|
||||||
|
|
||||||
|
_Optional, Default=true_
|
||||||
|
|
||||||
|
Enable metrics on services.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
addServicesLabels: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
addServicesLabels = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.addServicesLabels=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `explicitBoundaries`
|
||||||
|
|
||||||
|
_Optional, Default=".005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10"_
|
||||||
|
|
||||||
|
Explicit boundaries for Histogram data points.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
explicitBoundaries:
|
||||||
|
- 0.1
|
||||||
|
- 0.3
|
||||||
|
- 1.2
|
||||||
|
- 5.0
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
explicitBoundaries = [0.1,0.3,1.2,5.0]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.explicitBoundaries=0.1,0.3,1.2,5.0
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with metrics by the reporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.headers.foo=bar --metrics.openTelemetry.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `insecure`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Allows reporter to send metrics to the OpenTelemetry Collector without using a secured protocol.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
insecure: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
insecure = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.insecure=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `pushInterval`
|
||||||
|
|
||||||
|
_Optional, Default=10s_
|
||||||
|
|
||||||
|
Interval at which metrics are sent to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
pushInterval: 10s
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
pushInterval = "10s"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.pushInterval=10s
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `path`
|
||||||
|
|
||||||
|
_Required, Default="/v1/metrics"_
|
||||||
|
|
||||||
|
Allows to override the default URL path used for sending metrics.
|
||||||
|
This option has no effect when using gRPC transport.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
path: /foo/v1/metrics
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry]
|
||||||
|
path = "/foo/v1/metrics"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.path=/foo/v1/metrics
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the TLS configuration used by the reporter to send metrics to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
##### `ca`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
`ca` is the path to the certificate authority used for the secure connection to the OpenTelemetry Collector,
|
||||||
|
it defaults to the system bundle.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.openTelemetry.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.tls.ca=path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
##### `cert`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
`cert` is the path to the public certificate used for the secure connection to the OpenTelemetry Collector.
|
||||||
|
When using this option, setting the `key` option is required.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.openTelemetry.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.tls.cert=path/to/foo.cert
|
||||||
|
--metrics.openTelemetry.tls.key=path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
##### `key`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
`key` is the path to the private key used for the secure connection to the OpenTelemetry Collector.
|
||||||
|
When using this option, setting the `cert` option is required.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.openTelemetry.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.tls.cert=path/to/foo.cert
|
||||||
|
--metrics.openTelemetry.tls.key=path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
##### `insecureSkipVerify`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
If `insecureSkipVerify` is `true`,
|
||||||
|
the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.openTelemetry.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### gRPC configuration
|
||||||
|
|
||||||
|
This instructs the reporter to send metrics to the OpenTelemetry Collector using gRPC.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
openTelemetry:
|
||||||
|
grpc: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.openTelemetry.grpc]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.openTelemetry.grpc=true
|
||||||
|
```
|
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Traefik Metrics Overview"
|
title: "Traefik Metrics Overview"
|
||||||
description: "Traefik Proxy supports these metrics backend systems: Datadog, InfluxDB, Prometheus, and StatsD. Read the full documentation to get started."
|
description: "Traefik Proxy supports these metrics backend systems: Datadog, InfluxDB 2.X, Prometheus, and StatsD. Read the full documentation to get started."
|
||||||
---
|
---
|
||||||
|
|
||||||
# Metrics
|
# Metrics
|
||||||
@@ -8,34 +8,39 @@ description: "Traefik Proxy supports these metrics backend systems: Datadog, Inf
|
|||||||
Traefik supports these metrics backends:
|
Traefik supports these metrics backends:
|
||||||
|
|
||||||
- [Datadog](./datadog.md)
|
- [Datadog](./datadog.md)
|
||||||
- [InfluxDB](./influxdb.md)
|
|
||||||
- [InfluxDB2](./influxdb2.md)
|
- [InfluxDB2](./influxdb2.md)
|
||||||
- [Prometheus](./prometheus.md)
|
- [Prometheus](./prometheus.md)
|
||||||
- [StatsD](./statsd.md)
|
- [StatsD](./statsd.md)
|
||||||
|
|
||||||
|
Traefik Proxy hosts an official Grafana dashboard for both [on-premises](https://grafana.com/grafana/dashboards/17346) and [Kubernetes](https://grafana.com/grafana/dashboards/17347) deployments.
|
||||||
|
|
||||||
## Global Metrics
|
## Global Metrics
|
||||||
|
|
||||||
| Metric | Type | Description |
|
| Metric | Type | [Labels](#labels) | Description |
|
||||||
|---------------------------------------------|---------|---------------------------------------------------------|
|
|----------------------------|-------|--------------------------|--------------------------------------------------------------------|
|
||||||
| Config reload total | Count | The total count of configuration reloads. |
|
| Config reload total | Count | | The total count of configuration reloads. |
|
||||||
| Config reload last success | Gauge | The timestamp of the last configuration reload success. |
|
| Config reload last success | Gauge | | The timestamp of the last configuration reload success. |
|
||||||
| TLS certificates not after | Gauge | The expiration date of certificates. |
|
| Open connections | Gauge | `entrypoint`, `protocol` | The current count of open connections, by entrypoint and protocol. |
|
||||||
|
| TLS certificates not after | Gauge | | The expiration date of certificates. |
|
||||||
|
|
||||||
```prom tab="Prometheus"
|
```prom tab="Prometheus"
|
||||||
traefik_config_reloads_total
|
traefik_config_reloads_total
|
||||||
traefik_config_last_reload_success
|
traefik_config_last_reload_success
|
||||||
|
traefik_open_connections
|
||||||
traefik_tls_certs_not_after
|
traefik_tls_certs_not_after
|
||||||
```
|
```
|
||||||
|
|
||||||
```dd tab="Datadog"
|
```dd tab="Datadog"
|
||||||
config.reload.total
|
config.reload.total
|
||||||
config.reload.lastSuccessTimestamp
|
config.reload.lastSuccessTimestamp
|
||||||
|
open.connections
|
||||||
tls.certs.notAfterTimestamp
|
tls.certs.notAfterTimestamp
|
||||||
```
|
```
|
||||||
|
|
||||||
```influxdb tab="InfluxDB / InfluxDB2"
|
```influxdb tab="InfluxDB2"
|
||||||
traefik.config.reload.total
|
traefik.config.reload.total
|
||||||
traefik.config.reload.lastSuccessTimestamp
|
traefik.config.reload.lastSuccessTimestamp
|
||||||
|
traefik.open.connections
|
||||||
traefik.tls.certs.notAfterTimestamp
|
traefik.tls.certs.notAfterTimestamp
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -43,17 +48,35 @@ traefik.tls.certs.notAfterTimestamp
|
|||||||
# Default prefix: "traefik"
|
# Default prefix: "traefik"
|
||||||
{prefix}.config.reload.total
|
{prefix}.config.reload.total
|
||||||
{prefix}.config.reload.lastSuccessTimestamp
|
{prefix}.config.reload.lastSuccessTimestamp
|
||||||
|
{prefix}.open.connections
|
||||||
{prefix}.tls.certs.notAfterTimestamp
|
{prefix}.tls.certs.notAfterTimestamp
|
||||||
```
|
```
|
||||||
|
|
||||||
## EntryPoint Metrics
|
```opentelemetry tab="OpenTelemetry"
|
||||||
|
traefik_config_reloads_total
|
||||||
|
traefik_config_last_reload_success
|
||||||
|
traefik_open_connections
|
||||||
|
traefik_tls_certs_not_after
|
||||||
|
```
|
||||||
|
|
||||||
|
### Labels
|
||||||
|
|
||||||
|
Here is a comprehensive list of labels that are provided by the global metrics:
|
||||||
|
|
||||||
|
| Label | Description | example |
|
||||||
|
|---------------|----------------------------------------|----------------------|
|
||||||
|
| `entrypoint` | Entrypoint that handled the connection | "example_entrypoint" |
|
||||||
|
| `protocol` | Connection protocol | "TCP" |
|
||||||
|
|
||||||
|
## HTTP Metrics
|
||||||
|
|
||||||
|
### EntryPoint Metrics
|
||||||
|
|
||||||
| Metric | Type | [Labels](#labels) | Description |
|
| Metric | Type | [Labels](#labels) | Description |
|
||||||
|-----------------------|-----------|--------------------------------------------|---------------------------------------------------------------------|
|
|-----------------------|-----------|--------------------------------------------|---------------------------------------------------------------------|
|
||||||
| Requests total | Count | `code`, `method`, `protocol`, `entrypoint` | The total count of HTTP requests received by an entrypoint. |
|
| Requests total | Count | `code`, `method`, `protocol`, `entrypoint` | The total count of HTTP requests received by an entrypoint. |
|
||||||
| Requests TLS total | Count | `tls_version`, `tls_cipher`, `entrypoint` | The total count of HTTPS requests received by an entrypoint. |
|
| Requests TLS total | Count | `tls_version`, `tls_cipher`, `entrypoint` | The total count of HTTPS requests received by an entrypoint. |
|
||||||
| Request duration | Histogram | `code`, `method`, `protocol`, `entrypoint` | Request processing duration histogram on an entrypoint. |
|
| Request duration | Histogram | `code`, `method`, `protocol`, `entrypoint` | Request processing duration histogram on an entrypoint. |
|
||||||
| Open connections | Count | `method`, `protocol`, `entrypoint` | The current count of open connections on an entrypoint. |
|
|
||||||
| Requests bytes total | Count | `code`, `method`, `protocol`, `entrypoint` | The total size of HTTP requests in bytes handled by an entrypoint. |
|
| Requests bytes total | Count | `code`, `method`, `protocol`, `entrypoint` | The total size of HTTP requests in bytes handled by an entrypoint. |
|
||||||
| Responses bytes total | Count | `code`, `method`, `protocol`, `entrypoint` | The total size of HTTP responses in bytes handled by an entrypoint. |
|
| Responses bytes total | Count | `code`, `method`, `protocol`, `entrypoint` | The total size of HTTP responses in bytes handled by an entrypoint. |
|
||||||
|
|
||||||
@@ -61,7 +84,6 @@ traefik.tls.certs.notAfterTimestamp
|
|||||||
traefik_entrypoint_requests_total
|
traefik_entrypoint_requests_total
|
||||||
traefik_entrypoint_requests_tls_total
|
traefik_entrypoint_requests_tls_total
|
||||||
traefik_entrypoint_request_duration_seconds
|
traefik_entrypoint_request_duration_seconds
|
||||||
traefik_entrypoint_open_connections
|
|
||||||
traefik_entrypoint_requests_bytes_total
|
traefik_entrypoint_requests_bytes_total
|
||||||
traefik_entrypoint_responses_bytes_total
|
traefik_entrypoint_responses_bytes_total
|
||||||
```
|
```
|
||||||
@@ -70,16 +92,14 @@ traefik_entrypoint_responses_bytes_total
|
|||||||
entrypoint.request.total
|
entrypoint.request.total
|
||||||
entrypoint.request.tls.total
|
entrypoint.request.tls.total
|
||||||
entrypoint.request.duration
|
entrypoint.request.duration
|
||||||
entrypoint.connections.open
|
|
||||||
entrypoint.requests.bytes.total
|
entrypoint.requests.bytes.total
|
||||||
entrypoint.responses.bytes.total
|
entrypoint.responses.bytes.total
|
||||||
```
|
```
|
||||||
|
|
||||||
```influxdb tab="InfluxDB / InfluxDB2"
|
```influxdb tab="InfluxDB2"
|
||||||
traefik.entrypoint.requests.total
|
traefik.entrypoint.requests.total
|
||||||
traefik.entrypoint.requests.tls.total
|
traefik.entrypoint.requests.tls.total
|
||||||
traefik.entrypoint.request.duration
|
traefik.entrypoint.request.duration
|
||||||
traefik.entrypoint.connections.open
|
|
||||||
traefik.entrypoint.requests.bytes.total
|
traefik.entrypoint.requests.bytes.total
|
||||||
traefik.entrypoint.responses.bytes.total
|
traefik.entrypoint.responses.bytes.total
|
||||||
```
|
```
|
||||||
@@ -89,19 +109,25 @@ traefik.entrypoint.responses.bytes.total
|
|||||||
{prefix}.entrypoint.request.total
|
{prefix}.entrypoint.request.total
|
||||||
{prefix}.entrypoint.request.tls.total
|
{prefix}.entrypoint.request.tls.total
|
||||||
{prefix}.entrypoint.request.duration
|
{prefix}.entrypoint.request.duration
|
||||||
{prefix}.entrypoint.connections.open
|
|
||||||
{prefix}.entrypoint.requests.bytes.total
|
{prefix}.entrypoint.requests.bytes.total
|
||||||
{prefix}.entrypoint.responses.bytes.total
|
{prefix}.entrypoint.responses.bytes.total
|
||||||
```
|
```
|
||||||
|
|
||||||
## Router Metrics
|
```opentelemetry tab="OpenTelemetry"
|
||||||
|
traefik_entrypoint_requests_total
|
||||||
|
traefik_entrypoint_requests_tls_total
|
||||||
|
traefik_entrypoint_request_duration_seconds
|
||||||
|
traefik_entrypoint_requests_bytes_total
|
||||||
|
traefik_entrypoint_responses_bytes_total
|
||||||
|
```
|
||||||
|
|
||||||
|
### Router Metrics
|
||||||
|
|
||||||
| Metric | Type | [Labels](#labels) | Description |
|
| Metric | Type | [Labels](#labels) | Description |
|
||||||
|-----------------------|-----------|---------------------------------------------------|----------------------------------------------------------------|
|
|-----------------------|-----------|---------------------------------------------------|----------------------------------------------------------------|
|
||||||
| Requests total | Count | `code`, `method`, `protocol`, `router`, `service` | The total count of HTTP requests handled by a router. |
|
| Requests total | Count | `code`, `method`, `protocol`, `router`, `service` | The total count of HTTP requests handled by a router. |
|
||||||
| Requests TLS total | Count | `tls_version`, `tls_cipher`, `router`, `service` | The total count of HTTPS requests handled by a router. |
|
| Requests TLS total | Count | `tls_version`, `tls_cipher`, `router`, `service` | The total count of HTTPS requests handled by a router. |
|
||||||
| Request duration | Histogram | `code`, `method`, `protocol`, `router`, `service` | Request processing duration histogram on a router. |
|
| Request duration | Histogram | `code`, `method`, `protocol`, `router`, `service` | Request processing duration histogram on a router. |
|
||||||
| Open connections | Count | `method`, `protocol`, `router`, `service` | The current count of open connections on a router. |
|
|
||||||
| Requests bytes total | Count | `code`, `method`, `protocol`, `router`, `service` | The total size of HTTP requests in bytes handled by a router. |
|
| Requests bytes total | Count | `code`, `method`, `protocol`, `router`, `service` | The total size of HTTP requests in bytes handled by a router. |
|
||||||
| Responses bytes total | Count | `code`, `method`, `protocol`, `router`, `service` | The total size of HTTP responses in bytes handled by a router. |
|
| Responses bytes total | Count | `code`, `method`, `protocol`, `router`, `service` | The total size of HTTP responses in bytes handled by a router. |
|
||||||
|
|
||||||
@@ -109,7 +135,6 @@ traefik.entrypoint.responses.bytes.total
|
|||||||
traefik_router_requests_total
|
traefik_router_requests_total
|
||||||
traefik_router_requests_tls_total
|
traefik_router_requests_tls_total
|
||||||
traefik_router_request_duration_seconds
|
traefik_router_request_duration_seconds
|
||||||
traefik_router_open_connections
|
|
||||||
traefik_router_requests_bytes_total
|
traefik_router_requests_bytes_total
|
||||||
traefik_router_responses_bytes_total
|
traefik_router_responses_bytes_total
|
||||||
```
|
```
|
||||||
@@ -118,16 +143,14 @@ traefik_router_responses_bytes_total
|
|||||||
router.request.total
|
router.request.total
|
||||||
router.request.tls.total
|
router.request.tls.total
|
||||||
router.request.duration
|
router.request.duration
|
||||||
router.connections.open
|
|
||||||
router.requests.bytes.total
|
router.requests.bytes.total
|
||||||
router.responses.bytes.total
|
router.responses.bytes.total
|
||||||
```
|
```
|
||||||
|
|
||||||
```influxdb tab="InfluxDB / InfluxDB2"
|
```influxdb tab="InfluxDB2"
|
||||||
traefik.router.requests.total
|
traefik.router.requests.total
|
||||||
traefik.router.requests.tls.total
|
traefik.router.requests.tls.total
|
||||||
traefik.router.request.duration
|
traefik.router.request.duration
|
||||||
traefik.router.connections.open
|
|
||||||
traefik.router.requests.bytes.total
|
traefik.router.requests.bytes.total
|
||||||
traefik.router.responses.bytes.total
|
traefik.router.responses.bytes.total
|
||||||
```
|
```
|
||||||
@@ -137,19 +160,25 @@ traefik.router.responses.bytes.total
|
|||||||
{prefix}.router.request.total
|
{prefix}.router.request.total
|
||||||
{prefix}.router.request.tls.total
|
{prefix}.router.request.tls.total
|
||||||
{prefix}.router.request.duration
|
{prefix}.router.request.duration
|
||||||
{prefix}.router.connections.open
|
|
||||||
{prefix}.router.requests.bytes.total
|
{prefix}.router.requests.bytes.total
|
||||||
{prefix}.router.responses.bytes.total
|
{prefix}.router.responses.bytes.total
|
||||||
```
|
```
|
||||||
|
|
||||||
## Service Metrics
|
```opentelemetry tab="OpenTelemetry"
|
||||||
|
traefik_router_requests_total
|
||||||
|
traefik_router_requests_tls_total
|
||||||
|
traefik_router_request_duration_seconds
|
||||||
|
traefik_router_requests_bytes_total
|
||||||
|
traefik_router_responses_bytes_total
|
||||||
|
```
|
||||||
|
|
||||||
|
### Service Metrics
|
||||||
|
|
||||||
| Metric | Type | Labels | Description |
|
| Metric | Type | Labels | Description |
|
||||||
|-----------------------|-----------|-----------------------------------------|-------------------------------------------------------------|
|
|-----------------------|-----------|-----------------------------------------|-------------------------------------------------------------|
|
||||||
| Requests total | Count | `code`, `method`, `protocol`, `service` | The total count of HTTP requests processed on a service. |
|
| Requests total | Count | `code`, `method`, `protocol`, `service` | The total count of HTTP requests processed on a service. |
|
||||||
| Requests TLS total | Count | `tls_version`, `tls_cipher`, `service` | The total count of HTTPS requests processed on a service. |
|
| Requests TLS total | Count | `tls_version`, `tls_cipher`, `service` | The total count of HTTPS requests processed on a service. |
|
||||||
| Request duration | Histogram | `code`, `method`, `protocol`, `service` | Request processing duration histogram on a service. |
|
| Request duration | Histogram | `code`, `method`, `protocol`, `service` | Request processing duration histogram on a service. |
|
||||||
| Open connections | Count | `method`, `protocol`, `service` | The current count of open connections on a service. |
|
|
||||||
| Retries total | Count | `service` | The count of requests retries on a service. |
|
| Retries total | Count | `service` | The count of requests retries on a service. |
|
||||||
| Server UP | Gauge | `service`, `url` | Current service's server status, 0 for a down or 1 for up. |
|
| Server UP | Gauge | `service`, `url` | Current service's server status, 0 for a down or 1 for up. |
|
||||||
| Requests bytes total | Count | `code`, `method`, `protocol`, `service` | The total size of requests in bytes received by a service. |
|
| Requests bytes total | Count | `code`, `method`, `protocol`, `service` | The total size of requests in bytes received by a service. |
|
||||||
@@ -159,7 +188,6 @@ traefik.router.responses.bytes.total
|
|||||||
traefik_service_requests_total
|
traefik_service_requests_total
|
||||||
traefik_service_requests_tls_total
|
traefik_service_requests_tls_total
|
||||||
traefik_service_request_duration_seconds
|
traefik_service_request_duration_seconds
|
||||||
traefik_service_open_connections
|
|
||||||
traefik_service_retries_total
|
traefik_service_retries_total
|
||||||
traefik_service_server_up
|
traefik_service_server_up
|
||||||
traefik_service_requests_bytes_total
|
traefik_service_requests_bytes_total
|
||||||
@@ -170,18 +198,16 @@ traefik_service_responses_bytes_total
|
|||||||
service.request.total
|
service.request.total
|
||||||
router.service.tls.total
|
router.service.tls.total
|
||||||
service.request.duration
|
service.request.duration
|
||||||
service.connections.open
|
|
||||||
service.retries.total
|
service.retries.total
|
||||||
service.server.up
|
service.server.up
|
||||||
service.requests.bytes.total
|
service.requests.bytes.total
|
||||||
service.responses.bytes.total
|
service.responses.bytes.total
|
||||||
```
|
```
|
||||||
|
|
||||||
```influxdb tab="InfluxDB / InfluxDB2"
|
```influxdb tab="InfluxDB2"
|
||||||
traefik.service.requests.total
|
traefik.service.requests.total
|
||||||
traefik.service.requests.tls.total
|
traefik.service.requests.tls.total
|
||||||
traefik.service.request.duration
|
traefik.service.request.duration
|
||||||
traefik.service.connections.open
|
|
||||||
traefik.service.retries.total
|
traefik.service.retries.total
|
||||||
traefik.service.server.up
|
traefik.service.server.up
|
||||||
traefik.service.requests.bytes.total
|
traefik.service.requests.bytes.total
|
||||||
@@ -193,14 +219,23 @@ traefik.service.responses.bytes.total
|
|||||||
{prefix}.service.request.total
|
{prefix}.service.request.total
|
||||||
{prefix}.service.request.tls.total
|
{prefix}.service.request.tls.total
|
||||||
{prefix}.service.request.duration
|
{prefix}.service.request.duration
|
||||||
{prefix}.service.connections.open
|
|
||||||
{prefix}.service.retries.total
|
{prefix}.service.retries.total
|
||||||
{prefix}.service.server.up
|
{prefix}.service.server.up
|
||||||
{prefix}.service.requests.bytes.total
|
{prefix}.service.requests.bytes.total
|
||||||
{prefix}.service.responses.bytes.total
|
{prefix}.service.responses.bytes.total
|
||||||
```
|
```
|
||||||
|
|
||||||
## Labels
|
```opentelemetry tab="OpenTelemetry"
|
||||||
|
traefik_service_requests_total
|
||||||
|
traefik_service_requests_tls_total
|
||||||
|
traefik_service_request_duration_seconds
|
||||||
|
traefik_service_retries_total
|
||||||
|
traefik_service_server_up
|
||||||
|
traefik_service_requests_bytes_total
|
||||||
|
traefik_service_responses_bytes_total
|
||||||
|
```
|
||||||
|
|
||||||
|
### Labels
|
||||||
|
|
||||||
Here is a comprehensive list of labels that are provided by the metrics:
|
Here is a comprehensive list of labels that are provided by the metrics:
|
||||||
|
|
||||||
|
@@ -165,3 +165,66 @@ metrics:
|
|||||||
```bash tab="CLI"
|
```bash tab="CLI"
|
||||||
--metrics.prometheus.manualrouting=true
|
--metrics.prometheus.manualrouting=true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `headerLabels`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the extra labels for the `requests_total` metrics, and for each of them, the request header containing the value for this label.
|
||||||
|
Please note that if the header is not present in the request it will be added nonetheless with an empty value.
|
||||||
|
In addition, the label should be a valid label name for Prometheus metrics,
|
||||||
|
otherwise, the Prometheus metrics provider will fail to serve any Traefik-related metric.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
prometheus:
|
||||||
|
headerLabels:
|
||||||
|
label: headerKey
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.prometheus]
|
||||||
|
[metrics.prometheus.headerLabels]
|
||||||
|
label = "headerKey"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.prometheus.headerlabels.label=headerKey
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
Here is an example of the entryPoint `requests_total` metric with an additional "useragent" label.
|
||||||
|
|
||||||
|
When configuring the label in Static Configuration:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
prometheus:
|
||||||
|
headerLabels:
|
||||||
|
useragent: User-Agent
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.prometheus]
|
||||||
|
[metrics.prometheus.headerLabels]
|
||||||
|
useragent = "User-Agent"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.prometheus.headerlabels.useragent=User-Agent
|
||||||
|
```
|
||||||
|
|
||||||
|
And performing a request with a custom User-Agent:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -H "User-Agent: foobar" http://localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
The following metric is produced :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
traefik_entrypoint_requests_total{code="200",entrypoint="web",method="GET",protocol="http",useragent="foobar"} 1
|
||||||
|
```
|
@@ -23,24 +23,46 @@ tracing:
|
|||||||
|
|
||||||
#### `localAgentHostPort`
|
#### `localAgentHostPort`
|
||||||
|
|
||||||
_Required, Default="127.0.0.1:8126"_
|
_Optional, Default="localhost:8126"_
|
||||||
|
|
||||||
Local Agent Host Port instructs the reporter to send spans to the Datadog Agent at this address (host:port).
|
Local Agent Host Port instructs the reporter to send spans to the Datadog Agent at this address (host:port).
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
tracing:
|
tracing:
|
||||||
datadog:
|
datadog:
|
||||||
localAgentHostPort: 127.0.0.1:8126
|
localAgentHostPort: localhost:8126
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
[tracing]
|
[tracing]
|
||||||
[tracing.datadog]
|
[tracing.datadog]
|
||||||
localAgentHostPort = "127.0.0.1:8126"
|
localAgentHostPort = "localhost:8126"
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash tab="CLI"
|
```bash tab="CLI"
|
||||||
--tracing.datadog.localAgentHostPort=127.0.0.1:8126
|
--tracing.datadog.localAgentHostPort=localhost:8126
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `localAgentSocket`
|
||||||
|
|
||||||
|
_Optional, Default=""_
|
||||||
|
|
||||||
|
Local Agent Socket instructs the reporter to send spans to the Datadog Agent at this UNIX socket.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
datadog:
|
||||||
|
localAgentSocket: /var/run/datadog/apm.socket
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.datadog]
|
||||||
|
localAgentSocket = "/var/run/datadog/apm.socket"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.datadog.localAgentSocket=/var/run/datadog/apm.socket
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `debug`
|
#### `debug`
|
||||||
@@ -65,30 +87,6 @@ tracing:
|
|||||||
--tracing.datadog.debug=true
|
--tracing.datadog.debug=true
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `globalTag`
|
|
||||||
|
|
||||||
??? warning "Deprecated in favor of the [`globalTags`](#globaltags) option."
|
|
||||||
|
|
||||||
_Optional, Default=empty_
|
|
||||||
|
|
||||||
Applies a shared key:value tag on all spans.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
datadog:
|
|
||||||
globalTag: sample
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.datadog]
|
|
||||||
globalTag = "sample"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.datadog.globalTag=sample
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `globalTags`
|
#### `globalTags`
|
||||||
|
|
||||||
_Optional, Default=empty_
|
_Optional, Default=empty_
|
||||||
|
246
docs/content/observability/tracing/opentelemetry.md
Normal file
246
docs/content/observability/tracing/opentelemetry.md
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik OpenTelemetry Documentation"
|
||||||
|
description: "Traefik supports several tracing backends, including OpenTelemetry. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
||||||
|
---
|
||||||
|
|
||||||
|
# OpenTelemetry
|
||||||
|
|
||||||
|
To enable the OpenTelemetry tracer:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.openTelemetry]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! info "The OpenTelemetry trace reporter will export traces to the collector using HTTP by default, see the [gRPC Section](#grpc-configuration) to use gRPC."
|
||||||
|
|
||||||
|
!!! info "Trace sampling"
|
||||||
|
|
||||||
|
By default, the OpenTelemetry trace reporter will sample 100% of traces.
|
||||||
|
See [OpenTelemetry's SDK configuration](https://opentelemetry.io/docs/reference/specification/sdk-environment-variables/#general-sdk-configuration) to customize the sampling strategy.
|
||||||
|
|
||||||
|
#### `address`
|
||||||
|
|
||||||
|
_Required, Default="localhost:4318", Format="`<host>:<port>`"_
|
||||||
|
|
||||||
|
Address of the OpenTelemetry Collector to send spans to.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
address: localhost:4318
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.openTelemetry]
|
||||||
|
address = "localhost:4318"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.address=localhost:4318
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with spans by the reporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.openTelemetry.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.headers.foo=bar --tracing.openTelemetry.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `insecure`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Allows reporter to send spans to the OpenTelemetry Collector without using a secured protocol.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
insecure: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.openTelemetry]
|
||||||
|
insecure = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.insecure=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `path`
|
||||||
|
|
||||||
|
_Required, Default="/v1/traces"_
|
||||||
|
|
||||||
|
Allows to override the default URL path used for sending traces.
|
||||||
|
This option has no effect when using gRPC transport.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
path: /foo/v1/traces
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.openTelemetry]
|
||||||
|
path = "/foo/v1/traces"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.path=/foo/v1/traces
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the TLS configuration used by the reporter to send spans to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
##### `ca`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
`ca` is the path to the certificate authority used for the secure connection to the OpenTelemetry Collector,
|
||||||
|
it defaults to the system bundle.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.openTelemetry.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.tls.ca=path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
##### `cert`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
`cert` is the path to the public certificate used for the secure connection to the OpenTelemetry Collector.
|
||||||
|
When using this option, setting the `key` option is required.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.openTelemetry.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.tls.cert=path/to/foo.cert
|
||||||
|
--tracing.openTelemetry.tls.key=path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
##### `key`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
`key` is the path to the private key used for the secure connection to the OpenTelemetry Collector.
|
||||||
|
When using this option, setting the `cert` option is required.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.openTelemetry.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.tls.cert=path/to/foo.cert
|
||||||
|
--tracing.openTelemetry.tls.key=path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
##### `insecureSkipVerify`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
If `insecureSkipVerify` is `true`,
|
||||||
|
the TLS connection to the OpenTelemetry Collector accepts any certificate presented by the server regardless of the hostnames it covers.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.openTelemetry.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### gRPC configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the reporter to send spans to the OpenTelemetry Collector using gRPC.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
openTelemetry:
|
||||||
|
grpc: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.openTelemetry.grpc]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.openTelemetry.grpc=true
|
||||||
|
```
|
@@ -12,7 +12,7 @@ The tracing system allows developers to visualize call flows in their infrastruc
|
|||||||
|
|
||||||
Traefik uses OpenTracing, an open standard designed for distributed tracing.
|
Traefik uses OpenTracing, an open standard designed for distributed tracing.
|
||||||
|
|
||||||
Traefik supports six tracing backends:
|
Traefik supports seven tracing backends:
|
||||||
|
|
||||||
- [Jaeger](./jaeger.md)
|
- [Jaeger](./jaeger.md)
|
||||||
- [Zipkin](./zipkin.md)
|
- [Zipkin](./zipkin.md)
|
||||||
@@ -20,6 +20,7 @@ Traefik supports six tracing backends:
|
|||||||
- [Instana](./instana.md)
|
- [Instana](./instana.md)
|
||||||
- [Haystack](./haystack.md)
|
- [Haystack](./haystack.md)
|
||||||
- [Elastic](./elastic.md)
|
- [Elastic](./elastic.md)
|
||||||
|
- [OpenTelemetry](./opentelemetry.md)
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@@ -72,7 +72,7 @@ to allow defining:
|
|||||||
|
|
||||||
- One or more security features through [middlewares](../middlewares/overview.md)
|
- One or more security features through [middlewares](../middlewares/overview.md)
|
||||||
like authentication ([basicAuth](../middlewares/http/basicauth.md) , [digestAuth](../middlewares/http/digestauth.md),
|
like authentication ([basicAuth](../middlewares/http/basicauth.md) , [digestAuth](../middlewares/http/digestauth.md),
|
||||||
[forwardAuth](../middlewares/http/forwardauth.md)) or [whitelisting](../middlewares/http/ipwhitelist.md).
|
[forwardAuth](../middlewares/http/forwardauth.md)) or [allowlisting](../middlewares/http/ipallowlist.md).
|
||||||
|
|
||||||
- A [router rule](#dashboard-router-rule) for accessing the dashboard,
|
- A [router rule](#dashboard-router-rule) for accessing the dashboard,
|
||||||
through Traefik itself (sometimes referred as "Traefik-ception").
|
through Traefik itself (sometimes referred as "Traefik-ception").
|
||||||
@@ -93,12 +93,12 @@ rule = "Host(`traefik.example.com`)"
|
|||||||
|
|
||||||
```bash tab="Path Prefix Rule"
|
```bash tab="Path Prefix Rule"
|
||||||
# The dashboard can be accessed on http://example.com/dashboard/ or http://traefik.example.com/dashboard/
|
# The dashboard can be accessed on http://example.com/dashboard/ or http://traefik.example.com/dashboard/
|
||||||
rule = "PathPrefix(`/api`, `/dashboard`)"
|
rule = "PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash tab="Combination of Rules"
|
```bash tab="Combination of Rules"
|
||||||
# The dashboard can be accessed on http://traefik.example.com/dashboard/
|
# The dashboard can be accessed on http://traefik.example.com/dashboard/
|
||||||
rule = "Host(`traefik.example.com`) && PathPrefix(`/api`, `/dashboard`)"
|
rule = "Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
||||||
```
|
```
|
||||||
|
|
||||||
??? example "Dashboard Dynamic Configuration Examples"
|
??? example "Dashboard Dynamic Configuration Examples"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Dynamic Configuration
|
# Dynamic Configuration
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.routers.api.rule=Host(`traefik.example.com`)"
|
- "traefik.http.routers.api.rule=Host(`traefik.example.com`)"
|
||||||
@@ -20,7 +20,7 @@ deploy:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes CRD"
|
```yaml tab="Kubernetes CRD"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: traefik-dashboard
|
name: traefik-dashboard
|
||||||
@@ -34,7 +34,7 @@ spec:
|
|||||||
middlewares:
|
middlewares:
|
||||||
- name: auth
|
- name: auth
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: auth
|
name: auth
|
||||||
@@ -51,24 +51,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.routers.api.rule": "Host(`traefik.example.com`)",
|
|
||||||
"traefik.http.routers.api.service": "api@internal",
|
|
||||||
"traefik.http.routers.api.middlewares": "auth",
|
|
||||||
"traefik.http.middlewares.auth.basicauth.users": "test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Dynamic Configuration
|
|
||||||
labels:
|
|
||||||
- "traefik.http.routers.api.rule=Host(`traefik.example.com`)"
|
|
||||||
- "traefik.http.routers.api.service=api@internal"
|
|
||||||
- "traefik.http.routers.api.middlewares=auth"
|
|
||||||
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Dynamic Configuration
|
# Dynamic Configuration
|
||||||
http:
|
http:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
```yaml tab="Docker"
|
```yaml tab="Docker & Swarm"
|
||||||
# Dynamic Configuration
|
# Dynamic Configuration
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
- "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
||||||
@@ -20,7 +20,7 @@ deploy:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes CRD"
|
```yaml tab="Kubernetes CRD"
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: traefik-dashboard
|
name: traefik-dashboard
|
||||||
@@ -34,7 +34,7 @@ spec:
|
|||||||
middlewares:
|
middlewares:
|
||||||
- name: auth
|
- name: auth
|
||||||
---
|
---
|
||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: auth
|
name: auth
|
||||||
@@ -51,24 +51,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.routers.dashboard.rule": "Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))",
|
|
||||||
"traefik.http.routers.dashboard.service": "api@internal",
|
|
||||||
"traefik.http.routers.dashboard.middlewares": "auth",
|
|
||||||
"traefik.http.middlewares.auth.basicauth.users": "test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Dynamic Configuration
|
|
||||||
labels:
|
|
||||||
- "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
|
||||||
- "traefik.http.routers.dashboard.service=api@internal"
|
|
||||||
- "traefik.http.routers.dashboard.middlewares=auth"
|
|
||||||
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Dynamic Configuration
|
# Dynamic Configuration
|
||||||
http:
|
http:
|
||||||
|
@@ -667,41 +667,6 @@ providers:
|
|||||||
|
|
||||||
For additional information, refer to [Restrict the Scope of Service Discovery](./overview.md#restrict-the-scope-of-service-discovery).
|
For additional information, refer to [Restrict the Scope of Service Discovery](./overview.md#restrict-the-scope-of-service-discovery).
|
||||||
|
|
||||||
### `namespace`
|
|
||||||
|
|
||||||
??? warning "Deprecated in favor of the [`namespaces`](#namespaces) option."
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
The `namespace` option defines the namespace in which the consul catalog services will be discovered.
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
The namespace option only works with [Consul Enterprise](https://www.consul.io/docs/enterprise),
|
|
||||||
which provides the [Namespaces](https://www.consul.io/docs/enterprise/namespaces) feature.
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
One should only define either the `namespaces` option or the `namespace` option.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
providers:
|
|
||||||
consulCatalog:
|
|
||||||
namespace: "production"
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[providers.consulCatalog]
|
|
||||||
namespace = "production"
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--providers.consulcatalog.namespace=production
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
### `namespaces`
|
### `namespaces`
|
||||||
|
|
||||||
_Optional, Default=""_
|
_Optional, Default=""_
|
||||||
|
@@ -59,40 +59,6 @@ providers:
|
|||||||
--providers.consul.rootkey=traefik
|
--providers.consul.rootkey=traefik
|
||||||
```
|
```
|
||||||
|
|
||||||
### `namespace`
|
|
||||||
|
|
||||||
??? warning "Deprecated in favor of the [`namespaces`](#namespaces) option."
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
The `namespace` option defines the namespace to query.
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
The namespace option only works with [Consul Enterprise](https://www.consul.io/docs/enterprise),
|
|
||||||
which provides the [Namespaces](https://www.consul.io/docs/enterprise/namespaces) feature.
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
One should only define either the `namespaces` option or the `namespace` option.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
providers:
|
|
||||||
consul:
|
|
||||||
# ...
|
|
||||||
namespace: "production"
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[providers.consul]
|
|
||||||
# ...
|
|
||||||
namespace = "production"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--providers.consul.namespace=production
|
|
||||||
```
|
|
||||||
|
|
||||||
### `namespaces`
|
### `namespaces`
|
||||||
|
|
||||||
_Optional, Default=""_
|
_Optional, Default=""_
|
||||||
|
@@ -12,8 +12,7 @@ A Story of Labels & Containers
|
|||||||
|
|
||||||
Attach labels to your containers and let Traefik do the rest!
|
Attach labels to your containers and let Traefik do the rest!
|
||||||
|
|
||||||
Traefik works with both [Docker (standalone) Engine](https://docs.docker.com/engine/)
|
This provider works with [Docker (standalone) Engine](https://docs.docker.com/engine/).
|
||||||
and [Docker Swarm Mode](https://docs.docker.com/engine/swarm/).
|
|
||||||
|
|
||||||
!!! tip "The Quick Start Uses Docker"
|
!!! tip "The Quick Start Uses Docker"
|
||||||
|
|
||||||
@@ -49,53 +48,10 @@ and [Docker Swarm Mode](https://docs.docker.com/engine/swarm/).
|
|||||||
- traefik.http.routers.my-container.rule=Host(`example.com`)
|
- traefik.http.routers.my-container.rule=Host(`example.com`)
|
||||||
```
|
```
|
||||||
|
|
||||||
??? example "Configuring Docker Swarm & Deploying / Exposing Services"
|
|
||||||
|
|
||||||
Enabling the docker provider (Swarm Mode)
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
providers:
|
|
||||||
docker:
|
|
||||||
# swarm classic (1.12-)
|
|
||||||
# endpoint: "tcp://127.0.0.1:2375"
|
|
||||||
# docker swarm mode (1.12+)
|
|
||||||
endpoint: "tcp://127.0.0.1:2377"
|
|
||||||
swarmMode: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[providers.docker]
|
|
||||||
# swarm classic (1.12-)
|
|
||||||
# endpoint = "tcp://127.0.0.1:2375"
|
|
||||||
# docker swarm mode (1.12+)
|
|
||||||
endpoint = "tcp://127.0.0.1:2377"
|
|
||||||
swarmMode = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
# swarm classic (1.12-)
|
|
||||||
# --providers.docker.endpoint=tcp://127.0.0.1:2375
|
|
||||||
# docker swarm mode (1.12+)
|
|
||||||
--providers.docker.endpoint=tcp://127.0.0.1:2377
|
|
||||||
--providers.docker.swarmMode=true
|
|
||||||
```
|
|
||||||
|
|
||||||
Attach labels to services (not to containers) while in Swarm mode (in your docker compose file)
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: "3"
|
|
||||||
services:
|
|
||||||
my-container:
|
|
||||||
deploy:
|
|
||||||
labels:
|
|
||||||
- traefik.http.routers.my-container.rule=Host(`example.com`)
|
|
||||||
- traefik.http.services.my-container-service.loadbalancer.server.port=8080
|
|
||||||
```
|
|
||||||
|
|
||||||
## Routing Configuration
|
## Routing Configuration
|
||||||
|
|
||||||
When using Docker as a [provider](./overview.md),
|
When using Docker as a [provider](./overview.md),
|
||||||
Traefik uses [container labels](https://docs.docker.com/engine/reference/commandline/run/#set-metadata-on-container--l---label---label-file) to retrieve its routing configuration.
|
Traefik uses [container labels](https://docs.docker.com/engine/reference/commandline/run/#label) to retrieve its routing configuration.
|
||||||
|
|
||||||
See the list of labels in the dedicated [routing](../routing/providers/docker.md) section.
|
See the list of labels in the dedicated [routing](../routing/providers/docker.md) section.
|
||||||
|
|
||||||
@@ -124,14 +80,13 @@ Port detection works as follows:
|
|||||||
- If a container [exposes](https://docs.docker.com/engine/reference/builder/#expose) multiple ports,
|
- If a container [exposes](https://docs.docker.com/engine/reference/builder/#expose) multiple ports,
|
||||||
or does not expose any port, then you must manually specify which port Traefik should use for communication
|
or does not expose any port, then you must manually specify which port Traefik should use for communication
|
||||||
by using the label `traefik.http.services.<service_name>.loadbalancer.server.port`
|
by using the label `traefik.http.services.<service_name>.loadbalancer.server.port`
|
||||||
(Read more on this label in the dedicated section in [routing](../routing/providers/docker.md#port)).
|
(Read more on this label in the dedicated section in [routing](../routing/providers/docker.md#services)).
|
||||||
|
|
||||||
### Host networking
|
### Host networking
|
||||||
|
|
||||||
When exposing containers that are configured with [host networking](https://docs.docker.com/network/host/),
|
When exposing containers that are configured with [host networking](https://docs.docker.com/network/host/),
|
||||||
the IP address of the host is resolved as follows:
|
the IP address of the host is resolved as follows:
|
||||||
|
|
||||||
<!-- TODO: verify and document the swarm mode case with container.Node.IPAddress coming from the API -->
|
|
||||||
- try a lookup of `host.docker.internal`
|
- try a lookup of `host.docker.internal`
|
||||||
- if the lookup was unsuccessful, try a lookup of `host.containers.internal`, ([Podman](https://docs.podman.io/en/latest/) equivalent of `host.docker.internal`)
|
- if the lookup was unsuccessful, try a lookup of `host.containers.internal`, ([Podman](https://docs.podman.io/en/latest/) equivalent of `host.docker.internal`)
|
||||||
- if that lookup was also unsuccessful, fall back to `127.0.0.1`
|
- if that lookup was also unsuccessful, fall back to `127.0.0.1`
|
||||||
@@ -175,7 +130,6 @@ You can specify which Docker API Endpoint to use with the directive [`endpoint`]
|
|||||||
- Authorization with the [Docker Authorization Plugin Mechanism](https://web.archive.org/web/20190920092526/https://docs.docker.com/engine/extend/plugins_authorization/)
|
- Authorization with the [Docker Authorization Plugin Mechanism](https://web.archive.org/web/20190920092526/https://docs.docker.com/engine/extend/plugins_authorization/)
|
||||||
- Accounting at networking level, by exposing the socket only inside a Docker private network, only available for Traefik.
|
- Accounting at networking level, by exposing the socket only inside a Docker private network, only available for Traefik.
|
||||||
- Accounting at container level, by exposing the socket on a another container than Traefik's.
|
- Accounting at container level, by exposing the socket on a another container than Traefik's.
|
||||||
With Swarm mode, it allows scheduling of Traefik on worker nodes, with only the "socket exposer" container on the manager nodes.
|
|
||||||
- Accounting at kernel level, by enforcing kernel calls with mechanisms like [SELinux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux), to only allows an identified set of actions for Traefik's process (or the "socket exposer" process).
|
- Accounting at kernel level, by enforcing kernel calls with mechanisms like [SELinux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux), to only allows an identified set of actions for Traefik's process (or the "socket exposer" process).
|
||||||
- SSH public key authentication (SSH is supported with Docker > 18.09)
|
- SSH public key authentication (SSH is supported with Docker > 18.09)
|
||||||
|
|
||||||
@@ -192,69 +146,13 @@ You can specify which Docker API Endpoint to use with the directive [`endpoint`]
|
|||||||
- [Letting Traefik run on Worker Nodes](https://blog.mikesir87.io/2018/07/letting-traefik-run-on-worker-nodes/)
|
- [Letting Traefik run on Worker Nodes](https://blog.mikesir87.io/2018/07/letting-traefik-run-on-worker-nodes/)
|
||||||
- [Docker Socket Proxy from Tecnativa](https://github.com/Tecnativa/docker-socket-proxy)
|
- [Docker Socket Proxy from Tecnativa](https://github.com/Tecnativa/docker-socket-proxy)
|
||||||
|
|
||||||
## Docker Swarm Mode
|
|
||||||
|
|
||||||
To enable Docker Swarm (instead of standalone Docker) as a configuration provider,
|
|
||||||
set the [`swarmMode`](#swarmmode) directive to `true`.
|
|
||||||
|
|
||||||
### Routing Configuration with Labels
|
|
||||||
|
|
||||||
While in Swarm Mode, Traefik uses labels found on services, not on individual containers.
|
|
||||||
|
|
||||||
Therefore, if you use a compose file with Swarm Mode, labels should be defined in the
|
|
||||||
[`deploy`](https://docs.docker.com/compose/compose-file/compose-file-v3/#labels-1) part of your service.
|
|
||||||
|
|
||||||
This behavior is only enabled for docker-compose version 3+ ([Compose file reference](https://docs.docker.com/compose/compose-file/compose-file-v3/)).
|
|
||||||
|
|
||||||
### Port Detection
|
|
||||||
|
|
||||||
Docker Swarm does not provide any [port detection](#port-detection) information to Traefik.
|
|
||||||
|
|
||||||
Therefore, you **must** specify the port to use for communication by using the label `traefik.http.services.<service_name>.loadbalancer.server.port`
|
|
||||||
(Check the reference for this label in the [routing section for Docker](../routing/providers/docker.md#port)).
|
|
||||||
|
|
||||||
### Docker API Access
|
|
||||||
|
|
||||||
Docker Swarm Mode follows the same rules as Docker [API Access](#docker-api-access).
|
|
||||||
|
|
||||||
Since the Swarm API is only exposed on the [manager nodes](https://docs.docker.com/engine/swarm/how-swarm-mode-works/nodes/#manager-nodes),
|
|
||||||
these are the nodes that Traefik should be scheduled on by deploying Traefik with a constraint on the node "role":
|
|
||||||
|
|
||||||
```shell tab="With Docker CLI"
|
|
||||||
docker service create \
|
|
||||||
--constraint=node.role==manager \
|
|
||||||
#... \
|
|
||||||
```
|
|
||||||
|
|
||||||
```yml tab="With Docker Compose"
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
traefik:
|
|
||||||
# ...
|
|
||||||
deploy:
|
|
||||||
placement:
|
|
||||||
constraints:
|
|
||||||
- node.role == manager
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! tip "Scheduling Traefik on Worker Nodes"
|
|
||||||
|
|
||||||
Following the guidelines given in the previous section ["Docker API Access"](#docker-api-access),
|
|
||||||
if you expose the Docker API through TCP, then Traefik can be scheduled on any node if the TCP
|
|
||||||
socket is reachable.
|
|
||||||
|
|
||||||
Please consider the security implications by reading the [Security Note](#security-note).
|
|
||||||
|
|
||||||
A good example can be found on [Bret Fisher's repository](https://github.com/BretFisher/dogvscat/blob/master/stack-proxy-global.yml#L124).
|
|
||||||
|
|
||||||
## Provider Configuration
|
## Provider Configuration
|
||||||
|
|
||||||
### `endpoint`
|
### `endpoint`
|
||||||
|
|
||||||
_Required, Default="unix:///var/run/docker.sock"_
|
_Required, Default="unix:///var/run/docker.sock"_
|
||||||
|
|
||||||
See the sections [Docker API Access](#docker-api-access) and [Docker Swarm API Access](#docker-api-access_1) for more information.
|
See the [Docker API Access](#docker-api-access) section for more information.
|
||||||
|
|
||||||
??? example "Using the docker.sock"
|
??? example "Using the docker.sock"
|
||||||
|
|
||||||
@@ -265,7 +163,7 @@ See the sections [Docker API Access](#docker-api-access) and [Docker Swarm API A
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
traefik:
|
traefik:
|
||||||
image: traefik:v2.9 # The official v2 Traefik docker image
|
image: traefik:v3.0 # The official v2 Traefik docker image
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -440,10 +338,11 @@ _Optional, Default=```Host(`{{ normalize .Name }}`)```_
|
|||||||
|
|
||||||
The `defaultRule` option defines what routing rule to apply to a container if no rule is defined by a label.
|
The `defaultRule` option defines what routing rule to apply to a container if no rule is defined by a label.
|
||||||
|
|
||||||
It must be a valid [Go template](https://pkg.go.dev/text/template/), and can use
|
It must be a valid [Go template](https://pkg.go.dev/text/template/),
|
||||||
[sprig template functions](https://masterminds.github.io/sprig/).
|
and can use [sprig template functions](https://masterminds.github.io/sprig/).
|
||||||
The container service name can be accessed with the `Name` identifier,
|
The container name can be accessed with the `ContainerName` identifier.
|
||||||
and the template has access to all the labels defined on this container.
|
The service name can be accessed with the `Name` identifier.
|
||||||
|
The template has access to all the labels defined on this container with the `Labels` identifier.
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
providers:
|
providers:
|
||||||
@@ -463,54 +362,6 @@ providers:
|
|||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
### `swarmMode`
|
|
||||||
|
|
||||||
_Optional, Default=false_
|
|
||||||
|
|
||||||
Enables the Swarm Mode (instead of standalone Docker).
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
providers:
|
|
||||||
docker:
|
|
||||||
swarmMode: true
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[providers.docker]
|
|
||||||
swarmMode = true
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--providers.docker.swarmMode=true
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
### `swarmModeRefreshSeconds`
|
|
||||||
|
|
||||||
_Optional, Default=15_
|
|
||||||
|
|
||||||
Defines the polling interval (in seconds) for Swarm Mode.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
providers:
|
|
||||||
docker:
|
|
||||||
swarmModeRefreshSeconds: 30
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[providers.docker]
|
|
||||||
swarmModeRefreshSeconds = 30
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--providers.docker.swarmModeRefreshSeconds=30
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
### `httpClientTimeout`
|
### `httpClientTimeout`
|
||||||
|
|
||||||
_Optional, Default=0_
|
_Optional, Default=0_
|
||||||
|
@@ -234,6 +234,30 @@ providers:
|
|||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `healthyTasksOnly`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Determines whether Traefik discovers only healthy tasks (`HEALTHY` healthStatus).
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
ecs:
|
||||||
|
healthyTasksOnly: true
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.ecs]
|
||||||
|
healthyTasksOnly = true
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.ecs.healthyTasksOnly=true
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
### `defaultRule`
|
### `defaultRule`
|
||||||
|
|
||||||
_Optional, Default=```Host(`{{ normalize .Name }}`)```_
|
_Optional, Default=```Host(`{{ normalize .Name }}`)```_
|
||||||
|
@@ -18,7 +18,7 @@ It supports providing configuration through a [single configuration file](#filen
|
|||||||
|
|
||||||
!!! tip
|
!!! tip
|
||||||
|
|
||||||
The file provider can be a good solution for reusing common elements from other providers (e.g. declaring whitelist middlewares, basic authentication, ...)
|
The file provider can be a good solution for reusing common elements from other providers (e.g. declaring allowlist middlewares, basic authentication, ...)
|
||||||
|
|
||||||
## Configuration Examples
|
## Configuration Examples
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user