mirror of
https://github.com/traefik/traefik.git
synced 2025-05-05 23:43:01 +00:00
Compare commits
540 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
dddb68cd5f | ||
|
8f37c8f0c5 | ||
|
a092c4f535 | ||
|
9d0e76baa8 | ||
|
9c1902c62e | ||
|
b05ec75f98 | ||
|
2d617b3a65 | ||
|
ec6deb40ab | ||
|
160edff257 | ||
|
30d836f963 | ||
|
f6fb240eb6 | ||
|
746cc80d0f | ||
|
fd0fd39642 | ||
|
5e44a138a8 | ||
|
0664367c53 | ||
|
d7d0017545 | ||
|
bb8dfa568a | ||
|
88c5e6a3fd | ||
|
2965aa42cc | ||
|
6c3b099c25 | ||
|
405be420c9 | ||
|
ec38a0675f | ||
|
bd4ff81818 | ||
|
e817d822d7 | ||
|
496f00c7c2 | ||
|
f0cd6f210b | ||
|
c910ceeb00 | ||
|
42778d2ba6 | ||
|
bb7ef7b48a | ||
|
50b0d772e5 | ||
|
5953331c73 | ||
|
ae4a00b4bc | ||
|
30fe11eccf | ||
|
05eb438ae1 | ||
|
b7170df2c3 | ||
|
9e029a84c4 | ||
|
550d96ea67 | ||
|
3c99135bf9 | ||
|
474ab23fe9 | ||
|
c166a41c99 | ||
|
740b4cfd25 | ||
|
fa76ed57d3 | ||
|
07e6491ace | ||
|
32ea014d07 | ||
|
9b0348577a | ||
|
efe03bc9da | ||
|
cce935493a | ||
|
f0849e8ee6 | ||
|
1ccbf743cb | ||
|
1cfcf0d318 | ||
|
56ea028e81 | ||
|
05c547f211 | ||
|
dcd9f2ea96 | ||
|
b5a5e259ed | ||
|
8488214e93 | ||
|
b74767bfa4 | ||
|
786d9f3272 | ||
|
da2278b29a | ||
|
cfebed7328 | ||
|
d04e2d717c | ||
|
cdd24e91b4 | ||
|
4fd6b10b7d | ||
|
857fbb933e | ||
|
2afa03b55c | ||
|
2b6a04bc1d | ||
|
fb527dac1c | ||
|
ef887332c2 | ||
|
261e4395f3 | ||
|
4ce4bd7121 | ||
|
020ab5f347 | ||
|
ad7fb8e82b | ||
|
0528c054a6 | ||
|
ad99c5bbea | ||
|
0a6ff446c7 | ||
|
9a9644bafe | ||
|
95dd17e020 | ||
|
b0a72960bc | ||
|
a57e118a1a | ||
|
6aa56788ea | ||
|
d4d61151e1 | ||
|
456188fa0d | ||
|
03c170f264 | ||
|
7cb46626a1 | ||
|
5b53bae42d | ||
|
caf56e6aed | ||
|
69c8ecfa99 | ||
|
7db2bbb4a3 | ||
|
6d3a685d5a | ||
|
845d0b5ac7 | ||
|
34aa3b75b8 | ||
|
f62fc67418 | ||
|
139f929ec8 | ||
|
e20409676a | ||
|
d152f7fafc | ||
|
ee449db656 | ||
|
a1099bf8d0 | ||
|
596aadfe68 | ||
|
d9f58f94a2 | ||
|
a29628fa2e | ||
|
e280716645 | ||
|
f1c4ba2f26 | ||
|
a870c2af9b | ||
|
aa8eb1af6e | ||
|
189db8d990 | ||
|
68a8650297 | ||
|
1a5ea1c597 | ||
|
8983e45fcf | ||
|
ec214fa825 | ||
|
3a3ffab689 | ||
|
2302debac2 | ||
|
4974d9e4d7 | ||
|
33cf06b36a | ||
|
e85d02c530 | ||
|
d953ee69b4 | ||
|
26738cbf93 | ||
|
b1934231ca | ||
|
9588e51146 | ||
|
e87da0f390 | ||
|
8eb12795d7 | ||
|
514914639a | ||
|
a4c0b1649d | ||
|
f547f1b22b | ||
|
c8b0285c91 | ||
|
826a2b74aa | ||
|
47b4df71bf | ||
|
2b35c7e205 | ||
|
33c1d700c0 | ||
|
536e11d949 | ||
|
0ec12c7aa7 | ||
|
ab0713d587 | ||
|
090db6d4b0 | ||
|
5cfc11fe68 | ||
|
8a0c1e614f | ||
|
394f97bc48 | ||
|
ca5b70e196 | ||
|
fdce8c604a | ||
|
b7b4dd9554 | ||
|
ec00c4aa42 | ||
|
552bd8f180 | ||
|
f70949e3fa | ||
|
97caf758ef | ||
|
7f4ff359a2 | ||
|
47466a456e | ||
|
e8ff825ed2 | ||
|
8527369797 | ||
|
7004f0e750 | ||
|
25caa72c09 | ||
|
8beba9f278 | ||
|
e90f4a7cb4 | ||
|
20cdbdbf31 | ||
|
0dc36379cf | ||
|
e3ed52ba7c | ||
|
b22e081c7c | ||
|
62fa5f1a8e | ||
|
0605f8bf09 | ||
|
f18fcf3688 | ||
|
eeb99c3536 | ||
|
83871f27dd | ||
|
6e1f5dc071 | ||
|
ef5aa129c7 | ||
|
f54f28921b | ||
|
ef168b801c | ||
|
06e64af9e9 | ||
|
be156f6071 | ||
|
6f469ee1ec | ||
|
b46665c620 | ||
|
be13b5b55d | ||
|
e9d677f8cb | ||
|
4613ddd757 | ||
|
c441d04788 | ||
|
5d5dd9dd30 | ||
|
1508a2c221 | ||
|
f16d14cfa6 | ||
|
4625bdf5cb | ||
|
d339bfc8d2 | ||
|
7b08ecfa5e | ||
|
45292148e7 | ||
|
a762cce430 | ||
|
a7502c8700 | ||
|
54c3afd760 | ||
|
a2ab3e534d | ||
|
8cfa68a8e1 | ||
|
373095f1a8 | ||
|
b641d5cf2a | ||
|
c02b72ca51 | ||
|
d317cd90fc | ||
|
eccfcc0924 | ||
|
e62f8af23b | ||
|
7bb181dfa0 | ||
|
fbf6757ce9 | ||
|
f8a78b3b25 | ||
|
a6db1cac37 | ||
|
312ebb17ab | ||
|
a398536688 | ||
|
0be01cc067 | ||
|
f3eba8d3a2 | ||
|
7e75dc0819 | ||
|
42e1f2c9b1 | ||
|
bbeceba580 | ||
|
1ebd12ff82 | ||
|
89f3b272c3 | ||
|
093989fc14 | ||
|
9750bbc353 | ||
|
8c977b8f8c | ||
|
ac1dad3d14 | ||
|
e222d5cb2f | ||
|
9dc2155e63 | ||
|
c2cb4fac10 | ||
|
e8335a94a4 | ||
|
3d92f1645f | ||
|
533c102d4f | ||
|
3eb7ecce19 | ||
|
0b34e0cdcb | ||
|
cf2869407d | ||
|
8ca27b4a1d | ||
|
eb99c8c785 | ||
|
51f7f610c9 | ||
|
5ed972ccd8 | ||
|
2714831a4e | ||
|
6b3167d03e | ||
|
6b1a584c2b | ||
|
8dc9607db7 | ||
|
85f4fd0979 | ||
|
58bbc0cf0f | ||
|
7056eeff6a | ||
|
ad613e58cd | ||
|
12a37346a4 | ||
|
78079377e8 | ||
|
75881359ab | ||
|
8d9ff0c441 | ||
|
b611f967b7 | ||
|
4c4780f886 | ||
|
926a8e88e9 | ||
|
4eedcabbb3 | ||
|
5bf4b536e2 | ||
|
5380e48747 | ||
|
ccc11a69f1 | ||
|
0f57f108ae | ||
|
c0b704e1b0 | ||
|
a50345bf8d | ||
|
bd93e224de | ||
|
930f84850b | ||
|
de732ba53c | ||
|
e8324132f9 | ||
|
f52a36ba12 | ||
|
2ffa6c6feb | ||
|
7dbd3f88f6 | ||
|
957a5f5e73 | ||
|
386c2ffb20 | ||
|
266a2d8b91 | ||
|
5142733858 | ||
|
ecdfb10653 | ||
|
4720caed04 | ||
|
c5a6b49330 | ||
|
87db3300d3 | ||
|
4b4eaa49b5 | ||
|
fc174062b6 | ||
|
d700e95c21 | ||
|
aa760b5a71 | ||
|
a52c81fd91 | ||
|
58dcbb43f9 | ||
|
173a18fdc1 | ||
|
876899be4b | ||
|
89108972b6 | ||
|
d42e75bb2e | ||
|
8d016f5e16 | ||
|
2a0cfda90b | ||
|
9758b1ce36 | ||
|
fe4cca6e9c | ||
|
b1b4e6b918 | ||
|
8cb1829698 | ||
|
2f9905061e | ||
|
0a7a6afd59 | ||
|
b577b3a6ba | ||
|
230019eccf | ||
|
b7de043991 | ||
|
9e0800f938 | ||
|
e7d1a98c5e | ||
|
6f1bd54d86 | ||
|
983940ae60 | ||
|
6d8407893d | ||
|
a8a92eb2a5 | ||
|
61defcdd66 | ||
|
ec638a741e | ||
|
eabcb3e1c0 | ||
|
53a8bd76f2 | ||
|
0e89c48e38 | ||
|
b4f99ae3ac | ||
|
a696f7c654 | ||
|
3ca667a3d4 | ||
|
27af1fb478 | ||
|
e322184a98 | ||
|
b795f128d7 | ||
|
3f48e6f8ef | ||
|
8ea339816a | ||
|
00b1d8b0bc | ||
|
b37aaea36d | ||
|
67f0700377 | ||
|
778dc22e14 | ||
|
359477c583 | ||
|
28d40e7f3c | ||
|
dc752c7847 | ||
|
6155c900be | ||
|
6ca4c5da5c | ||
|
7eac92f49c | ||
|
e6b1b05fdf | ||
|
b452f37e08 | ||
|
8cff718c53 | ||
|
7fc56454ea | ||
|
c0a2e6b4b6 | ||
|
e9bd2b45ac | ||
|
e33bd6874f | ||
|
6e61fe0de1 | ||
|
0e215f9b61 | ||
|
7fdb1ff8af | ||
|
736f37cb58 | ||
|
cff71ee496 | ||
|
5e4dc783c7 | ||
|
440cb11250 | ||
|
e68e647fd9 | ||
|
8b558646fc | ||
|
f8e45a0b29 | ||
|
d65de8fe6c | ||
|
5f2c00b438 | ||
|
c2c1c3e09e | ||
|
d8a778b5cd | ||
|
6a06560318 | ||
|
a4aad5ce5c | ||
|
15973f5503 | ||
|
a4150409c8 | ||
|
aee515b930 | ||
|
05d2c86074 | ||
|
b0d19bd466 | ||
|
d99d2f95e6 | ||
|
8d2a2ff08f | ||
|
73e5dbbfe5 | ||
|
9d8fd24730 | ||
|
f5d451d816 | ||
|
95312d5324 | ||
|
a6b00608d2 | ||
|
7b649e2f0c | ||
|
52e95deee3 | ||
|
da7bb5fc25 | ||
|
34bd611131 | ||
|
83a5c5cfbd | ||
|
c1d9b9ee1f | ||
|
bda4f50eae | ||
|
0017471f0d | ||
|
f69fd43122 | ||
|
ac1753a614 | ||
|
2c6418e17a | ||
|
1ffbffb26a | ||
|
fdf27eb644 | ||
|
9f145dbc28 | ||
|
c84b510f0d | ||
|
fc897f6756 | ||
|
b636b21167 | ||
|
618fb5f232 | ||
|
39fe3869b6 | ||
|
d582e01892 | ||
|
7bda07a422 | ||
|
9b6af61d1b | ||
|
5edac5eccd | ||
|
c06629459d | ||
|
05be441027 | ||
|
6c9687f410 | ||
|
709ff6fb09 | ||
|
86be0a4e6f | ||
|
0e89a6bec7 | ||
|
c5808af4d9 | ||
|
c1ef742977 | ||
|
935d251b21 | ||
|
73769af0fe | ||
|
3b851a5ef2 | ||
|
baf687218c | ||
|
5a2e233a15 | ||
|
c3545c620b | ||
|
c5c61dbade | ||
|
014fdfc4ec | ||
|
b5ec787fb6 | ||
|
063f8fae79 | ||
|
efa6ca0fa1 | ||
|
4e831b920e | ||
|
bc84fdd006 | ||
|
9df04df334 | ||
|
bb6cd581a6 | ||
|
d7ec0cedbf | ||
|
85039e0d54 | ||
|
9be523d772 | ||
|
8b77f0c2dd | ||
|
d02be003ab | ||
|
40de310927 | ||
|
18203f57d2 | ||
|
d37ea3e882 | ||
|
3174c69c66 | ||
|
f4f3dbe1f5 | ||
|
aece9a1051 | ||
|
190b9b1afa | ||
|
683e2ee5c6 | ||
|
21da705ec9 | ||
|
a3ac456199 | ||
|
9843757834 | ||
|
f9831f5b1b | ||
|
bab48bed22 | ||
|
6cb2ff2af9 | ||
|
5e0855ecc7 | ||
|
f57cee578f | ||
|
6c19a9cb8f | ||
|
0eeb85d01d | ||
|
64ff214ff8 | ||
|
111f3716fa | ||
|
4e0a05406b | ||
|
319517adef | ||
|
7a315bb043 | ||
|
81ce45271d | ||
|
980dac4572 | ||
|
ff7966f9cd | ||
|
3bbc560283 | ||
|
ccf3a9995a | ||
|
fea94a3393 | ||
|
4ddef9830b | ||
|
45bb00be04 | ||
|
a69c1ba3b7 | ||
|
d51a2ce487 | ||
|
6858dbdd07 | ||
|
b2bb96390a | ||
|
e29a142f6a | ||
|
35c704ace3 | ||
|
d141e4a1ed | ||
|
c7cd0df3b3 | ||
|
286181aa61 | ||
|
8d0979bfd0 | ||
|
4acec60e72 | ||
|
0ee377bc9f | ||
|
46f4a8541e | ||
|
55e00be36e | ||
|
d6457e6cbb | ||
|
ca2b9e8e77 | ||
|
f4dc298406 | ||
|
4f6c15cc14 | ||
|
eb585740a1 | ||
|
7d66f439eb | ||
|
124ee3c48c | ||
|
08b80c20f0 | ||
|
d4daafa468 | ||
|
52d2d959af | ||
|
0a35fa096a | ||
|
a7ef965412 | ||
|
4fbe9b81ec | ||
|
5fd6913ee5 | ||
|
fecaec7a4a | ||
|
60bc47d00e | ||
|
606281a4a5 | ||
|
cf1cbb24df | ||
|
981ad74870 | ||
|
466d7461b7 | ||
|
619045eb4b | ||
|
2cebd0a083 | ||
|
fc071a5ebe | ||
|
79c5f34156 | ||
|
928db9bc42 | ||
|
8174860770 | ||
|
598caf6f78 | ||
|
8b47c5adf7 | ||
|
a3bcf0f39e | ||
|
7875826bd9 | ||
|
7c2af10bbd | ||
|
598a257ae1 | ||
|
20e47d9102 | ||
|
f26e250648 | ||
|
80790cba17 | ||
|
241fb5093a | ||
|
044dc6a221 | ||
|
707f84e2e4 | ||
|
f94298e867 | ||
|
e1abf103c0 | ||
|
8cd4923e72 | ||
|
cd90b9761a | ||
|
f0f5f41fb9 | ||
|
8bf68b7efd | ||
|
b22aef7fff | ||
|
a2016a2953 | ||
|
c38d405cfd | ||
|
8c98234c07 | ||
|
d046af2e91 | ||
|
943238faba | ||
|
2b67f1f66f | ||
|
2ad1fd725a | ||
|
7129f03dc9 | ||
|
748254b6c5 | ||
|
a08a428787 | ||
|
3eeea2bb2b | ||
|
c2dac39da1 | ||
|
e54ee89330 | ||
|
fdd3f2abef | ||
|
517917cd7c | ||
|
6c75052a13 | ||
|
8cf9385938 | ||
|
519ed8bde5 | ||
|
46a61ce9c8 | ||
|
c57876c116 | ||
|
0d81fac3fc | ||
|
db287c4d31 | ||
|
4d86668af3 | ||
|
b93141992e | ||
|
a3e4c85ec0 | ||
|
bee86b5ac7 | ||
|
0ba51d62fa | ||
|
268d1edc8f | ||
|
580e7fa774 | ||
|
46c266661c | ||
|
61325d7b91 | ||
|
3f8aa13e68 | ||
|
08279047ae | ||
|
3dd4968c41 | ||
|
ba1ca68977 | ||
|
56f7515ecd | ||
|
27c02b5a56 | ||
|
630de7481e | ||
|
fadee5e87b | ||
|
67d9c8da0b | ||
|
1a1cfd1adc | ||
|
240fb871b6 | ||
|
d131ef57da | ||
|
281fa25844 | ||
|
bd3eaf4f5e | ||
|
7a6bfd3336 | ||
|
1b9873cae9 | ||
|
e86f21ae7b | ||
|
194247caae | ||
|
cd0654026a | ||
|
b39ce8cc58 | ||
|
33f0aed5ea | ||
|
188ef84c4f | ||
|
a5c520664a | ||
|
38d7011487 | ||
|
033fccccc7 | ||
|
df99a9fb57 | ||
|
d6b69e1347 | ||
|
4bd055cf97 |
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: traefik
|
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -3,11 +3,11 @@ PLEASE READ THIS MESSAGE.
|
|||||||
|
|
||||||
Documentation fixes or enhancements:
|
Documentation fixes or enhancements:
|
||||||
- for Traefik v2: use branch v2.11
|
- for Traefik v2: use branch v2.11
|
||||||
- for Traefik v3: use branch v3.0
|
- for Traefik v3: use branch v3.3
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
- for Traefik v2: use branch v2.11
|
- for Traefik v2: use branch v2.11
|
||||||
- for Traefik v3: use branch v3.0
|
- for Traefik v3: use branch v3.3
|
||||||
|
|
||||||
Enhancements:
|
Enhancements:
|
||||||
- for Traefik v2: we only accept bug fixes
|
- for Traefik v2: we only accept bug fixes
|
||||||
|
2
.github/workflows/documentation.yml
vendored
2
.github/workflows/documentation.yml
vendored
@ -47,6 +47,6 @@ jobs:
|
|||||||
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/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@ -10,7 +10,7 @@ env:
|
|||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
VERSION: ${{ github.ref_name }}
|
VERSION: ${{ github.ref_name }}
|
||||||
TRAEFIKER_EMAIL: "traefiker@traefik.io"
|
TRAEFIKER_EMAIL: "traefiker@traefik.io"
|
||||||
CODENAME: mimolette
|
CODENAME: chaource
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
26
.github/workflows/sync-docker-images.yaml
vendored
Normal file
26
.github/workflows/sync-docker-images.yaml
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
name: Sync Docker Images
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *" # Run every day
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
if: github.repository == 'traefik/traefik'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: imjasonh/setup-crane@v0.4
|
||||||
|
|
||||||
|
- name: Sync
|
||||||
|
run: |
|
||||||
|
EXCLUDED_TAGS="1.7.9-alpine v1.0.0-beta.392 v1.0.0-beta.404 v1.0.0-beta.704 v1.0.0-rc1 v1.7.9-alpine"
|
||||||
|
EXCLUDED_REGEX=$(echo $EXCLUDED_TAGS | sed 's/ /|/g')
|
||||||
|
diff <(crane ls traefik) <(crane ls ghcr.io/traefik/traefik) | grep '^<' | awk '{print $2}' | while read -r tag; do [[ "$tag" =~ ^($EXCLUDED_REGEX)$ ]] || (echo "Processing image: traefik:$tag"; crane cp "traefik:$tag" "ghcr.io/traefik/traefik:$tag"); done
|
||||||
|
crane cp traefik:latest ghcr.io/traefik/traefik:latest
|
39
.github/workflows/test-conformance.yaml
vendored
Normal file
39
.github/workflows/test-conformance.yaml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Test K8s Gateway API conformance
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/test-conformance.yaml'
|
||||||
|
- 'pkg/provider/kubernetes/gateway/**'
|
||||||
|
- 'integration/fixtures/k8s-conformance/**'
|
||||||
|
- 'integration/k8s_conformance_test.go'
|
||||||
|
|
||||||
|
env:
|
||||||
|
GO_VERSION: '1.23'
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
test-conformance:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go ${{ env.GO_VERSION }}
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
|
||||||
|
- name: Avoid generating webui
|
||||||
|
run: touch webui/static/index.html
|
||||||
|
|
||||||
|
- name: K8s Gateway API conformance test and report
|
||||||
|
run: |
|
||||||
|
make test-gateway-api-conformance
|
||||||
|
git diff --exit-code
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,3 +19,4 @@ plugins-storage/
|
|||||||
plugins-local/
|
plugins-local/
|
||||||
traefik_changelog.md
|
traefik_changelog.md
|
||||||
integration/tailscale.secret
|
integration/tailscale.secret
|
||||||
|
integration/conformance-reports/**/experimental-dev-default-report.yaml
|
||||||
|
@ -143,17 +143,15 @@ linters:
|
|||||||
alias: gatev1alpha2
|
alias: gatev1alpha2
|
||||||
|
|
||||||
# Traefik Kubernetes rewrites:
|
# Traefik Kubernetes rewrites:
|
||||||
- pkg: github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefikcontainous/v1alpha1
|
- pkg: github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1
|
||||||
alias: containousv1alpha1
|
|
||||||
- pkg: github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefikio/v1alpha1
|
|
||||||
alias: traefikv1alpha1
|
alias: traefikv1alpha1
|
||||||
- pkg: github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/generated/clientset/versioned
|
- pkg: github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned
|
||||||
alias: traefikclientset
|
alias: traefikclientset
|
||||||
- pkg: github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/generated/informers/externalversions
|
- pkg: github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/informers/externalversions
|
||||||
alias: traefikinformers
|
alias: traefikinformers
|
||||||
- pkg: github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/generated/clientset/versioned/scheme
|
- pkg: github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned/scheme
|
||||||
alias: traefikscheme
|
alias: traefikscheme
|
||||||
- pkg: github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/generated/clientset/versioned/fake
|
- pkg: github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/generated/clientset/versioned/fake
|
||||||
alias: traefikcrdfake
|
alias: traefikcrdfake
|
||||||
misspell:
|
misspell:
|
||||||
locale: US
|
locale: US
|
||||||
@ -214,6 +212,7 @@ linters:
|
|||||||
staticcheck:
|
staticcheck:
|
||||||
checks:
|
checks:
|
||||||
- all
|
- all
|
||||||
|
- '-SA1019'
|
||||||
- '-ST1000'
|
- '-ST1000'
|
||||||
- '-ST1003'
|
- '-ST1003'
|
||||||
- '-ST1016'
|
- '-ST1016'
|
||||||
@ -307,6 +306,16 @@ linters:
|
|||||||
text: 'SA1019: c.Providers.(ConsulCatalog|Consul|Nomad).Namespace is deprecated'
|
text: 'SA1019: c.Providers.(ConsulCatalog|Consul|Nomad).Namespace is deprecated'
|
||||||
- path: (.+)\.go$
|
- path: (.+)\.go$
|
||||||
text: 'SA1019: dockertypes.ContainerNode is deprecated'
|
text: 'SA1019: dockertypes.ContainerNode is deprecated'
|
||||||
|
- path: pkg/provider/kubernetes/crd/kubernetes.go
|
||||||
|
text: "Function 'loadConfigurationFromCRD' has too many statements"
|
||||||
|
linters:
|
||||||
|
- funlen
|
||||||
|
- path: pkg/plugins/middlewarewasm.go
|
||||||
|
text: 'the methods of "wasmMiddlewareBuilder" use pointer receiver and non-pointer receiver.'
|
||||||
|
linters:
|
||||||
|
- recvcheck
|
||||||
|
- path: pkg/proxy/httputil/bufferpool.go
|
||||||
|
text: 'SA6002: argument should be pointer-like to avoid allocations'
|
||||||
paths:
|
paths:
|
||||||
- pkg/provider/kubernetes/crd/generated/
|
- pkg/provider/kubernetes/crd/generated/
|
||||||
|
|
||||||
|
@ -14,7 +14,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:
|
||||||
|
1049
CHANGELOG.md
1049
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
12
Makefile
12
Makefile
@ -57,9 +57,9 @@ generate:
|
|||||||
binary: generate-webui dist
|
binary: generate-webui dist
|
||||||
@echo SHA: $(VERSION) $(CODENAME) $(DATE)
|
@echo SHA: $(VERSION) $(CODENAME) $(DATE)
|
||||||
CGO_ENABLED=0 GOGC=off GOOS=${GOOS} GOARCH=${GOARCH} go build ${FLAGS[*]} -ldflags "-s -w \
|
CGO_ENABLED=0 GOGC=off GOOS=${GOOS} GOARCH=${GOARCH} go build ${FLAGS[*]} -ldflags "-s -w \
|
||||||
-X github.com/traefik/traefik/v2/pkg/version.Version=$(VERSION) \
|
-X github.com/traefik/traefik/v3/pkg/version.Version=$(VERSION) \
|
||||||
-X github.com/traefik/traefik/v2/pkg/version.Codename=$(CODENAME) \
|
-X github.com/traefik/traefik/v3/pkg/version.Codename=$(CODENAME) \
|
||||||
-X github.com/traefik/traefik/v2/pkg/version.BuildDate=$(DATE)" \
|
-X github.com/traefik/traefik/v3/pkg/version.BuildDate=$(DATE)" \
|
||||||
-installsuffix nocgo -o "./dist/${GOOS}/${GOARCH}/$(BIN_NAME)" ./cmd/traefik
|
-installsuffix nocgo -o "./dist/${GOOS}/${GOARCH}/$(BIN_NAME)" ./cmd/traefik
|
||||||
|
|
||||||
binary-linux-arm64: export GOOS := linux
|
binary-linux-arm64: export GOOS := linux
|
||||||
@ -97,6 +97,12 @@ test-unit:
|
|||||||
test-integration: binary
|
test-integration: binary
|
||||||
GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./integration -test.timeout=20m -failfast -v $(TESTFLAGS)
|
GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./integration -test.timeout=20m -failfast -v $(TESTFLAGS)
|
||||||
|
|
||||||
|
.PHONY: test-gateway-api-conformance
|
||||||
|
#? test-gateway-api-conformance: Run the conformance tests
|
||||||
|
test-gateway-api-conformance: build-image-dirty
|
||||||
|
# In case of a new Minor/Major version, the k8sConformanceTraefikVersion needs to be updated.
|
||||||
|
GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./integration -v -test.run K8sConformanceSuite -k8sConformance -k8sConformanceTraefikVersion="v3.4" $(TESTFLAGS)
|
||||||
|
|
||||||
.PHONY: test-ui-unit
|
.PHONY: test-ui-unit
|
||||||
#? test-ui-unit: Run the unit tests for the webui
|
#? test-ui-unit: Run the unit tests for the webui
|
||||||
test-ui-unit:
|
test-ui-unit:
|
||||||
|
15
README.md
15
README.md
@ -15,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.
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -35,7 +35,8 @@ Pointing Traefik at your orchestrator should be the _only_ configuration step yo
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
:warning: Please be aware that the old configurations for Traefik v1.x are NOT compatible with the v2.x config as of now. If you're running v2, please ensure you are using a [v2 configuration](https://doc.traefik.io/traefik/).
|
:warning: When migrating to a new major version of Traefik, please refer to the [migration guide](https://doc.traefik.io/traefik/migration/v2-to-v3/) to ensure a smooth transition and to be aware of any breaking changes.
|
||||||
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@ -58,11 +59,11 @@ _(But if you'd rather configure some of your routes manually, Traefik supports t
|
|||||||
|
|
||||||
- Continuously updates its configuration (No restarts!)
|
- Continuously updates its configuration (No restarts!)
|
||||||
- Supports multiple load balancing algorithms
|
- Supports multiple load balancing algorithms
|
||||||
- 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
|
||||||
@ -72,8 +73,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)
|
|
||||||
- [ECS](https://doc.traefik.io/traefik/providers/ecs/)
|
- [ECS](https://doc.traefik.io/traefik/providers/ecs/)
|
||||||
- [File](https://doc.traefik.io/traefik/providers/file/)
|
- [File](https://doc.traefik.io/traefik/providers/file/)
|
||||||
|
|
||||||
@ -89,7 +88,7 @@ You can access the simple HTML frontend of Traefik.
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
You can find the complete documentation of Traefik v2 at [https://doc.traefik.io/traefik/](https://doc.traefik.io/traefik/).
|
You can find the complete documentation of Traefik v3 at [https://doc.traefik.io/traefik/](https://doc.traefik.io/traefik/).
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
|
@ -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/types.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/types.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
|
||||||
|
113
cmd/traefik/logger.go
Normal file
113
cmd/traefik/logger.go
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
stdlog "log"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"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"
|
||||||
|
"gopkg.in/natefinch/lumberjack.v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// hide the first logs before the setup of the logger.
|
||||||
|
zerolog.SetGlobalLevel(zerolog.ErrorLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setupLogger(staticConfiguration *static.Configuration) error {
|
||||||
|
// Validate that the experimental flag is set up at this point,
|
||||||
|
// rather than validating the static configuration before the setupLogger call.
|
||||||
|
// This ensures that validation messages are not logged using an un-configured logger.
|
||||||
|
if staticConfiguration.Log != nil && staticConfiguration.Log.OTLP != nil &&
|
||||||
|
(staticConfiguration.Experimental == nil || !staticConfiguration.Experimental.OTLPLogs) {
|
||||||
|
return errors.New("the experimental OTLPLogs feature must be enabled to use OTLP logging")
|
||||||
|
}
|
||||||
|
|
||||||
|
// configure log format
|
||||||
|
w := getLogWriter(staticConfiguration)
|
||||||
|
|
||||||
|
// configure log level
|
||||||
|
logLevel := getLogLevel(staticConfiguration)
|
||||||
|
zerolog.SetGlobalLevel(logLevel)
|
||||||
|
|
||||||
|
// create logger
|
||||||
|
logCtx := zerolog.New(w).With().Timestamp()
|
||||||
|
if logLevel <= zerolog.DebugLevel {
|
||||||
|
logCtx = logCtx.Caller()
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Logger = logCtx.Logger().Level(logLevel)
|
||||||
|
|
||||||
|
if staticConfiguration.Log != nil && staticConfiguration.Log.OTLP != nil {
|
||||||
|
var err error
|
||||||
|
log.Logger, err = logs.SetupOTelLogger(log.Logger, staticConfiguration.Log.OTLP)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("setting up OpenTelemetry logger: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
zerolog.DefaultContextLogger = &log.Logger
|
||||||
|
|
||||||
|
// 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))
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func getLogWriter(staticConfiguration *static.Configuration) io.Writer {
|
||||||
|
if staticConfiguration.Log != nil && staticConfiguration.Log.OTLP != nil {
|
||||||
|
return io.Discard
|
||||||
|
}
|
||||||
|
|
||||||
|
var w io.Writer = os.Stdout
|
||||||
|
if staticConfiguration.Log != nil && len(staticConfiguration.Log.FilePath) > 0 {
|
||||||
|
_, _ = os.OpenFile(staticConfiguration.Log.FilePath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o666)
|
||||||
|
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/"
|
||||||
|
@ -5,12 +5,13 @@ import (
|
|||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
stdlog "log"
|
stdlog "log"
|
||||||
|
"maps"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"slices"
|
||||||
"sort"
|
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
@ -18,39 +19,43 @@ import (
|
|||||||
"github.com/coreos/go-systemd/v22/daemon"
|
"github.com/coreos/go-systemd/v22/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/traefik"
|
"github.com/traefik/traefik/v3/pkg/provider/tailscale"
|
||||||
"github.com/traefik/traefik/v2/pkg/safe"
|
"github.com/traefik/traefik/v3/pkg/provider/traefik"
|
||||||
"github.com/traefik/traefik/v2/pkg/server"
|
"github.com/traefik/traefik/v3/pkg/proxy"
|
||||||
"github.com/traefik/traefik/v2/pkg/server/middleware"
|
"github.com/traefik/traefik/v3/pkg/proxy/httputil"
|
||||||
"github.com/traefik/traefik/v2/pkg/server/service"
|
"github.com/traefik/traefik/v3/pkg/safe"
|
||||||
traefiktls "github.com/traefik/traefik/v2/pkg/tls"
|
"github.com/traefik/traefik/v3/pkg/server"
|
||||||
"github.com/traefik/traefik/v2/pkg/tracing"
|
"github.com/traefik/traefik/v3/pkg/server/middleware"
|
||||||
"github.com/traefik/traefik/v2/pkg/tracing/jaeger"
|
"github.com/traefik/traefik/v3/pkg/server/service"
|
||||||
"github.com/traefik/traefik/v2/pkg/types"
|
"github.com/traefik/traefik/v3/pkg/tcp"
|
||||||
"github.com/traefik/traefik/v2/pkg/version"
|
traefiktls "github.com/traefik/traefik/v3/pkg/tls"
|
||||||
"github.com/vulcand/oxy/v2/roundrobin"
|
"github.com/traefik/traefik/v3/pkg/tracing"
|
||||||
|
"github.com/traefik/traefik/v3/pkg/types"
|
||||||
|
"github.com/traefik/traefik/v3/pkg/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// traefik config inits
|
// traefik config inits
|
||||||
tConfig := cmd.NewTraefikConfiguration()
|
tConfig := cmd.NewTraefikConfiguration()
|
||||||
|
|
||||||
loaders := []cli.ResourceLoader{&tcli.FileLoader{}, &tcli.FlagLoader{}, &tcli.EnvLoader{}}
|
loaders := []cli.ResourceLoader{&tcli.DeprecationLoader{}, &tcli.FileLoader{}, &tcli.FlagLoader{}, &tcli.EnvLoader{}}
|
||||||
|
|
||||||
cmdTraefik := &cli.Command{
|
cmdTraefik := &cli.Command{
|
||||||
Name: "traefik",
|
Name: "traefik",
|
||||||
@ -77,7 +82,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)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,27 +90,26 @@ Complete documentation is available at https://traefik.io`,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runCmd(staticConfiguration *static.Configuration) error {
|
func runCmd(staticConfiguration *static.Configuration) error {
|
||||||
configureLogging(staticConfiguration)
|
if err := setupLogger(staticConfiguration); err != nil {
|
||||||
|
return fmt.Errorf("setting up logger: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
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 {
|
||||||
@ -130,16 +134,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 {
|
||||||
@ -150,17 +154,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,9 +193,28 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
|
|
||||||
acmeProviders := initACMEProvider(staticConfiguration, providerAggregator, tlsManager, httpChallengeProvider, tlsChallengeProvider, routinesPool)
|
acmeProviders := initACMEProvider(staticConfiguration, providerAggregator, tlsManager, httpChallengeProvider, tlsChallengeProvider, routinesPool)
|
||||||
|
|
||||||
|
// Tailscale
|
||||||
|
|
||||||
|
tsProviders := initTailscaleProviders(staticConfiguration, providerAggregator)
|
||||||
|
|
||||||
|
// Observability
|
||||||
|
|
||||||
|
metricRegistries := registerMetricClients(staticConfiguration.Metrics)
|
||||||
|
var semConvMetricRegistry *metrics.SemConvMetricsRegistry
|
||||||
|
if staticConfiguration.Metrics != nil && staticConfiguration.Metrics.OTLP != nil {
|
||||||
|
semConvMetricRegistry, err = metrics.NewSemConvMetricRegistry(ctx, staticConfiguration.Metrics.OTLP)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("unable to create SemConv metric registry: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
metricsRegistry := metrics.NewMultiRegistry(metricRegistries)
|
||||||
|
accessLog := setupAccessLog(staticConfiguration.AccessLog)
|
||||||
|
tracer, tracerCloser := setupTracing(staticConfiguration.Tracing)
|
||||||
|
observabilityMgr := middleware.NewObservabilityMgr(*staticConfiguration, metricsRegistry, semConvMetricRegistry, accessLog, tracer, tracerCloser)
|
||||||
|
|
||||||
// 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
|
||||||
}
|
}
|
||||||
@ -201,19 +224,29 @@ 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.")
|
|
||||||
}
|
|
||||||
|
|
||||||
if staticConfiguration.API != nil {
|
if staticConfiguration.API != nil {
|
||||||
version.DisableDashboardAd = staticConfiguration.API.DisableDashboardAd
|
version.DisableDashboardAd = staticConfiguration.API.DisableDashboardAd
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
|
pluginLogger := log.Ctx(ctx).With().Logger()
|
||||||
|
hasPlugins := staticConfiguration.Experimental != nil && (staticConfiguration.Experimental.Plugins != nil || staticConfiguration.Experimental.LocalPlugins != nil)
|
||||||
|
if hasPlugins {
|
||||||
|
pluginsList := slices.Collect(maps.Keys(staticConfiguration.Experimental.Plugins))
|
||||||
|
pluginsList = append(pluginsList, slices.Collect(maps.Keys(staticConfiguration.Experimental.LocalPlugins))...)
|
||||||
|
|
||||||
|
pluginLogger = pluginLogger.With().Strs("plugins", pluginsList).Logger()
|
||||||
|
pluginLogger.Info().Msg("Loading plugins...")
|
||||||
|
}
|
||||||
|
|
||||||
pluginBuilder, err := createPluginBuilder(staticConfiguration)
|
pluginBuilder, err := createPluginBuilder(staticConfiguration)
|
||||||
|
if err != nil && staticConfiguration.Experimental != nil && staticConfiguration.Experimental.AbortOnPluginFailure {
|
||||||
|
return nil, fmt.Errorf("plugin: failed to create plugin builder: %w", err)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithoutContext().WithError(err).Error("Plugins are disabled because an error has occurred.")
|
pluginLogger.Err(err).Msg("Plugins are disabled because an error has occurred.")
|
||||||
|
} else if hasPlugins {
|
||||||
|
pluginLogger.Info().Msg("Plugins loaded.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Providers plugins
|
// Providers plugins
|
||||||
@ -234,24 +267,41 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.")
|
||||||
|
}
|
||||||
|
|
||||||
|
transportManager := service.NewTransportManager(spiffeX509Source)
|
||||||
|
|
||||||
|
var proxyBuilder service.ProxyBuilder = httputil.NewProxyBuilder(transportManager, semConvMetricRegistry)
|
||||||
|
if staticConfiguration.Experimental != nil && staticConfiguration.Experimental.FastProxy != nil {
|
||||||
|
proxyBuilder = proxy.NewSmartBuilder(transportManager, proxyBuilder, *staticConfiguration.Experimental.FastProxy)
|
||||||
|
}
|
||||||
|
|
||||||
|
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, observabilityMgr, transportManager, proxyBuilder, acmeHTTPHandler)
|
||||||
|
|
||||||
// Router factory
|
// Router factory
|
||||||
|
|
||||||
accessLog := setupAccessLog(staticConfiguration.AccessLog)
|
routerFactory := server.NewRouterFactory(*staticConfiguration, managerFactory, tlsManager, observabilityMgr, pluginBuilder, dialerManager)
|
||||||
tracer := setupTracing(staticConfiguration.Tracing)
|
|
||||||
|
|
||||||
chainBuilder := middleware.NewChainBuilder(metricsRegistry, accessLog, tracer)
|
|
||||||
routerFactory := server.NewRouterFactory(*staticConfiguration, managerFactory, tlsManager, chainBuilder, pluginBuilder, metricsRegistry)
|
|
||||||
|
|
||||||
// Watcher
|
// Watcher
|
||||||
|
|
||||||
@ -281,7 +331,9 @@ 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)
|
transportManager.Update(conf.HTTP.ServersTransports)
|
||||||
|
proxyBuilder.Update(conf.HTTP.ServersTransports)
|
||||||
|
dialerManager.Update(conf.TCP.ServersTransports)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Switch router
|
// Switch router
|
||||||
@ -301,13 +353,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 {
|
||||||
@ -316,12 +377,13 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := resolverNames[rt.TLS.CertResolver]; !ok {
|
if _, ok := resolverNames[rt.TLS.CertResolver]; !ok {
|
||||||
log.WithoutContext().Errorf("Router %s uses a nonexistent resolver: %s", rtName, rt.TLS.CertResolver)
|
log.Error().Err(err).Str(logs.RouterName, rtName).Str("certificateResolver", rt.TLS.CertResolver).
|
||||||
|
Msg("Router uses a nonexistent certificate resolver")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return server.NewServer(routinesPool, serverEntryPointsTCP, serverEntryPointsUDP, watcher, chainBuilder, accessLog), nil
|
return server.NewServer(routinesPool, serverEntryPointsTCP, serverEntryPointsUDP, watcher, observabilityMgr), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHTTPChallengeHandler(acmeProviders []*acme.Provider, httpChallengeProvider http.Handler) http.Handler {
|
func getHTTPChallengeHandler(acmeProviders []*acme.Provider, httpChallengeProvider http.Handler) http.Handler {
|
||||||
@ -337,11 +399,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 {
|
||||||
|
// By default all entrypoints are considered.
|
||||||
|
// If at least one is flagged, then only flagged entrypoints are included.
|
||||||
|
if hasDefinedDefaults && !cfg.AsDefault {
|
||||||
|
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 {
|
||||||
@ -349,7 +427,7 @@ func getDefaultsEntrypoints(staticConfiguration *static.Configuration) []string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Strings(defaultEntryPoints)
|
slices.Sort(defaultEntryPoints)
|
||||||
return defaultEntryPoints
|
return defaultEntryPoints
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +442,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, routinesPool *safe.Pool) []*acme.Provider {
|
func initACMEProvider(c *static.Configuration, providerAggregator *aggregator.ProviderAggregator, tlsManager *traefiktls.Manager, httpChallengeProvider, tlsChallengeProvider challenge.Provider, routinesPool *safe.Pool) []*acme.Provider {
|
||||||
localStores := map[string]*acme.LocalStore{}
|
localStores := map[string]*acme.LocalStore{}
|
||||||
|
|
||||||
@ -387,7 +465,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,6 +479,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
|
||||||
@ -409,42 +508,59 @@ 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.OTLP != nil {
|
||||||
|
logger := log.With().Str(logs.MetricsProviderName, "openTelemetry").Logger()
|
||||||
|
|
||||||
|
openTelemetryRegistry := metrics.RegisterOpenTelemetry(logger.WithContext(context.Background()), metricsConfig.OTLP)
|
||||||
|
if openTelemetryRegistry != nil {
|
||||||
|
registries = append(registries, openTelemetryRegistry)
|
||||||
|
logger.Debug().
|
||||||
|
Str("pushInterval", metricsConfig.OTLP.PushInterval.String()).
|
||||||
|
Msg("Configured OpenTelemetry metrics")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,7 +568,7 @@ func registerMetricClients(metricsConfig *types.Metrics) []metrics.Registry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func appendCertMetric(gauge gokitmetrics.Gauge, certificate *x509.Certificate) {
|
func appendCertMetric(gauge gokitmetrics.Gauge, certificate *x509.Certificate) {
|
||||||
sort.Strings(certificate.DNSNames)
|
slices.Sort(certificate.DNSNames)
|
||||||
|
|
||||||
labels := []string{
|
labels := []string{
|
||||||
"cn", certificate.Subject.CommonName,
|
"cn", certificate.Subject.CommonName,
|
||||||
@ -472,130 +588,25 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
return accessLoggerMiddleware
|
return accessLoggerMiddleware
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupTracing(conf *static.Tracing) *tracing.Tracing {
|
func setupTracing(conf *static.Tracing) (*tracing.Tracer, io.Closer) {
|
||||||
if conf == nil {
|
if conf == nil {
|
||||||
return nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var backend tracing.Backend
|
tracer, closer, err := tracing.NewTracing(conf)
|
||||||
|
|
||||||
if conf.Jaeger != nil {
|
|
||||||
backend = conf.Jaeger
|
|
||||||
}
|
|
||||||
|
|
||||||
if conf.Zipkin != nil {
|
|
||||||
if backend != nil {
|
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Zipkin backend.")
|
|
||||||
} else {
|
|
||||||
backend = conf.Zipkin
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if conf.Datadog != nil {
|
|
||||||
if backend != nil {
|
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Datadog backend.")
|
|
||||||
} else {
|
|
||||||
backend = conf.Datadog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if conf.Instana != nil {
|
|
||||||
if backend != nil {
|
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Instana backend.")
|
|
||||||
} else {
|
|
||||||
backend = conf.Instana
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if conf.Haystack != nil {
|
|
||||||
if backend != nil {
|
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Haystack backend.")
|
|
||||||
} else {
|
|
||||||
backend = conf.Haystack
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if conf.Elastic != nil {
|
|
||||||
if backend != nil {
|
|
||||||
log.WithoutContext().Error("Multiple tracing backend are not supported: cannot create Elastic backend.")
|
|
||||||
} else {
|
|
||||||
backend = conf.Elastic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if backend == nil {
|
|
||||||
log.WithoutContext().Debug("Could not initialize tracing, using Jaeger by default")
|
|
||||||
defaultBackend := &jaeger.Config{}
|
|
||||||
defaultBackend.SetDefaults()
|
|
||||||
backend = defaultBackend
|
|
||||||
}
|
|
||||||
|
|
||||||
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, nil
|
||||||
}
|
|
||||||
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)
|
return tracer, closer
|
||||||
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() {
|
||||||
@ -608,16 +619,16 @@ func checkNewVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func stats(staticConfiguration *static.Configuration) {
|
func stats(staticConfiguration *static.Configuration) {
|
||||||
logger := log.WithoutContext()
|
logger := log.With().Logger()
|
||||||
|
|
||||||
if staticConfiguration.Global.SendAnonymousUsage {
|
if staticConfiguration.Global.SendAnonymousUsage {
|
||||||
logger.Info(`Stats collection is enabled.`)
|
logger.Info().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.Info().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.Info().Msg(`Help us improve Traefik by leaving this feature on :)`)
|
||||||
logger.Info(`More details on: https://doc.traefik.io/traefik/contributing/data-collection/`)
|
logger.Info().Msg(`More details on: https://doc.traefik.io/traefik/contributing/data-collection/`)
|
||||||
collect(staticConfiguration)
|
collect(staticConfiguration)
|
||||||
} else {
|
} else {
|
||||||
logger.Info(`
|
logger.Info().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/
|
||||||
@ -630,7 +641,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.
|
||||||
@ -113,3 +114,73 @@ 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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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: 452 KiB After Width: | Height: | Size: 1010 KiB |
@ -66,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
|
||||||
@ -86,7 +85,6 @@ providers:
|
|||||||
docker:
|
docker:
|
||||||
endpoint: "xxxx"
|
endpoint: "xxxx"
|
||||||
exposedByDefault: true
|
exposedByDefault: true
|
||||||
swarmMode: true
|
|
||||||
|
|
||||||
tls:
|
tls:
|
||||||
ca: xxxx
|
ca: xxxx
|
||||||
|
@ -15,7 +15,7 @@ Let's see how.
|
|||||||
|
|
||||||
### General
|
### General
|
||||||
|
|
||||||
This [documentation](https://doc.traefik.io/traefik/ "Link to the official Traefik documentation") is built with [MkDocs](https://mkdocs.org/ "Link to the website of MkDocs").
|
This [documentation](../../ "Link to the official Traefik documentation") is built with [MkDocs](https://mkdocs.org/ "Link to the website of MkDocs").
|
||||||
|
|
||||||
### Method 1: `Docker` and `make`
|
### Method 1: `Docker` and `make`
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ description: "Traefik Proxy is an open source software with a thriving community
|
|||||||
* Landry Benguigui [@lbenguigui](https://github.com/lbenguigui)
|
* Landry Benguigui [@lbenguigui](https://github.com/lbenguigui)
|
||||||
* Simon Delicata [@sdelicata](https://github.com/sdelicata)
|
* Simon Delicata [@sdelicata](https://github.com/sdelicata)
|
||||||
* Baptiste Mayelle [@youkoulayley](https://github.com/youkoulayley)
|
* Baptiste Mayelle [@youkoulayley](https://github.com/youkoulayley)
|
||||||
|
* Jesper Noordsij [@jnoordsij](https://github.com/jnoordsij)
|
||||||
|
|
||||||
## Past Maintainers
|
## Past Maintainers
|
||||||
|
|
||||||
|
@ -91,6 +91,8 @@ You must run these local verifications before you submit your pull request to pr
|
|||||||
Your PR will not be reviewed until these are green on the CI.
|
Your PR will not be reviewed until these are green on the CI.
|
||||||
|
|
||||||
* `make generate`
|
* `make generate`
|
||||||
|
* `make generate-crd`
|
||||||
|
* `make test-gateway-api-conformance`
|
||||||
* `make validate`
|
* `make validate`
|
||||||
* `make pull-images`
|
* `make pull-images`
|
||||||
* `make test`
|
* `make test`
|
||||||
|
@ -2,43 +2,19 @@
|
|||||||
|
|
||||||
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 Ingress API Version `networking.k8s.io/v1beta1`](#kubernetes-ingress-api-version-networkingk8siov1beta1) | N/A | N/A | 3.0 |
|
||||||
| [Consul Enterprise Namespace](#consul-enterprise-namespace) | 2.8 | N/A | 3.0 |
|
| [CRD API Version `apiextensions.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 |
|
|
||||||
| [Nomad Namespace](#nomad-namespace) | 2.10 | N/A | 3.0 |
|
|
||||||
| [Kubernetes CRDs API Group `traefik.containo.us`](#kubernetes-crd-provider-api-group-traefikcontainous) | 2.10 | N/A | 3.0 |
|
|
||||||
| [Kubernetes CRDs API Version `traefik.io/v1alpha1`](#kubernetes-crd-provider-api-version-traefikiov1alpha1) | 3.0 | N/A | 4.0 |
|
|
||||||
|
|
||||||
## Impact
|
## Impact
|
||||||
|
|
||||||
### Pilot
|
### Kubernetes Ingress API Version `networking.k8s.io/v1beta1`
|
||||||
|
|
||||||
Metrics will continue to function normally up to 2.8, when they will be disabled.
|
The Kubernetes Ingress API Version `networking.k8s.io/v1beta1` support is removed in v3.
|
||||||
In 2.9, the Pilot platform and all Traefik integration code will be permanently removed.
|
Please use the API Group `networking.k8s.io/v1` instead.
|
||||||
|
|
||||||
Starting on 2.7 the pilot token will not be a requirement anymore for plugins.
|
### Traefik CRD Definitions API Version `apiextensions.k8s.io/v1beta1`
|
||||||
Since 2.8, a [new plugin catalog](https://plugins.traefik.io) is available, decoupled from Pilot.
|
|
||||||
|
|
||||||
### Consul Enterprise Namespace
|
The Traefik CRD definitions API Version `apiextensions.k8s.io/v1beta1` support is removed in v3.
|
||||||
|
Please use the API Group `apiextensions.k8s.io/v1` instead.
|
||||||
Starting on 2.8 the `namespace` option of Consul and Consul Catalog providers is deprecated,
|
|
||||||
please use the `namespaces` options instead.
|
|
||||||
|
|
||||||
### TLS 1.0 and 1.1
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
### Nomad Namespace
|
|
||||||
|
|
||||||
Starting on 2.10 the `namespace` option of the Nomad provider is deprecated,
|
|
||||||
please use the `namespaces` options instead.
|
|
||||||
|
|
||||||
### Kubernetes CRD Provider API Group `traefik.containo.us`
|
|
||||||
|
|
||||||
In v2.10, the Kubernetes CRD provider API Group `traefik.containo.us` is deprecated, and its support will end starting with Traefik v3. Please use the API Group `traefik.io` instead.
|
|
||||||
|
|
||||||
### Kubernetes CRD Provider API Version `traefik.io/v1alpha1`
|
|
||||||
|
|
||||||
The Kubernetes CRD provider API Version `traefik.io/v1alpha1` will subsequently be deprecated in Traefik v3. The next version will be `traefik.io/v1`.
|
|
||||||
|
@ -79,7 +79,7 @@ traefik --help
|
|||||||
# or
|
# or
|
||||||
|
|
||||||
docker run traefik[:version] --help
|
docker run traefik[:version] --help
|
||||||
# ex: docker run traefik:v2.11 --help
|
# ex: docker run traefik:v3.4 --help
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the [CLI reference](../reference/static-configuration/cli.md "Link to CLI reference overview") for an overview about all available arguments.
|
Check the [CLI reference](../reference/static-configuration/cli.md "Link to CLI reference overview") for an overview about all available arguments.
|
||||||
|
@ -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.11/traefik.sample.yml)
|
* [YAML](https://raw.githubusercontent.com/traefik/traefik/v3.4/traefik.sample.yml)
|
||||||
* [TOML](https://raw.githubusercontent.com/traefik/traefik/v2.11/traefik.sample.toml)
|
* [TOML](https://raw.githubusercontent.com/traefik/traefik/v3.4/traefik.sample.toml)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
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.11
|
-v $PWD/traefik.yml:/etc/traefik/traefik.yml traefik:v3.4
|
||||||
```
|
```
|
||||||
|
|
||||||
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.11`
|
ex: `traefik:v3.4`
|
||||||
* 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.
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ 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.16+
|
* Kubernetes 1.22+
|
||||||
* Helm version 3.9+ is [installed](https://helm.sh/docs/intro/install/)
|
* Helm version 3.9+ is [installed](https://helm.sh/docs/intro/install/)
|
||||||
|
|
||||||
Add Traefik Labs chart repository to Helm:
|
Add Traefik Labs chart repository to Helm:
|
||||||
|
@ -35,12 +35,19 @@ rules:
|
|||||||
- ""
|
- ""
|
||||||
resources:
|
resources:
|
||||||
- services
|
- services
|
||||||
- endpoints
|
|
||||||
- secrets
|
- secrets
|
||||||
|
- nodes
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- discovery.k8s.io
|
||||||
|
resources:
|
||||||
|
- endpointslices
|
||||||
|
verbs:
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- extensions
|
- extensions
|
||||||
- networking.k8s.io
|
- networking.k8s.io
|
||||||
@ -60,7 +67,6 @@ rules:
|
|||||||
- update
|
- update
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- traefik.io
|
- traefik.io
|
||||||
- traefik.containo.us
|
|
||||||
resources:
|
resources:
|
||||||
- middlewares
|
- middlewares
|
||||||
- middlewaretcps
|
- middlewaretcps
|
||||||
@ -71,6 +77,7 @@ rules:
|
|||||||
- tlsoptions
|
- tlsoptions
|
||||||
- tlsstores
|
- tlsstores
|
||||||
- serverstransports
|
- serverstransports
|
||||||
|
- serverstransporttcps
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
@ -147,7 +154,7 @@ spec:
|
|||||||
serviceAccountName: traefik-account
|
serviceAccountName: traefik-account
|
||||||
containers:
|
containers:
|
||||||
- name: traefik
|
- name: traefik
|
||||||
image: traefik:v2.11
|
image: traefik:v3.4
|
||||||
args:
|
args:
|
||||||
- --api.insecure
|
- --api.insecure
|
||||||
- --providers.kubernetesingress
|
- --providers.kubernetesingress
|
||||||
|
@ -19,8 +19,8 @@ version: '3'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
reverse-proxy:
|
reverse-proxy:
|
||||||
# The official v2 Traefik docker image
|
# The official v3 Traefik docker image
|
||||||
image: traefik:v2.11
|
image: traefik:v3.4
|
||||||
# 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:
|
||||||
@ -71,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, you're using curl)
|
When Traefik detects new services, it creates the corresponding routes, so you can call them ... _let's see!_ (Here, you'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
|
||||||
@ -95,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:
|
||||||
|
|
||||||
|
@ -250,6 +250,34 @@ when using the `HTTP-01` challenge, `certificatesresolvers.myresolver.acme.httpc
|
|||||||
!!! info ""
|
!!! info ""
|
||||||
Redirection is fully compatible with the `HTTP-01` challenge.
|
Redirection is fully compatible with the `HTTP-01` challenge.
|
||||||
|
|
||||||
|
#### `Delay`
|
||||||
|
|
||||||
|
The delay between the creation of the challenge and the validation.
|
||||||
|
A value lower than or equal to zero means no delay.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
httpChallenge:
|
||||||
|
# ...
|
||||||
|
delay: 12
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
[certificatesResolvers.myresolver.acme.httpChallenge]
|
||||||
|
# ...
|
||||||
|
delay = 12
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.httpchallenge.delay=12
|
||||||
|
```
|
||||||
|
|
||||||
### `dnsChallenge`
|
### `dnsChallenge`
|
||||||
|
|
||||||
Use the `DNS-01` challenge to generate and renew ACME certificates by provisioning a DNS record.
|
Use the `DNS-01` challenge to generate and renew ACME certificates by provisioning a DNS record.
|
||||||
@ -507,11 +535,11 @@ certificatesResolvers:
|
|||||||
--certificatesresolvers.myresolver.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53
|
--certificatesresolvers.myresolver.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `delayBeforeCheck`
|
#### `propagation.delayBeforeChecks`
|
||||||
|
|
||||||
By default, the `provider` verifies the TXT record _before_ letting ACME verify.
|
By default, the `provider` verifies the TXT record _before_ letting ACME verify.
|
||||||
|
|
||||||
You can delay this operation by specifying a delay (in seconds) with `delayBeforeCheck` (value must be greater than zero).
|
You can delay this operation by specifying a delay (in seconds) with `delayBeforeChecks` (value must be greater than zero).
|
||||||
|
|
||||||
This option is useful when internal networks block external DNS queries.
|
This option is useful when internal networks block external DNS queries.
|
||||||
|
|
||||||
@ -522,7 +550,9 @@ certificatesResolvers:
|
|||||||
# ...
|
# ...
|
||||||
dnsChallenge:
|
dnsChallenge:
|
||||||
# ...
|
# ...
|
||||||
delayBeforeCheck: 2s
|
propagation:
|
||||||
|
# ...
|
||||||
|
delayBeforeChecks: 2s
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
@ -530,19 +560,21 @@ certificatesResolvers:
|
|||||||
# ...
|
# ...
|
||||||
[certificatesResolvers.myresolver.acme.dnsChallenge]
|
[certificatesResolvers.myresolver.acme.dnsChallenge]
|
||||||
# ...
|
# ...
|
||||||
delayBeforeCheck = "2s"
|
[certificatesResolvers.myresolver.acme.dnsChallenge.propagation]
|
||||||
|
# ...
|
||||||
|
delayBeforeChecks = "2s"
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash tab="CLI"
|
```bash tab="CLI"
|
||||||
# ...
|
# ...
|
||||||
--certificatesresolvers.myresolver.acme.dnschallenge.delayBeforeCheck=2s
|
--certificatesresolvers.myresolver.acme.dnschallenge.propagation.delayBeforeChecks=2s
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `disablePropagationCheck`
|
#### `propagation.disableChecks`
|
||||||
|
|
||||||
**Not recommended**
|
Disables the challenge TXT record propagation checks, before notifying ACME that the DNS challenge is ready.
|
||||||
|
|
||||||
Disable the TXT records propagation checks before notifying ACME that the DNS challenge is ready.
|
Please note that disabling checks can prevent the challenge from succeeding.
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
certificatesResolvers:
|
certificatesResolvers:
|
||||||
@ -551,7 +583,9 @@ certificatesResolvers:
|
|||||||
# ...
|
# ...
|
||||||
dnsChallenge:
|
dnsChallenge:
|
||||||
# ...
|
# ...
|
||||||
disablePropagationCheck: true
|
propagation:
|
||||||
|
# ...
|
||||||
|
disableChecks: true
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
@ -559,12 +593,90 @@ certificatesResolvers:
|
|||||||
# ...
|
# ...
|
||||||
[certificatesResolvers.myresolver.acme.dnsChallenge]
|
[certificatesResolvers.myresolver.acme.dnsChallenge]
|
||||||
# ...
|
# ...
|
||||||
disablePropagationCheck = true
|
[certificatesResolvers.myresolver.acme.dnsChallenge.propagation]
|
||||||
|
# ...
|
||||||
|
disableChecks = true
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash tab="CLI"
|
```bash tab="CLI"
|
||||||
# ...
|
# ...
|
||||||
--certificatesresolvers.myresolver.acme.dnschallenge.disablePropagationCheck=true
|
--certificatesresolvers.myresolver.acme.dnschallenge.propagation.disableChecks=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `propagation.requireAllRNS`
|
||||||
|
|
||||||
|
Requires the challenge TXT record to be propagated to all recursive nameservers.
|
||||||
|
|
||||||
|
!!! note
|
||||||
|
|
||||||
|
If you have disabled authoritative nameservers checks (with `propagation.disableANSChecks`),
|
||||||
|
it is recommended to check all recursive nameservers instead.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
dnsChallenge:
|
||||||
|
# ...
|
||||||
|
propagation:
|
||||||
|
# ...
|
||||||
|
requireAllRNS: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
[certificatesResolvers.myresolver.acme.dnsChallenge]
|
||||||
|
# ...
|
||||||
|
[certificatesResolvers.myresolver.acme.dnsChallenge.propagation]
|
||||||
|
# ...
|
||||||
|
requireAllRNS = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.dnschallenge.propagation.requireAllRNS=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `propagation.disableANSChecks`
|
||||||
|
|
||||||
|
Disables the challenge TXT record propagation checks against authoritative nameservers.
|
||||||
|
|
||||||
|
This option will skip the propagation check against the nameservers of the authority (SOA).
|
||||||
|
|
||||||
|
It should be used only if the nameservers of the authority are not reachable.
|
||||||
|
|
||||||
|
!!! note
|
||||||
|
|
||||||
|
If you have disabled authoritative nameservers checks,
|
||||||
|
it is recommended to check all recursive nameservers instead.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
dnsChallenge:
|
||||||
|
# ...
|
||||||
|
propagation:
|
||||||
|
# ...
|
||||||
|
disableANSChecks: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
[certificatesResolvers.myresolver.acme.dnsChallenge]
|
||||||
|
# ...
|
||||||
|
[certificatesResolvers.myresolver.acme.dnsChallenge.propagation]
|
||||||
|
# ...
|
||||||
|
disableANSChecks = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.dnschallenge.propagation.disableANSChecks=true
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Wildcard Domains
|
#### Wildcard Domains
|
||||||
@ -694,6 +806,7 @@ It defaults to `2160` (90 days) to follow Let's Encrypt certificates' duration.
|
|||||||
|----------------------|-------------------|-------------------------|
|
|----------------------|-------------------|-------------------------|
|
||||||
| >= 1 year | 4 months | 1 week |
|
| >= 1 year | 4 months | 1 week |
|
||||||
| >= 90 days | 30 days | 1 day |
|
| >= 90 days | 30 days | 1 day |
|
||||||
|
| >= 30 days | 10 days | 12 hours |
|
||||||
| >= 7 days | 1 day | 1 hour |
|
| >= 7 days | 1 day | 1 hour |
|
||||||
| >= 24 hours | 6 hours | 10 min |
|
| >= 24 hours | 6 hours | 10 min |
|
||||||
| < 24 hours | 20 min | 1 min |
|
| < 24 hours | 20 min | 1 min |
|
||||||
@ -722,6 +835,71 @@ certificatesResolvers:
|
|||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `clientTimeout`
|
||||||
|
|
||||||
|
_Optional, Default=2m_
|
||||||
|
|
||||||
|
`clientTimeout` is the total timeout for a complete HTTP transaction (including TCP connection, sending request and receiving response) with the ACME server.
|
||||||
|
It defaults to 2 minutes.
|
||||||
|
|
||||||
|
!!! warning "This timeout encompasses the entire request-response cycle, including the response headers timeout. It must be at least `clientResponseHeaderTimeout`, otherwise the certificate resolver will fail to start."
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
clientTimeout: 1m
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
clientTimeout=1m
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.clientTimeout=1m
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning
|
||||||
|
This should not be confused with any timeouts used for validating challenges.
|
||||||
|
|
||||||
|
### `clientResponseHeaderTimeout`
|
||||||
|
|
||||||
|
_Optional, Default=30s_
|
||||||
|
|
||||||
|
`clientResponseHeaderTimeout` defines how long the HTTP client waits for response headers when communicating with the `caServer`.
|
||||||
|
It defaults to 30 seconds.
|
||||||
|
|
||||||
|
!!! warning "It must be lower than `clientTimeout`, otherwise the certificate resolver will fail to start."
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
clientResponseHeaderTimeout: 1m
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
clientResponseHeaderTimeout=1m
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.clientResponseHeaderTimeout=1m
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
### `preferredChain`
|
### `preferredChain`
|
||||||
|
|
||||||
_Optional, Default=""_
|
_Optional, Default=""_
|
||||||
@ -753,6 +931,66 @@ certificatesResolvers:
|
|||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `profile`
|
||||||
|
|
||||||
|
_Optional, Default=""_
|
||||||
|
|
||||||
|
Certificate profile to use.
|
||||||
|
|
||||||
|
For more information, please check out the [Let's Encrypt blog post](https://letsencrypt.org/2025/01/09/acme-profiles/) about certificate profile selection.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
profile: tlsserver
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
profile = "tlsserver"
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.profile=tlsserver
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
### `emailAddresses`
|
||||||
|
|
||||||
|
_Optional, Default=""_
|
||||||
|
|
||||||
|
CSR email addresses to use.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
emailAddresses:
|
||||||
|
- foo@example.com
|
||||||
|
- bar@example.org
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
emailAddresses = ["foo@example.com", "bar@example.org"]
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.emailaddresses=foo@example.com,bar@example.org
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
### `keyType`
|
### `keyType`
|
||||||
|
|
||||||
_Optional, Default="RSA4096"_
|
_Optional, Default="RSA4096"_
|
||||||
@ -781,6 +1019,109 @@ certificatesResolvers:
|
|||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `caCertificates`
|
||||||
|
|
||||||
|
_Optional, Default=[]_
|
||||||
|
|
||||||
|
The `caCertificates` option specifies the paths to PEM encoded CA Certificates that can be used to authenticate an ACME server with an HTTPS certificate not issued by a CA in the system-wide trusted root list.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
caCertificates:
|
||||||
|
- path/certificates1.pem
|
||||||
|
- path/certificates2.pem
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
caCertificates = [ "path/certificates1.pem", "path/certificates2.pem" ]
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.caCertificates="path/certificates1.pem,path/certificates2.pem"
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
??? note "LEGO Environment Variable"
|
||||||
|
|
||||||
|
It can be defined globally by using the environment variable `LEGO_CA_CERTIFICATES`.
|
||||||
|
This environment variable is neither a fallback nor an override of the configuration option.
|
||||||
|
|
||||||
|
### `caSystemCertPool`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
The `caSystemCertPool` option defines if the certificates pool must use a copy of the system cert pool.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
caSystemCertPool: true
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
caSystemCertPool = true
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.caSystemCertPool=true
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
??? note "LEGO Environment Variable"
|
||||||
|
|
||||||
|
It can be defined globally by using the environment variable `LEGO_CA_SYSTEM_CERT_POOL`.
|
||||||
|
`LEGO_CA_SYSTEM_CERT_POOL` is ignored if `LEGO_CA_CERTIFICATES` is not set or empty.
|
||||||
|
This environment variable is neither a fallback nor an override of the configuration option.
|
||||||
|
|
||||||
|
### `caServerName`
|
||||||
|
|
||||||
|
_Optional, Default=""_
|
||||||
|
|
||||||
|
The `caServerName` option specifies the CA server name that can be used to authenticate an ACME server with an HTTPS certificate not issued by a CA in the system-wide trusted root list.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
certificatesResolvers:
|
||||||
|
myresolver:
|
||||||
|
acme:
|
||||||
|
# ...
|
||||||
|
caServerName: "my-server"
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[certificatesResolvers.myresolver.acme]
|
||||||
|
# ...
|
||||||
|
caServerName = "my-server"
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# ...
|
||||||
|
--certificatesresolvers.myresolver.acme.caServerName="my-server"
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
??? note "LEGO Environment Variable"
|
||||||
|
|
||||||
|
It can be defined globally by using the environment variable `LEGO_CA_SERVER_NAME`.
|
||||||
|
`LEGO_CA_SERVER_NAME` is ignored if `LEGO_CA_CERTIFICATES` is not set or empty.
|
||||||
|
This environment variable is neither a fallback nor an override of the configuration option.
|
||||||
|
|
||||||
## Fallback
|
## Fallback
|
||||||
|
|
||||||
If Let's Encrypt is not reachable, the following certificates will apply:
|
If Let's Encrypt is not reachable, the following certificates will apply:
|
||||||
|
@ -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`)
|
||||||
@ -9,18 +9,6 @@ labels:
|
|||||||
- traefik.http.routers.blog.tls.domains[0].sans=*.example.org
|
- traefik.http.routers.blog.tls.domains[0].sans=*.example.org
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Docker (Swarm)"
|
|
||||||
## Dynamic configuration
|
|
||||||
deploy:
|
|
||||||
labels:
|
|
||||||
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
|
||||||
- traefik.http.services.blog-svc.loadbalancer.server.port=8080"
|
|
||||||
- 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.org
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
@ -43,27 +31,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.org",
|
|
||||||
"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.com
|
|
||||||
- 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`)
|
||||||
@ -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`)
|
||||||
@ -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:
|
||||||
|
@ -30,6 +30,20 @@
|
|||||||
#
|
#
|
||||||
# certificatesDuration=2160
|
# certificatesDuration=2160
|
||||||
|
|
||||||
|
# Timeout for a complete HTTP transaction with the ACME server.
|
||||||
|
#
|
||||||
|
# Optional
|
||||||
|
# Default: 2m
|
||||||
|
#
|
||||||
|
# clientTimeout="2m"
|
||||||
|
|
||||||
|
# Timeout for receiving the response headers when communicating with the ACME server.
|
||||||
|
#
|
||||||
|
# Optional
|
||||||
|
# Default: 30s
|
||||||
|
#
|
||||||
|
# clientResponseHeaderTimeout="30s"
|
||||||
|
|
||||||
# Preferred chain to use.
|
# Preferred chain to use.
|
||||||
#
|
#
|
||||||
# If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name.
|
# If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name.
|
||||||
|
@ -29,6 +29,20 @@
|
|||||||
#
|
#
|
||||||
--certificatesresolvers.myresolver.acme.certificatesDuration=2160
|
--certificatesresolvers.myresolver.acme.certificatesDuration=2160
|
||||||
|
|
||||||
|
# Timeout for a complete HTTP transaction with the ACME server.
|
||||||
|
#
|
||||||
|
# Optional
|
||||||
|
# Default: 2m
|
||||||
|
#
|
||||||
|
--certificatesresolvers.myresolver.acme.clientTimeout=2m
|
||||||
|
|
||||||
|
# Timeout for receiving the response headers when communicating with the ACME server.
|
||||||
|
#
|
||||||
|
# Optional
|
||||||
|
# Default: 30s
|
||||||
|
#
|
||||||
|
--certificatesresolvers.myresolver.acme.clientResponseHeaderTimeout=30s
|
||||||
|
|
||||||
# Preferred chain to use.
|
# Preferred chain to use.
|
||||||
#
|
#
|
||||||
# If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name.
|
# If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name.
|
||||||
|
@ -32,6 +32,20 @@ certificatesResolvers:
|
|||||||
#
|
#
|
||||||
# certificatesDuration: 2160
|
# certificatesDuration: 2160
|
||||||
|
|
||||||
|
# Timeout for a complete HTTP transaction with the ACME server.
|
||||||
|
#
|
||||||
|
# Optional
|
||||||
|
# Default: 2m
|
||||||
|
#
|
||||||
|
# clientTimeout: "2m"
|
||||||
|
|
||||||
|
# Timeout for receiving the response headers when communicating with the ACME server.
|
||||||
|
#
|
||||||
|
# Optional
|
||||||
|
# Default: 30s
|
||||||
|
#
|
||||||
|
# clientResponseHeaderTimeout: "30s"
|
||||||
|
|
||||||
# Preferred chain to use.
|
# Preferred chain to use.
|
||||||
#
|
#
|
||||||
# If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name.
|
# If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name.
|
||||||
|
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.
|
@ -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.
|
||||||
@ -561,4 +553,38 @@ spec:
|
|||||||
clientAuthType: RequireAndVerifyClientCert
|
clientAuthType: RequireAndVerifyClientCert
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Disable Session Tickets
|
||||||
|
|
||||||
|
_Optional, Default="false"_
|
||||||
|
|
||||||
|
When set to true, Traefik disables the use of session tickets, forcing every client to perform a full TLS handshake instead of resuming sessions.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
# Dynamic configuration
|
||||||
|
|
||||||
|
tls:
|
||||||
|
options:
|
||||||
|
default:
|
||||||
|
disableSessionTickets: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
# Dynamic configuration
|
||||||
|
|
||||||
|
[tls.options]
|
||||||
|
[tls.options.default]
|
||||||
|
disableSessionTickets = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: TLSOption
|
||||||
|
metadata:
|
||||||
|
name: default
|
||||||
|
namespace: default
|
||||||
|
|
||||||
|
spec:
|
||||||
|
disableSessionTickets: true
|
||||||
|
```
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
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 older versions.
|
@ -1,28 +1,53 @@
|
|||||||
---
|
---
|
||||||
title: "Traefik Proxy Documentation"
|
title: "Traefik Proxy Documentation"
|
||||||
description: "Traefik Proxy, an open source Edge Router, auto-discovers configurations and supports major orchestrators, like Kubernetes. Read the technical documentation."
|
description: "Traefik Proxy, an open-source Edge Router, auto-discovers configurations and supports major orchestrators, like Kubernetes. Read the technical documentation."
|
||||||
---
|
---
|
||||||
|
|
||||||
# Welcome
|
# What is Traefik?
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Traefik is an [open-source](https://github.com/traefik/traefik) *Application Proxy* that makes publishing your services a fun and easy experience.
|
Traefik is an [open-source](https://github.com/traefik/traefik) *Application Proxy* that makes publishing your services a fun and easy experience.
|
||||||
It receives requests on behalf of your system and identifies which components are responsible for handling them, and routes them securely.
|
It receives requests on behalf of your system, identifies which components are responsible for handling them, and routes them securely.
|
||||||
|
|
||||||
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 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 Swarm, AWS, and [the list goes on](./reference/install-configuration/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.
|
||||||
|
|
||||||
And if your needs change, you can add API gateway and API management capabilities seamlessly to your existing Traefik deployments. It takes less than a minute, there’s no rip-and-replace, and all your configurations are preserved. See this in action in [our API gateway demo video](https://info.traefik.io/watch-traefik-api-gw-demo?cta=docs).
|
And if your needs change, you can add API gateway and API management capabilities seamlessly to your existing Traefik deployments. It takes less than a minute, there’s no rip-and-replace, and all your configurations are preserved. See this in action in [our API gateway demo video](https://info.traefik.io/watch-traefik-api-gw-demo?cta=docs).
|
||||||
|
|
||||||
Developing Traefik, our main goal is to make it effortless to use, and we're sure you'll enjoy it.
|
!!! quote "From the Traefik Maintainer Team"
|
||||||
|
When developing Traefik, our main goal is to make it easy to use, and we're sure you'll enjoy it.
|
||||||
|
|
||||||
-- The Traefik Maintainer Team
|
## Personas
|
||||||
|
|
||||||
|
Traefik supports different needs depending on your background. We keep three user personas in mind as we build and organize these docs:
|
||||||
|
|
||||||
|
- **Beginners**: You are new to Traefik or new to reverse proxies. You want simple, guided steps to set things up without diving too deep into advanced topics.
|
||||||
|
- **DevOps Engineers**: You manage infrastructure or clusters (Docker, Kubernetes, or other orchestrators). You integrate Traefik into your environment and value reliability, performance, and streamlined deployments.
|
||||||
|
- **Developers**: You create and deploy applications or APIs. You focus on how to expose your services through Traefik, apply routing rules, and integrate it with your development workflow.
|
||||||
|
|
||||||
|
## Core Concepts
|
||||||
|
|
||||||
|
Traefik’s main concepts help you understand how requests flow to your services:
|
||||||
|
|
||||||
|
- [Entrypoints](./reference/install-configuration/entrypoints.md) are the network entry points into Traefik. They define the port that will receive the packets and whether to listen for TCP or UDP.
|
||||||
|
- [Routers](./reference/routing-configuration/http/router/rules-and-priority.md) are in charge of connecting incoming requests to the services that can handle them. In the process, routers may use pieces of [middleware](./reference/routing-configuration/http/middlewares/overview.md) to update the request or act before forwarding the request to the service.
|
||||||
|
- [Services](./reference/routing-configuration/http/load-balancing/service.md) are responsible for configuring how to reach the actual services that will eventually handle the incoming requests.
|
||||||
|
- [Providers](./reference/install-configuration/providers/overview.md) are infrastructure components, whether orchestrators, container engines, cloud providers, or key-value stores. The idea is that Traefik queries the provider APIs in order to find relevant information about routing, and when Traefik detects a change, it dynamically updates the routes.
|
||||||
|
|
||||||
|
These concepts work together to manage your traffic from the moment a request arrives until it reaches your application.
|
||||||
|
|
||||||
|
## How to Use the Documentation
|
||||||
|
|
||||||
|
- **Navigation**: Each main section focuses on a specific stage of working with Traefik - installing, exposing services, observing, extending & migrating.
|
||||||
|
Use the sidebar to navigate to the section that is most appropriate for your needs.
|
||||||
|
- **Practical Examples**: You will see code snippets and configuration examples for different environments (YAML/TOML, Labels, & Tags).
|
||||||
|
- **Reference**: When you need to look up technical details, our reference section provides a deep dive into configuration options and key terms.
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
|
|
||||||
|
@ -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"
|
||||||
@ -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 grants access to services to authorized users only.
|
|||||||
|
|
||||||
## 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.
|
||||||
@ -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.
|
||||||
@ -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,7 +177,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +233,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +270,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +309,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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:
|
||||||
@ -404,4 +341,5 @@ http:
|
|||||||
[http.middlewares.test-auth.basicAuth]
|
[http.middlewares.test-auth.basicAuth]
|
||||||
removeHeader = true
|
removeHeader = true
|
||||||
```
|
```
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
@ -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"
|
||||||
@ -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,7 +66,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +105,7 @@ _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"
|
||||||
```
|
```
|
||||||
@ -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,7 +146,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +185,7 @@ _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"
|
||||||
```
|
```
|
||||||
@ -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,7 +226,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +25,7 @@ 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"
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ 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"
|
||||||
@ -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:
|
||||||
@ -97,6 +85,7 @@ At specified intervals (`checkPeriod`), the circuit breaker evaluates `expressio
|
|||||||
### Open
|
### Open
|
||||||
|
|
||||||
While open, the fallback mechanism takes over the normal service calls for a duration of `FallbackDuration`.
|
While open, the fallback mechanism takes over the normal service calls for a duration of `FallbackDuration`.
|
||||||
|
The fallback mechanism returns a `HTTP 503` (or `ResponseCode`) to the client.
|
||||||
After this duration, it enters the recovering state.
|
After this duration, it enters the recovering state.
|
||||||
|
|
||||||
### Recovering
|
### Recovering
|
||||||
@ -191,3 +180,9 @@ The duration for which the circuit breaker will wait before trying to recover (f
|
|||||||
_Optional, Default="10s"_
|
_Optional, Default="10s"_
|
||||||
|
|
||||||
The duration for which the circuit breaker will try to recover (as soon as it is in recovering state).
|
The duration for which the circuit breaker will try to recover (as soon as it is in recovering state).
|
||||||
|
|
||||||
|
### `ResponseCode`
|
||||||
|
|
||||||
|
_Optional, Default="503"_
|
||||||
|
|
||||||
|
The status code that the circuit breaker will return while it is in the open state.
|
||||||
|
@ -5,23 +5,24 @@ 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, Brotli and Zstandard 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.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
@ -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,24 +54,39 @@ 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 `*`, and/or `br`, and/or `zstd` 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 and no [defaultEncoding](#defaultencoding) is configured, the response won't be encoded.
|
||||||
|
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), or is one among the [includedContentTypes options](#includedcontenttypes).
|
||||||
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
|
||||||
|
|
||||||
|
The `excludedContentTypes` and `includedContentTypes` options are mutually exclusive.
|
||||||
|
|
||||||
|
!!! 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"
|
||||||
```
|
```
|
||||||
@ -102,17 +106,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:
|
||||||
@ -128,15 +121,74 @@ http:
|
|||||||
excludedContentTypes = ["text/event-stream"]
|
excludedContentTypes = ["text/event-stream"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `includedContentTypes`
|
||||||
|
|
||||||
|
_Optional, Default=""_
|
||||||
|
|
||||||
|
`includedContentTypes` specifies a list of content types to compare the `Content-Type` header of the responses before compressing.
|
||||||
|
|
||||||
|
The responses with content types defined in `includedContentTypes` are compressed.
|
||||||
|
|
||||||
|
Content types are compared in a case-insensitive, whitespace-ignored manner.
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
|
||||||
|
The `excludedContentTypes` and `includedContentTypes` options are mutually exclusive.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-compress.compress.includedcontenttypes=application/json,text/html,text/plain"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-compress
|
||||||
|
spec:
|
||||||
|
compress:
|
||||||
|
includedContentTypes:
|
||||||
|
- application/json
|
||||||
|
- text/html
|
||||||
|
- text/plain
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-compress.compress.includedcontenttypes=application/json,text/html,text/plain"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-compress:
|
||||||
|
compress:
|
||||||
|
includedContentTypes:
|
||||||
|
- application/json
|
||||||
|
- text/html
|
||||||
|
- text/plain
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-compress.compress]
|
||||||
|
includedContentTypes = ["application/json","text/html","text/plain"]
|
||||||
|
```
|
||||||
|
|
||||||
### `minResponseBodyBytes`
|
### `minResponseBodyBytes`
|
||||||
|
|
||||||
|
_Optional, Default=1024_
|
||||||
|
|
||||||
`minResponseBodyBytes` specifies the minimum amount of bytes a response body must have to be compressed.
|
`minResponseBodyBytes` specifies the minimum amount of bytes a response body must have to be compressed.
|
||||||
|
|
||||||
The default value is `1024`, which should be a reasonable value for most cases.
|
|
||||||
|
|
||||||
Responses smaller than the specified values will not be compressed.
|
Responses smaller than the specified values will not be compressed.
|
||||||
|
|
||||||
```yaml tab="Docker"
|
!!! tip "Streaming"
|
||||||
|
|
||||||
|
When data is sent to the client on flush, the `minResponseBodyBytes` configuration is ignored and the data is compressed.
|
||||||
|
This is particularly the case when data is streamed to the client when using `Transfer-encoding: chunked` response.
|
||||||
|
|
||||||
|
When chunked data is sent to the client on flush, it will be compressed by default even if the received data has not reached
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-compress.compress.minresponsebodybytes=1200"
|
- "traefik.http.middlewares.test-compress.compress.minresponsebodybytes=1200"
|
||||||
```
|
```
|
||||||
@ -155,17 +207,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:
|
||||||
@ -179,3 +220,89 @@ http:
|
|||||||
[http.middlewares.test-compress.compress]
|
[http.middlewares.test-compress.compress]
|
||||||
minResponseBodyBytes = 1200
|
minResponseBodyBytes = 1200
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `defaultEncoding`
|
||||||
|
|
||||||
|
_Optional, Default=""_
|
||||||
|
|
||||||
|
`defaultEncoding` specifies the default encoding if the `Accept-Encoding` header is not in the request or contains a wildcard (`*`).
|
||||||
|
|
||||||
|
There is no fallback on the `defaultEncoding` when the header value is empty or unsupported.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-compress.compress.defaultEncoding=gzip"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-compress
|
||||||
|
spec:
|
||||||
|
compress:
|
||||||
|
defaultEncoding: gzip
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-compress.compress.defaultEncoding=gzip"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-compress:
|
||||||
|
compress:
|
||||||
|
defaultEncoding: gzip
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-compress.compress]
|
||||||
|
defaultEncoding = "gzip"
|
||||||
|
```
|
||||||
|
|
||||||
|
### `encodings`
|
||||||
|
|
||||||
|
_Optional, Default="gzip, br, zstd"_
|
||||||
|
|
||||||
|
`encodings` specifies the list of supported compression encodings.
|
||||||
|
At least one encoding value must be specified, and valid entries are `gzip` (Gzip), `br` (Brotli), and `zstd` (Zstandard).
|
||||||
|
The order of the list also sets the priority, the top entry has the highest priority.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-compress.compress.encodings=zstd,br"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-compress
|
||||||
|
spec:
|
||||||
|
compress:
|
||||||
|
encodings:
|
||||||
|
- zstd
|
||||||
|
- br
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-compress.compress.encodings=zstd,br"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-compress:
|
||||||
|
compress:
|
||||||
|
encodings:
|
||||||
|
- zstd
|
||||||
|
- br
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-compress.compress]
|
||||||
|
encodings = ["zstd","br"]
|
||||||
|
```
|
||||||
|
@ -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,60 @@ 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.io/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
|
## Configuration Options
|
||||||
|
|
||||||
### `autoDetect`
|
### `autoDetect`
|
||||||
|
|
||||||
|
!!! warning
|
||||||
|
|
||||||
|
`autoDetect` option is deprecated and should not be used.
|
||||||
|
Moreover, it is redundant with an empty ContentType middleware declaration.
|
||||||
|
|
||||||
`autoDetect` specifies whether to let the `Content-Type` header,
|
`autoDetect` specifies whether to let the `Content-Type` header,
|
||||||
if it has not been set by the backend,
|
if it has not been set by the backend,
|
||||||
be automatically set to a value derived from the contents of the response.
|
be automatically set to a value derived from the contents of the response.
|
||||||
|
@ -14,7 +14,7 @@ The DigestAuth middleware grants access to services to authorized users only.
|
|||||||
|
|
||||||
## 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"
|
||||||
@ -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,7 +72,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +132,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +188,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +225,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +264,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,501,503,505-599"
|
- "traefik.http.middlewares.test-errors.errors.status=500,501,503,505-599"
|
||||||
@ -51,22 +51,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,501,503,505-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 excluding 502 and 504
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-errors.errors.status=500,501,503,505-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)"
|
||||||
# Dynamic Custom Error Page for 5XX Status Code excluding 502 and 504
|
# Dynamic Custom Error Page for 5XX Status Code excluding 502 and 504
|
||||||
http:
|
http:
|
||||||
@ -118,6 +102,19 @@ The status code ranges are inclusive (`505-599` will trigger with every code bet
|
|||||||
The comma-separated syntax is only available for label-based providers.
|
The comma-separated syntax is only available for label-based providers.
|
||||||
The examples above demonstrate which syntax is appropriate for each provider.
|
The examples above demonstrate which syntax is appropriate for each provider.
|
||||||
|
|
||||||
|
### `statusRewrites`
|
||||||
|
|
||||||
|
An optional mapping of status codes to be rewritten. For example, if a service returns a 418, you might want to rewrite it to a 404.
|
||||||
|
You can map individual status codes or even ranges to a different status code. The syntax for ranges follows the same rules as the `status` option.
|
||||||
|
|
||||||
|
Here is an example:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
statusRewrites:
|
||||||
|
"500-503": 500
|
||||||
|
"418": 404
|
||||||
|
```
|
||||||
|
|
||||||
### `service`
|
### `service`
|
||||||
|
|
||||||
The service that will serve the new requested error page.
|
The service that will serve the new requested error page.
|
||||||
@ -139,7 +136,8 @@ There are multiple variables that can be placed in the `query` option to insert
|
|||||||
|
|
||||||
The table below lists all the available variables and their associated values.
|
The table below lists all the available variables and their associated values.
|
||||||
|
|
||||||
| Variable | Value |
|
| Variable | Value |
|
||||||
|------------|--------------------------------------------------------------------|
|
|--------------------|--------------------------------------------------------------------------------------------|
|
||||||
| `{status}` | The response status code. |
|
| `{status}` | The response status code. It may be rewritten when using the `statusRewrites` option. |
|
||||||
| `{url}` | The [escaped](https://pkg.go.dev/net/url#QueryEscape) request URL. |
|
| `{originalStatus}` | The original response status code, if it has been modified by the `statusRewrites` option. |
|
||||||
|
| `{url}` | The [escaped](https://pkg.go.dev/net/url#QueryEscape) request URL. |
|
||||||
|
@ -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"
|
||||||
@ -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,7 +72,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +109,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +150,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +197,7 @@ 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-"
|
||||||
```
|
```
|
||||||
@ -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,7 +245,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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:
|
||||||
@ -352,6 +285,147 @@ http:
|
|||||||
authRequestHeaders = "Accept,X-CustomHeader"
|
authRequestHeaders = "Accept,X-CustomHeader"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `addAuthCookiesToResponse`
|
||||||
|
|
||||||
|
The `addAuthCookiesToResponse` option is the list of cookies to copy from the authentication server to the response,
|
||||||
|
replacing any existing conflicting cookie from the forwarded response.
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
|
||||||
|
Please note that all backend cookies matching the configured list will not be added to the response.
|
||||||
|
|
||||||
|
```yaml tab="Docker"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.addAuthCookiesToResponse=Session-Cookie,State-Cookie"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-auth
|
||||||
|
spec:
|
||||||
|
forwardAuth:
|
||||||
|
address: https://example.com/auth
|
||||||
|
addAuthCookiesToResponse:
|
||||||
|
- Session-Cookie
|
||||||
|
- State-Cookie
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.addAuthCookiesToResponse=Session-Cookie,State-Cookie"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-auth:
|
||||||
|
forwardAuth:
|
||||||
|
address: "https://example.com/auth"
|
||||||
|
addAuthCookiesToResponse:
|
||||||
|
- "Session-Cookie"
|
||||||
|
- "State-Cookie"
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-auth.forwardAuth]
|
||||||
|
address = "https://example.com/auth"
|
||||||
|
addAuthCookiesToResponse = ["Session-Cookie", "State-Cookie"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### `forwardBody`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Set the `forwardBody` option to `true` to send Body.
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
|
||||||
|
As body is read inside Traefik before forwarding, this breaks streaming.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.forwardBody=true"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-auth
|
||||||
|
spec:
|
||||||
|
forwardAuth:
|
||||||
|
address: https://example.com/auth
|
||||||
|
forwardBody: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.forwardBody=true"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-auth:
|
||||||
|
forwardAuth:
|
||||||
|
address: "https://example.com/auth"
|
||||||
|
forwardBody: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-auth.forwardAuth]
|
||||||
|
address = "https://example.com/auth"
|
||||||
|
forwardBody = true
|
||||||
|
```
|
||||||
|
|
||||||
|
### `maxBodySize`
|
||||||
|
|
||||||
|
_Optional, Default=-1_
|
||||||
|
|
||||||
|
Set the `maxBodySize` to limit the body size in bytes.
|
||||||
|
If body is bigger than this, it returns a 401 (unauthorized).
|
||||||
|
Default is `-1`, which means no limit.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.maxBodySize=1000"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-auth
|
||||||
|
spec:
|
||||||
|
forwardAuth:
|
||||||
|
address: https://example.com/auth
|
||||||
|
forwardBody: true
|
||||||
|
maxBodySize: 1000
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.maxBodySize=1000"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-auth:
|
||||||
|
forwardAuth:
|
||||||
|
address: "https://example.com/auth"
|
||||||
|
maxBodySize: 1000
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-auth.forwardAuth]
|
||||||
|
address = "https://example.com/auth"
|
||||||
|
forwardBody = true
|
||||||
|
maxBodySize = 1000
|
||||||
|
```
|
||||||
|
|
||||||
### `tls`
|
### `tls`
|
||||||
|
|
||||||
_Optional_
|
_Optional_
|
||||||
@ -365,7 +439,7 @@ _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"
|
||||||
```
|
```
|
||||||
@ -397,17 +471,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,7 +496,7 @@ _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"
|
||||||
@ -467,19 +530,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,7 +561,7 @@ _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"
|
||||||
@ -545,19 +595,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,7 +625,7 @@ _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"
|
||||||
```
|
```
|
||||||
@ -609,17 +646,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:
|
||||||
@ -637,4 +663,128 @@ http:
|
|||||||
[http.middlewares.test-auth.forwardAuth.tls]
|
[http.middlewares.test-auth.forwardAuth.tls]
|
||||||
insecureSkipVerify: true
|
insecureSkipVerify: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `headerField`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
You can define a header field to store the authenticated user using the `headerField`option.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.headerField=X-WebAuth-User"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-auth
|
||||||
|
spec:
|
||||||
|
forwardAuth:
|
||||||
|
# ...
|
||||||
|
headerField: X-WebAuth-User
|
||||||
|
```
|
||||||
|
|
||||||
|
```json tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.headerField=X-WebAuth-User"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-auth:
|
||||||
|
forwardAuth:
|
||||||
|
# ...
|
||||||
|
headerField: "X-WebAuth-User"
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares.test-auth.forwardAuth]
|
||||||
|
# ...
|
||||||
|
headerField = "X-WebAuth-User"
|
||||||
|
```
|
||||||
|
|
||||||
|
### `preserveLocationHeader`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
`preserveLocationHeader` defines whether to forward the `Location` header to the client as is or prefix it with the domain name of the authentication server.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.preserveLocationHeader=true"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-auth
|
||||||
|
spec:
|
||||||
|
forwardAuth:
|
||||||
|
# ...
|
||||||
|
preserveLocationHeader: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```json tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.preserveLocationHeader=true"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-auth:
|
||||||
|
forwardAuth:
|
||||||
|
# ...
|
||||||
|
preserveLocationHeader: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares.test-auth.forwardAuth]
|
||||||
|
# ...
|
||||||
|
preserveLocationHeader = true
|
||||||
|
```
|
||||||
|
|
||||||
|
### `preserveRequestMethod`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
`preserveRequestMethod` defines whether to preserve the original request method while forwarding the request to the authentication server. By default, when this option is set to `false`, incoming requests are always forwarded as `GET` requests to the authentication server.
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.preserveRequestMethod=true"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-auth
|
||||||
|
spec:
|
||||||
|
forwardAuth:
|
||||||
|
# ...
|
||||||
|
preserveRequestMethod: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```json tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-auth.forwardauth.preserveRequestMethod=true"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-auth:
|
||||||
|
forwardAuth:
|
||||||
|
# ...
|
||||||
|
preserveRequestMethod: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares.test-auth.forwardAuth]
|
||||||
|
# ...
|
||||||
|
preserveRequestMethod = true
|
||||||
|
```
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
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,7 +20,7 @@ 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"
|
||||||
@ -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="
|
||||||
@ -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,7 +123,7 @@ 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"
|
||||||
@ -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:
|
||||||
@ -211,7 +170,7 @@ 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,
|
Please note that the example below is by no means authoritative or exhaustive,
|
||||||
and should not be used as is for production.
|
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.accesscontrolallowheaders=*"
|
||||||
@ -248,25 +207,6 @@ spec:
|
|||||||
- "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.accesscontrolallowheaders=*",
|
|
||||||
"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.accesscontrolallowheaders=*"
|
|
||||||
- "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:
|
||||||
@ -454,6 +394,10 @@ This overrides the `BrowserXssFilter` option.
|
|||||||
|
|
||||||
The `contentSecurityPolicy` option allows the `Content-Security-Policy` header value to be set with a custom value.
|
The `contentSecurityPolicy` option allows the `Content-Security-Policy` header value to be set with a custom value.
|
||||||
|
|
||||||
|
### `contentSecurityPolicyReportOnly`
|
||||||
|
|
||||||
|
The `contentSecurityPolicyReportOnly` option allows the `Content-Security-Policy-Report-Only` header value to be set with a custom value.
|
||||||
|
|
||||||
### `publicKey`
|
### `publicKey`
|
||||||
|
|
||||||
The `publicKey` implements HPKP to prevent MITM attacks with forged certificates.
|
The `publicKey` implements HPKP to prevent MITM attacks with forged certificates.
|
||||||
@ -466,7 +410,7 @@ The `referrerPolicy` allows sites to control whether browsers forward the `Refer
|
|||||||
|
|
||||||
!!! warning
|
!!! warning
|
||||||
|
|
||||||
Deprecated in favor of `permissionsPolicy`
|
Deprecated in favor of [`permissionsPolicy`](#permissionsPolicy)
|
||||||
|
|
||||||
The `featurePolicy` allows sites to control browser features.
|
The `featurePolicy` allows sites to control browser features.
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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,7 +57,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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:
|
||||||
@ -125,7 +101,7 @@ If none are set, the default is to use the `requestHost`.
|
|||||||
|
|
||||||
#### `sourceCriterion.ipStrategy`
|
#### `sourceCriterion.ipStrategy`
|
||||||
|
|
||||||
The `ipStrategy` option defines two parameters that configures how Traefik determines the client IP: `depth`, and `excludedIPs`.
|
The `ipStrategy` option defines three parameters that configures how Traefik determines the client IP: `depth`, `excludedIPs` and `ipv6Subnet`.
|
||||||
|
|
||||||
!!! 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."
|
!!! 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."
|
||||||
|
|
||||||
@ -136,6 +112,9 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and select
|
|||||||
- If `depth` is greater than the total number of IPs in `X-Forwarded-For`, then the client IP is empty.
|
- If `depth` is greater than the total number of IPs in `X-Forwarded-For`, then the client IP is empty.
|
||||||
- `depth` is ignored if its value is less than or equal to 0.
|
- `depth` is ignored if its value is less than or equal to 0.
|
||||||
|
|
||||||
|
If `ipStrategy.ipv6Subnet` is provided and the selected IP is IPv6, the IP is transformed into the first IP of the subnet it belongs to.
|
||||||
|
See [ipStrategy.ipv6Subnet](#ipstrategyipv6subnet) for more details.
|
||||||
|
|
||||||
!!! example "Example of Depth & X-Forwarded-For"
|
!!! example "Example 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 as the criterion 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 as the criterion is `"12.0.0.1"` (`depth=2`).
|
||||||
@ -146,7 +125,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -167,17 +146,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:
|
||||||
@ -211,7 +179,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -234,17 +202,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:
|
||||||
@ -264,11 +221,68 @@ http:
|
|||||||
excludedIPs = ["127.0.0.1/32", "192.168.1.7"]
|
excludedIPs = ["127.0.0.1/32", "192.168.1.7"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### `ipStrategy.ipv6Subnet`
|
||||||
|
|
||||||
|
This strategy applies to `Depth` and `RemoteAddr` strategy only.
|
||||||
|
If `ipv6Subnet` is provided and the selected IP is IPv6, the IP is transformed into the first IP of the subnet it belongs to.
|
||||||
|
|
||||||
|
This is useful for grouping IPv6 addresses into subnets to prevent bypassing this middleware by obtaining a new IPv6.
|
||||||
|
|
||||||
|
- `ipv6Subnet` is ignored if its value is outside of 0-128 interval
|
||||||
|
|
||||||
|
!!! example "Example of ipv6Subnet"
|
||||||
|
|
||||||
|
If `ipv6Subnet` is provided, the IP is transformed in the following way.
|
||||||
|
|
||||||
|
| `IP` | `ipv6Subnet` | clientIP |
|
||||||
|
|---------------------------|--------------|-----------------------|
|
||||||
|
| `"::abcd:1111:2222:3333"` | `64` | `"::0:0:0:0"` |
|
||||||
|
| `"::abcd:1111:2222:3333"` | `80` | `"::abcd:0:0:0:0"` |
|
||||||
|
| `"::abcd:1111:2222:3333"` | `96` | `"::abcd:1111:0:0:0"` |
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.ipv6Subnet=64"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-inflightreq
|
||||||
|
spec:
|
||||||
|
inFlightReq:
|
||||||
|
sourceCriterion:
|
||||||
|
ipStrategy:
|
||||||
|
ipv6Subnet: 64
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-inflightreq.inflightreq.sourcecriterion.ipstrategy.ipv6Subnet=64"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-inflightreq:
|
||||||
|
inFlightReq:
|
||||||
|
sourceCriterion:
|
||||||
|
ipStrategy:
|
||||||
|
ipv6Subnet: 64
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-inflightreq.inflightreq]
|
||||||
|
[http.middlewares.test-inflightreq.inFlightReq.sourceCriterion.ipStrategy]
|
||||||
|
ipv6Subnet = 64
|
||||||
|
```
|
||||||
|
|
||||||
#### `sourceCriterion.requestHeaderName`
|
#### `sourceCriterion.requestHeaderName`
|
||||||
|
|
||||||
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"
|
||||||
```
|
```
|
||||||
@ -288,17 +302,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:
|
||||||
@ -319,7 +322,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -339,17 +342,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:
|
||||||
|
@ -35,18 +35,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.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-ipallowlist.ipallowlist.sourcerange": "127.0.0.1/32,192.168.1.7"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Accepts request from defined IP
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.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:
|
||||||
@ -87,6 +75,9 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and take th
|
|||||||
- If `depth` is greater than the total number of IPs in `X-Forwarded-For`, then the client IP will be empty.
|
- If `depth` is greater than the total number of IPs in `X-Forwarded-For`, then the client IP will be empty.
|
||||||
- `depth` is ignored if its value is less than or equal to 0.
|
- `depth` is ignored if its value is less than or equal to 0.
|
||||||
|
|
||||||
|
If `ipStrategy.ipv6Subnet` is provided and the selected IP is IPv6, the IP is transformed into the first IP of the subnet it belongs to.
|
||||||
|
See [ipStrategy.ipv6Subnet](#ipstrategyipv6subnet) for more details.
|
||||||
|
|
||||||
!!! 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 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`).
|
||||||
@ -125,20 +116,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.depth=2"
|
||||||
```
|
```
|
||||||
|
|
||||||
```json tab="Marathon"
|
|
||||||
"labels": {
|
|
||||||
"traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcerange": "127.0.0.1/32, 192.168.1.7",
|
|
||||||
"traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.depth": "2"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
|
||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.depth=2"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Allowlisting Based on `X-Forwarded-For` with `depth=2`
|
# Allowlisting Based on `X-Forwarded-For` with `depth=2`
|
||||||
http:
|
http:
|
||||||
@ -207,20 +184,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.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-ipallowlist.ipallowlist.sourceRange=127.0.0.1/32, 192.168.1.0/24"
|
|
||||||
"traefik.http.middlewares.test-ipallowlist.ipallowlist.ipstrategy.excludedips": "127.0.0.1/32, 192.168.1.7"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
|
||||||
# Exclude from `X-Forwarded-For`
|
|
||||||
labels:
|
|
||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourceRange=127.0.0.1/32, 192.168.1.0/24"
|
|
||||||
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.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:
|
||||||
@ -244,3 +207,60 @@ http:
|
|||||||
[http.middlewares.test-ipallowlist.ipAllowList.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"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `ipStrategy.ipv6Subnet`
|
||||||
|
|
||||||
|
This strategy applies to `Depth` and `RemoteAddr` strategy only.
|
||||||
|
If `ipv6Subnet` is provided and the selected IP is IPv6, the IP is transformed into the first IP of the subnet it belongs to.
|
||||||
|
|
||||||
|
This is useful for grouping IPv6 addresses into subnets to prevent bypassing this middleware by obtaining a new IPv6.
|
||||||
|
|
||||||
|
- `ipv6Subnet` is ignored if its value is outside of 0-128 interval
|
||||||
|
|
||||||
|
!!! example "Example of ipv6Subnet"
|
||||||
|
|
||||||
|
If `ipv6Subnet` is provided, the IP is transformed in the following way.
|
||||||
|
|
||||||
|
| `IP` | `ipv6Subnet` | clientIP |
|
||||||
|
|---------------------------|--------------|-----------------------|
|
||||||
|
| `"::abcd:1111:2222:3333"` | `64` | `"::0:0:0:0"` |
|
||||||
|
| `"::abcd:1111:2222:3333"` | `80` | `"::abcd:0:0:0:0"` |
|
||||||
|
| `"::abcd:1111:2222:3333"` | `96` | `"::abcd:1111:0:0:0"` |
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcecriterion.ipstrategy.ipv6Subnet=64"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-ipallowlist
|
||||||
|
spec:
|
||||||
|
ipallowlist:
|
||||||
|
sourceCriterion:
|
||||||
|
ipStrategy:
|
||||||
|
ipv6Subnet: 64
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-ipallowlist.ipallowlist.sourcecriterion.ipstrategy.ipv6Subnet=64"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-ipallowlist:
|
||||||
|
ipallowlist:
|
||||||
|
sourceCriterion:
|
||||||
|
ipStrategy:
|
||||||
|
ipv6Subnet: 64
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-ipallowlist.ipallowlist]
|
||||||
|
[http.middlewares.test-ipallowlist.ipallowlist.sourceCriterion.ipStrategy]
|
||||||
|
ipv6Subnet = 64
|
||||||
|
```
|
||||||
|
@ -41,18 +41,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.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:
|
||||||
@ -93,6 +81,9 @@ The `depth` option tells Traefik to use the `X-Forwarded-For` header and take th
|
|||||||
- If `depth` is greater than the total number of IPs in `X-Forwarded-For`, then the client IP will be empty.
|
- If `depth` is greater than the total number of IPs in `X-Forwarded-For`, then the client IP will be empty.
|
||||||
- `depth` is ignored if its value is less than or equal to 0.
|
- `depth` is ignored if its value is less than or equal to 0.
|
||||||
|
|
||||||
|
If `ipStrategy.ipv6Subnet` is provided and the selected IP is IPv6, the IP is transformed into the first IP of the subnet it belongs to.
|
||||||
|
See [ipStrategy.ipv6Subnet](#ipstrategyipv6subnet) for more details.
|
||||||
|
|
||||||
!!! 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 for the whitelisting is `"12.0.0.1"` (`depth=2`).
|
||||||
@ -131,20 +122,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.depth=2"
|
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.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`
|
# Whitelisting Based on `X-Forwarded-For` with `depth=2`
|
||||||
http:
|
http:
|
||||||
@ -213,20 +190,6 @@ spec:
|
|||||||
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips=127.0.0.1/32, 192.168.1.7"
|
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.ipstrategy.excludedips=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.0/24"
|
|
||||||
"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.sourceRange=127.0.0.1/32, 192.168.1.0/24"
|
|
||||||
- "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:
|
||||||
@ -250,3 +213,60 @@ http:
|
|||||||
[http.middlewares.test-ipwhitelist.ipWhiteList.ipStrategy]
|
[http.middlewares.test-ipwhitelist.ipWhiteList.ipStrategy]
|
||||||
excludedIPs = ["127.0.0.1/32", "192.168.1.7"]
|
excludedIPs = ["127.0.0.1/32", "192.168.1.7"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `ipStrategy.ipv6Subnet`
|
||||||
|
|
||||||
|
This strategy applies to `Depth` and `RemoteAddr` strategy only.
|
||||||
|
If `ipv6Subnet` is provided and the selected IP is IPv6, the IP is transformed into the first IP of the subnet it belongs to.
|
||||||
|
|
||||||
|
This is useful for grouping IPv6 addresses into subnets to prevent bypassing this middleware by obtaining a new IPv6.
|
||||||
|
|
||||||
|
- `ipv6Subnet` is ignored if its value is outside of 0-128 interval
|
||||||
|
|
||||||
|
!!! example "Example of ipv6Subnet"
|
||||||
|
|
||||||
|
If `ipv6Subnet` is provided, the IP is transformed in the following way.
|
||||||
|
|
||||||
|
| `IP` | `ipv6Subnet` | clientIP |
|
||||||
|
|---------------------------|--------------|-----------------------|
|
||||||
|
| `"::abcd:1111:2222:3333"` | `64` | `"::0:0:0:0"` |
|
||||||
|
| `"::abcd:1111:2222:3333"` | `80` | `"::abcd:0:0:0:0"` |
|
||||||
|
| `"::abcd:1111:2222:3333"` | `96` | `"::abcd:1111:0:0:0"` |
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.middlewares.test-ipWhiteList.ipWhiteList.sourcecriterion.ipstrategy.ipv6Subnet=64"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: test-ipWhiteList
|
||||||
|
spec:
|
||||||
|
ipWhiteList:
|
||||||
|
sourceCriterion:
|
||||||
|
ipStrategy:
|
||||||
|
ipv6Subnet: 64
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.middlewares.test-ipWhiteList.ipWhiteList.sourcecriterion.ipstrategy.ipv6Subnet=64"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-ipWhiteList:
|
||||||
|
ipWhiteList:
|
||||||
|
sourceCriterion:
|
||||||
|
ipStrategy:
|
||||||
|
ipv6Subnet: 64
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.middlewares]
|
||||||
|
[http.middlewares.test-ipWhiteList.ipWhiteList]
|
||||||
|
[http.middlewares.test-ipWhiteList.ipWhiteList.sourceCriterion.ipStrategy]
|
||||||
|
ipv6Subnet = 64
|
||||||
|
```
|
||||||
|
@ -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,19 +26,6 @@ whoami:
|
|||||||
|
|
||||||
```yaml tab="IngressRoute"
|
```yaml tab="IngressRoute"
|
||||||
# As a Kubernetes Traefik IngressRoute
|
# As a Kubernetes Traefik IngressRoute
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
|
||||||
kind: CustomResourceDefinition
|
|
||||||
metadata:
|
|
||||||
name: middlewares.traefik.io
|
|
||||||
spec:
|
|
||||||
group: traefik.io
|
|
||||||
version: v1alpha1
|
|
||||||
names:
|
|
||||||
kind: Middleware
|
|
||||||
plural: middlewares
|
|
||||||
singular: middleware
|
|
||||||
scope: Namespaced
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
@ -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,7 +18,7 @@ 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"
|
||||||
@ -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"
|
||||||
@ -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:
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -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:
|
||||||
@ -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"
|
||||||
@ -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:
|
||||||
# ...
|
# ...
|
||||||
@ -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"
|
||||||
@ -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:
|
||||||
# ...
|
# ...
|
||||||
@ -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"
|
||||||
@ -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/(.*)"
|
||||||
@ -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:
|
||||||
|
@ -21,7 +21,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"
|
||||||
@ -46,20 +46,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"
|
||||||
@ -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:
|
||||||
@ -93,12 +81,12 @@ Using the previous example, the backend should return `/products/shoes/image.png
|
|||||||
|
|
||||||
_Optional, Default=true_
|
_Optional, Default=true_
|
||||||
|
|
||||||
|
!!! warning
|
||||||
|
|
||||||
|
`forceSlash` option is deprecated and should not be used.
|
||||||
|
|
||||||
The `forceSlash` option ensures the resulting stripped path is not the empty string, by replacing it with `/` when necessary.
|
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"
|
??? info "Behavior examples"
|
||||||
|
|
||||||
- `forceSlash=true`
|
- `forceSlash=true`
|
||||||
@ -141,19 +129,6 @@ spec:
|
|||||||
forceSlash: false
|
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)"
|
```yaml tab="File (YAML)"
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
|
@ -12,7 +12,7 @@ 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]+/"
|
||||||
```
|
```
|
||||||
@ -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
|
||||||
@ -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,7 +7,7 @@ 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"
|
||||||
```
|
```
|
||||||
@ -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:
|
||||||
|
@ -39,18 +39,6 @@ spec:
|
|||||||
- "traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
|
- "traefik.tcp.middlewares.test-ipwhitelist.ipwhitelist.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]
|
||||||
|
@ -12,40 +12,27 @@ 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="IngressRoute"
|
```yaml tab="IngressRoute"
|
||||||
# As a Kubernetes Traefik IngressRoute
|
# As a Kubernetes Traefik IngressRoute
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
|
||||||
kind: CustomResourceDefinition
|
|
||||||
metadata:
|
|
||||||
name: middlewaretcps.traefik.io
|
|
||||||
spec:
|
|
||||||
group: traefik.io
|
|
||||||
version: v1alpha1
|
|
||||||
names:
|
|
||||||
kind: MiddlewareTCP
|
|
||||||
plural: middlewaretcps
|
|
||||||
singular: middlewaretcp
|
|
||||||
scope: Namespaced
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: traefik.io/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
|
||||||
@ -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"
|
||||||
@ -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
|
||||||
@ -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"
|
||||||
@ -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`)"
|
||||||
|
751
docs/content/migration/v2-to-v3-details.md
Normal file
751
docs/content/migration/v2-to-v3-details.md
Normal file
@ -0,0 +1,751 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik V3 Migration Details"
|
||||||
|
description: "Configuration changes and their details to successfully migrate from Traefik v2 to v3."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Configuration Details for Migrating from Traefik v2 to v3
|
||||||
|
|
||||||
|
## Static Configuration Changes
|
||||||
|
|
||||||
|
### SwarmMode
|
||||||
|
|
||||||
|
In v3, the provider Docker has been split into 2 providers:
|
||||||
|
|
||||||
|
- Docker provider (without Swarm support)
|
||||||
|
- Swarm provider (Swarm support only)
|
||||||
|
|
||||||
|
??? example "An example usage of v2 Docker provider with Swarm"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
docker:
|
||||||
|
swarmMode: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.docker]
|
||||||
|
swarmMode=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.docker.swarmMode=true
|
||||||
|
```
|
||||||
|
|
||||||
|
This configuration is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
#### Remediation
|
||||||
|
|
||||||
|
In v3, the `swarmMode` should not be used with the Docker provider, and, to use Swarm, the Swarm provider should be used instead.
|
||||||
|
|
||||||
|
??? example "An example usage of the Swarm provider"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
swarm:
|
||||||
|
endpoint: "tcp://127.0.0.1:2377"
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.swarm]
|
||||||
|
endpoint="tcp://127.0.0.1:2377"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.swarm.endpoint=tcp://127.0.0.1:2377
|
||||||
|
```
|
||||||
|
|
||||||
|
#### TLS.CAOptional
|
||||||
|
|
||||||
|
Docker provider `tls.CAOptional` option has been removed in v3, as TLS client authentication is a server side option (see https://pkg.go.dev/crypto/tls#ClientAuthType).
|
||||||
|
|
||||||
|
??? example "An example usage of the TLS.CAOptional option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
docker:
|
||||||
|
tls:
|
||||||
|
caOptional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.docker.tls]
|
||||||
|
caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.docker.tls.caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `tls.caOptional` option should be removed from the Docker provider static configuration.
|
||||||
|
|
||||||
|
### Kubernetes Gateway API
|
||||||
|
|
||||||
|
#### Experimental Channel Resources (TLSRoute and TCPRoute)
|
||||||
|
|
||||||
|
In v3, the Kubernetes Gateway API provider does not enable support for the experimental channel API resources by default.
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `experimentalChannel` option should be used to enable the support for the experimental channel API resources.
|
||||||
|
|
||||||
|
??? example "An example usage of the Kubernetes Gateway API provider with experimental channel support enabled"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
kubernetesGateway:
|
||||||
|
experimentalChannel: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.kubernetesGateway]
|
||||||
|
experimentalChannel = true
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.kubernetesgateway.experimentalchannel=true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Experimental Configuration
|
||||||
|
|
||||||
|
#### HTTP3
|
||||||
|
|
||||||
|
In v3, HTTP/3 is no longer an experimental feature.
|
||||||
|
It can be enabled on entry points without the associated `experimental.http3` option, which is now removed.
|
||||||
|
It is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
??? example "An example usage of v2 Experimental `http3` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
experimental:
|
||||||
|
http3: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[experimental]
|
||||||
|
http3=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--experimental.http3=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `http3` option should be removed from the static configuration experimental section.
|
||||||
|
To configure `http3`, please checkout the [entrypoint configuration documentation](../routing/entrypoints.md#http3_1).
|
||||||
|
|
||||||
|
### Consul provider
|
||||||
|
|
||||||
|
#### namespace
|
||||||
|
|
||||||
|
The Consul provider `namespace` option was deprecated in v2 and is now removed in v3.
|
||||||
|
It is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
??? example "An example usage of v2 Consul `namespace` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
consul:
|
||||||
|
namespace: foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[consul]
|
||||||
|
namespace=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--consul.namespace=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
In v3, the `namespaces` option should be used instead of the `namespace` option.
|
||||||
|
|
||||||
|
??? example "An example usage of Consul `namespaces` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
consul:
|
||||||
|
namespaces:
|
||||||
|
- foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[consul]
|
||||||
|
namespaces=["foobar"]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--consul.namespaces=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
#### TLS.CAOptional
|
||||||
|
|
||||||
|
Consul provider `tls.CAOptional` option has been removed in v3, as TLS client authentication is a server side option (see https://pkg.go.dev/crypto/tls#ClientAuthType).
|
||||||
|
|
||||||
|
??? example "An example usage of the TLS.CAOptional option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
consul:
|
||||||
|
tls:
|
||||||
|
caOptional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.consul.tls]
|
||||||
|
caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.consul.tls.caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `tls.caOptional` option should be removed from the Consul provider static configuration.
|
||||||
|
|
||||||
|
### ConsulCatalog provider
|
||||||
|
|
||||||
|
#### namespace
|
||||||
|
|
||||||
|
The ConsulCatalog provider `namespace` option was deprecated in v2 and is now removed in v3.
|
||||||
|
It is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
??? example "An example usage of v2 ConsulCatalog `namespace` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
consulCatalog:
|
||||||
|
namespace: foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[consulCatalog]
|
||||||
|
namespace=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--consulCatalog.namespace=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
In v3, the `namespaces` option should be used instead of the `namespace` option.
|
||||||
|
|
||||||
|
??? example "An example usage of ConsulCatalog `namespaces` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
consulCatalog:
|
||||||
|
namespaces:
|
||||||
|
- foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[consulCatalog]
|
||||||
|
namespaces=["foobar"]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--consulCatalog.namespaces=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Endpoint.TLS.CAOptional
|
||||||
|
|
||||||
|
ConsulCatalog provider `endpoint.tls.CAOptional` option has been removed in v3, as TLS client authentication is a server side option (see https://pkg.go.dev/crypto/tls#ClientAuthType).
|
||||||
|
|
||||||
|
??? example "An example usage of the Endpoint.TLS.CAOptional option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
consulCatalog:
|
||||||
|
endpoint:
|
||||||
|
tls:
|
||||||
|
caOptional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.consulCatalog.endpoint.tls]
|
||||||
|
caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.consulCatalog.endpoint.tls.caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `endpoint.tls.caOptional` option should be removed from the ConsulCatalog provider static configuration.
|
||||||
|
|
||||||
|
### Nomad provider
|
||||||
|
|
||||||
|
#### namespace
|
||||||
|
|
||||||
|
The Nomad provider `namespace` option was deprecated in v2 and is now removed in v3.
|
||||||
|
It is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
??? example "An example usage of v2 Nomad `namespace` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
nomad:
|
||||||
|
namespace: foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[nomad]
|
||||||
|
namespace=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--nomad.namespace=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
In v3, the `namespaces` option should be used instead of the `namespace` option.
|
||||||
|
|
||||||
|
??? example "An example usage of Nomad `namespaces` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
nomad:
|
||||||
|
namespaces:
|
||||||
|
- foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[nomad]
|
||||||
|
namespaces=["foobar"]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--nomad.namespaces=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Endpoint.TLS.CAOptional
|
||||||
|
|
||||||
|
Nomad provider `endpoint.tls.CAOptional` option has been removed in v3, as TLS client authentication is a server side option (see https://pkg.go.dev/crypto/tls#ClientAuthType).
|
||||||
|
|
||||||
|
??? example "An example usage of the Endpoint.TLS.CAOptional option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
nomad:
|
||||||
|
endpoint:
|
||||||
|
tls:
|
||||||
|
caOptional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.nomad.endpoint.tls]
|
||||||
|
caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.nomad.endpoint.tls.caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `endpoint.tls.caOptional` option should be removed from the Nomad provider static configuration.
|
||||||
|
|
||||||
|
### Rancher v1 Provider
|
||||||
|
|
||||||
|
In v3, the Rancher v1 provider has been removed because Rancher v1 is [no longer actively maintained](https://rancher.com/docs/os/v1.x/en/support/),
|
||||||
|
and Rancher v2 is supported as a standard Kubernetes provider.
|
||||||
|
|
||||||
|
??? example "An example of Traefik v2 Rancher v1 configuration"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
rancher: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.rancher]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.rancher=true
|
||||||
|
```
|
||||||
|
|
||||||
|
This configuration is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
#### Remediation
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Also, all Rancher provider related configuration should be removed from the static configuration.
|
||||||
|
|
||||||
|
### Marathon provider
|
||||||
|
|
||||||
|
Marathon maintenance [ended on October 31, 2021](https://github.com/mesosphere/marathon/blob/master/README.md).
|
||||||
|
In v3, the Marathon provider has been removed.
|
||||||
|
|
||||||
|
??? example "An example of v2 Marathon provider configuration"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
marathon: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.marathon]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.marathon=true
|
||||||
|
```
|
||||||
|
|
||||||
|
This configuration is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
#### Remediation
|
||||||
|
|
||||||
|
All Marathon provider related configuration should be removed from the static configuration.
|
||||||
|
|
||||||
|
### HTTP Provider
|
||||||
|
|
||||||
|
#### TLS.CAOptional
|
||||||
|
|
||||||
|
HTTP provider `tls.CAOptional` option has been removed in v3, as TLS client authentication is a server side option (see https://pkg.go.dev/crypto/tls#ClientAuthType).
|
||||||
|
|
||||||
|
??? example "An example usage of the TLS.CAOptional option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
caOptional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.http.tls]
|
||||||
|
caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.http.tls.caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `tls.caOptional` option should be removed from the HTTP provider static configuration.
|
||||||
|
|
||||||
|
### ETCD Provider
|
||||||
|
|
||||||
|
#### TLS.CAOptional
|
||||||
|
|
||||||
|
ETCD provider `tls.CAOptional` option has been removed in v3, as TLS client authentication is a server side option (see https://pkg.go.dev/crypto/tls#ClientAuthType).
|
||||||
|
|
||||||
|
??? example "An example usage of the TLS.CAOptional option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
etcd:
|
||||||
|
tls:
|
||||||
|
caOptional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.etcd.tls]
|
||||||
|
caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.etcd.tls.caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `tls.caOptional` option should be removed from the ETCD provider static configuration.
|
||||||
|
|
||||||
|
### Redis Provider
|
||||||
|
|
||||||
|
#### TLS.CAOptional
|
||||||
|
|
||||||
|
Redis provider `tls.CAOptional` option has been removed in v3, as TLS client authentication is a server side option (see https://pkg.go.dev/crypto/tls#ClientAuthType).
|
||||||
|
|
||||||
|
??? example "An example usage of the TLS.CAOptional option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
redis:
|
||||||
|
tls:
|
||||||
|
caOptional: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.redis.tls]
|
||||||
|
caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.redis.tls.caOptional=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `tls.caOptional` option should be removed from the Redis provider static configuration.
|
||||||
|
|
||||||
|
### InfluxDB v1
|
||||||
|
|
||||||
|
InfluxDB v1.x maintenance [ended in 2021](https://www.influxdata.com/blog/influxdb-oss-and-enterprise-roadmap-update-from-influxdays-emea/).
|
||||||
|
In v3, the InfluxDB v1 metrics provider has been removed.
|
||||||
|
|
||||||
|
??? example "An example of Traefik v2 InfluxDB v1 metrics configuration"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
influxDB: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.influxDB]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.influxDB=true
|
||||||
|
```
|
||||||
|
|
||||||
|
This configuration is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
#### Remediation
|
||||||
|
|
||||||
|
All InfluxDB v1 metrics provider related configuration should be removed from the static configuration.
|
||||||
|
|
||||||
|
### Pilot
|
||||||
|
|
||||||
|
Traefik Pilot is no longer available since October 4th, 2022.
|
||||||
|
|
||||||
|
??? example "An example of v2 Pilot configuration"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
pilot:
|
||||||
|
token: foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[pilot]
|
||||||
|
token=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--pilot.token=foobar
|
||||||
|
```
|
||||||
|
|
||||||
|
In v2, Pilot configuration was deprecated and ineffective,
|
||||||
|
it is now unsupported and would prevent Traefik to start.
|
||||||
|
|
||||||
|
#### Remediation
|
||||||
|
|
||||||
|
All Pilot related configuration should be removed from the static configuration.
|
||||||
|
|
||||||
|
### Kubernetes Ingress Path Matching
|
||||||
|
|
||||||
|
In v3, the Kubernetes Ingress default path matching does not support regexes anymore.
|
||||||
|
|
||||||
|
#### Remediation
|
||||||
|
|
||||||
|
Two levels of remediation are possible:
|
||||||
|
|
||||||
|
- Interpret the default path matcher `PathPrefix` with v2 syntax.
|
||||||
|
This can done globally for all routers with the [static configuration](#configure-the-default-syntax-in-static-configuration) or on a per-router basis by using the [traefik.ingress.kubernetes.io/router.rulesyntax](../routing/providers/kubernetes-ingress.md#annotations) annotation.
|
||||||
|
|
||||||
|
- Adapt the path regex to be compatible with the Go regex syntax and change the default path matcher to use the `PathRegexp` matcher with the [`traefik.ingress.kubernetes.io/router.pathmatcher`](../routing/providers/kubernetes-ingress.md#annotations) annotation.
|
||||||
|
|
||||||
|
## Operations Changes
|
||||||
|
|
||||||
|
### Traefik RBAC Update
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
|
### Observability
|
||||||
|
|
||||||
|
#### Open Connections Metric
|
||||||
|
|
||||||
|
In v3, the open connections metric has been replaced with a global one because it was erroneously at the HTTP level, and providing misleading information.
|
||||||
|
While previously produced at the entryPoint, router, and service levels, it is now replaced with a global metric.
|
||||||
|
The equivalent to `traefik_entrypoint_open_connections`, `traefik_router_open_connections` and `traefik_service_open_connections` is now `traefik_open_connections`.
|
||||||
|
|
||||||
|
#### Configuration Reload Failures Metrics
|
||||||
|
|
||||||
|
In v3, the `traefik_config_reloads_failure_total` and `traefik_config_last_reload_failure` metrics have been suppressed since they could not be implemented.
|
||||||
|
|
||||||
|
#### gRPC Metrics
|
||||||
|
|
||||||
|
In v3, the reported status code for gRPC requests is now the value of the `Grpc-Status` header.
|
||||||
|
|
||||||
|
#### Tracing
|
||||||
|
|
||||||
|
In v3, the tracing feature has been revamped and is now powered exclusively by [OpenTelemetry](https://opentelemetry.io/ "Link to website of OTel") (OTel).
|
||||||
|
!!! warning "Important"
|
||||||
|
Traefik v3 **no** longer supports direct output formats for specific vendors such as Instana, Jaeger, Zipkin, Haystack, Datadog, and Elastic.
|
||||||
|
Instead, it focuses on pure OpenTelemetry implementation, providing a unified and standardized approach for observability.
|
||||||
|
|
||||||
|
Here are two possible transition strategies:
|
||||||
|
|
||||||
|
1. OTLP Ingestion Endpoints:
|
||||||
|
|
||||||
|
Most vendors now offer OpenTelemetry Protocol (OTLP) ingestion endpoints.
|
||||||
|
You can seamlessly integrate Traefik v3 with these endpoints to continue leveraging tracing capabilities.
|
||||||
|
|
||||||
|
2. Legacy Stack Compatibility:
|
||||||
|
|
||||||
|
For legacy stacks that cannot immediately upgrade to the latest vendor agents supporting OTLP ingestion,
|
||||||
|
using OpenTelemetry (OTel) collectors with appropriate exporters configuration is a viable solution.
|
||||||
|
This allows continued compatibility with the existing infrastructure.
|
||||||
|
|
||||||
|
Please check the [OpenTelemetry Tracing provider documention](../observability/tracing/opentelemetry.md) for more information.
|
||||||
|
|
||||||
|
#### Internal Resources Observability
|
||||||
|
|
||||||
|
In v3, observability for internal routers or services (e.g.: `ping@internal`) is disabled by default.
|
||||||
|
To enable it one should use the new `addInternals` option for AccessLogs, Metrics or Tracing.
|
||||||
|
Please take a look at the observability documentation for more information:
|
||||||
|
|
||||||
|
- [AccessLogs](../observability/access-logs.md#addinternals)
|
||||||
|
- [Metrics](../observability/metrics/overview.md#addinternals)
|
||||||
|
- [Tracing](../observability/tracing/overview.md#addinternals)
|
||||||
|
|
||||||
|
#### Access logs
|
||||||
|
|
||||||
|
In v3, the `ServiceURL` field is not an object anymore but a string representation.
|
||||||
|
An update may be required if you index access logs.
|
||||||
|
|
||||||
|
## Dynamic Configuration Changes
|
||||||
|
|
||||||
|
### Router Rule Matchers
|
||||||
|
|
||||||
|
In v3, a new rule matchers syntax has been introduced for HTTP and TCP routers.
|
||||||
|
The default rule matchers syntax is now the v3 one, but for backward compatibility this can be configured.
|
||||||
|
The v2 rule matchers syntax is deprecated and its support will be removed in the next major version.
|
||||||
|
For this reason, we encourage migrating to the new syntax.
|
||||||
|
|
||||||
|
By default, the `defaultRuleSyntax` static option is automatically set to `v3`, meaning that the default rule is the new one.
|
||||||
|
|
||||||
|
#### New V3 Syntax Notable Changes
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### Remediation
|
||||||
|
|
||||||
|
##### Configure the Default Syntax In Static Configuration
|
||||||
|
|
||||||
|
The default rule matchers syntax is the expected syntax for any router that is not self opt-out from this default value.
|
||||||
|
It can be configured in the static configuration.
|
||||||
|
|
||||||
|
??? example "An example configuration for the default rule matchers syntax"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
# static configuration
|
||||||
|
core:
|
||||||
|
defaultRuleSyntax: v2
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
# static configuration
|
||||||
|
[core]
|
||||||
|
defaultRuleSyntax="v2"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# static configuration
|
||||||
|
--core.defaultRuleSyntax=v2
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Configure the Syntax Per Router
|
||||||
|
|
||||||
|
The rule syntax can also be configured on a per-router basis.
|
||||||
|
This allows to have heterogeneous router configurations and ease migration.
|
||||||
|
|
||||||
|
??? example "An example router with syntax configuration"
|
||||||
|
|
||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
labels:
|
||||||
|
- "traefik.http.routers.test.ruleSyntax=v2"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: test.route
|
||||||
|
namespace: default
|
||||||
|
|
||||||
|
spec:
|
||||||
|
routes:
|
||||||
|
- match: PathPrefix(`/foo`, `/bar`)
|
||||||
|
syntax: v2
|
||||||
|
kind: Rule
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
- "traefik.http.routers.test.ruleSyntax=v2"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
http:
|
||||||
|
routers:
|
||||||
|
test:
|
||||||
|
ruleSyntax: v2
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[http.routers]
|
||||||
|
[http.routers.test]
|
||||||
|
ruleSyntax = "v2"
|
||||||
|
```
|
||||||
|
|
||||||
|
### IPWhiteList
|
||||||
|
|
||||||
|
In v3, we renamed the `IPWhiteList` middleware to `IPAllowList` without changing anything to the configuration.
|
||||||
|
|
||||||
|
### Deprecated Options Removal
|
||||||
|
|
||||||
|
- The `tracing.datadog.globaltag` option 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.
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
|
### 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.
|
77
docs/content/migration/v2-to-v3.md
Normal file
77
docs/content/migration/v2-to-v3.md
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
---
|
||||||
|
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 }
|
||||||
|
|
||||||
|
With Traefik v3, we are introducing a streamlined transition process from v2. Minimal breaking changes have been made to specific options in the [static configuration](./v2-to-v3-details.md#static-configuration-changes "Link to static configuration changes"), and we are ensuring backward compatibility with v2 syntax in the [dynamic configuration](./v2-to-v3-details.md#dynamic-configuration-changes "Link to dynamic configuration changes"). This will offer a gradual path for adopting the v3 syntax, allowing users to progressively migrate their Kubernetes ingress resources, Docker labels, etc., to the new format.
|
||||||
|
|
||||||
|
Here are the steps to progressively migrate from Traefik v2 to v3:
|
||||||
|
|
||||||
|
1. [Prepare configurations and test v3](#step-1-prepare-configurations-and-test-v3)
|
||||||
|
1. [Migrate production instances to Traefik v3](#step-2-migrate-production-instances-to-traefik-v3)
|
||||||
|
1. [Progressively migrate dynamic configuration](#step-3-progressively-migrate-dynamic-configuration)
|
||||||
|
|
||||||
|
## Step 1: Prepare Configurations and Test v3
|
||||||
|
|
||||||
|
Check the changes in [static configurations](./v2-to-v3-details.md#static-configuration-changes "Link to static configuration changes") and [operations](./v2-to-v3-details.md#operations-changes "Link to operations changes") brought by Traefik v3.
|
||||||
|
Modify your configurations accordingly.
|
||||||
|
|
||||||
|
Then, add the following snippet to the static configuration:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# static configuration
|
||||||
|
core:
|
||||||
|
defaultRuleSyntax: v2
|
||||||
|
```
|
||||||
|
|
||||||
|
This snippet in the static configuration makes the [v2 format](../migration/v2-to-v3-details.md#configure-the-default-syntax-in-static-configuration "Link to configure default syntax in static config") the default rule matchers syntax.
|
||||||
|
|
||||||
|
Start Traefik v3 with this new configuration to test it.
|
||||||
|
|
||||||
|
If you don’t get any error logs while testing, you are good to go!
|
||||||
|
Otherwise, follow the remaining migration options highlighted in the logs.
|
||||||
|
|
||||||
|
Once your Traefik test instances are starting and routing to your applications, proceed to the next step.
|
||||||
|
|
||||||
|
## Step 2: Migrate Production Instances to Traefik v3
|
||||||
|
|
||||||
|
We strongly advise you to follow a progressive migration strategy ([Kubernetes rolling update mechanism](https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/ "Link to the Kubernetes rolling update documentation"), for example) to migrate your production instances to v3.
|
||||||
|
|
||||||
|
!!! Warning
|
||||||
|
Ensure you have a [real-time monitoring solution](https://traefik.io/blog/capture-traefik-metrics-for-apps-on-kubernetes-with-prometheus/ "Link to the blog on capturing Traefik metrics with Prometheus") for your ingress traffic to detect issues instantly.
|
||||||
|
|
||||||
|
During the progressive migration, monitor your ingress traffic for any errors. Be prepared to rollback to a working state in case of any issues.
|
||||||
|
|
||||||
|
If you encounter any issues, leverage debug and access logs provided by Traefik to understand what went wrong and how to fix it.
|
||||||
|
|
||||||
|
Once every Traefik instance is updated, you will be on Traefik v3!
|
||||||
|
|
||||||
|
## Step 3: Progressively Migrate Dynamic Configuration
|
||||||
|
|
||||||
|
!!! info
|
||||||
|
This step can be done later in the process, as Traefik v3 is compatible with the v2 format for [dynamic configuration](./v2-to-v3-details.md#dynamic-configuration-changes "Link to dynamic configuration changes").
|
||||||
|
Enable Traefik logs to get some help if any deprecated option is in use.
|
||||||
|
|
||||||
|
Check the changes in [dynamic configuration](./v2-to-v3-details.md#dynamic-configuration-changes "Link to dynamic configuration changes").
|
||||||
|
|
||||||
|
Then, progressively [switch each router to the v3 syntax](./v2-to-v3-details.md#configure-the-syntax-per-router "Link to configuring the syntax per router").
|
||||||
|
|
||||||
|
Test and update each Ingress resource and ensure that ingress traffic is not impacted.
|
||||||
|
|
||||||
|
Once a v3 Ingress resource migration is validated, deploy the resource and delete the v2 Ingress resource.
|
||||||
|
Repeat it until all Ingress resources are migrated.
|
||||||
|
|
||||||
|
Now, remove the following snippet added to the static configuration in Step 1:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# static configuration
|
||||||
|
core:
|
||||||
|
defaultRuleSyntax: v2
|
||||||
|
```
|
||||||
|
|
||||||
|
You are now fully migrated to Traefik v3 🎉
|
@ -77,6 +77,7 @@ rules:
|
|||||||
- tlsoptions
|
- tlsoptions
|
||||||
- tlsstores
|
- tlsstores
|
||||||
- serverstransports
|
- serverstransports
|
||||||
|
- serverstransporttcps
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
@ -169,6 +170,7 @@ rules:
|
|||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
|
- traefik.io
|
||||||
- traefik.containo.us
|
- traefik.containo.us
|
||||||
resources:
|
resources:
|
||||||
- middlewares
|
- middlewares
|
||||||
@ -180,6 +182,7 @@ rules:
|
|||||||
- tlsoptions
|
- tlsoptions
|
||||||
- tlsstores
|
- tlsstores
|
||||||
- serverstransports
|
- serverstransports
|
||||||
|
- serverstransporttcps
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
@ -452,7 +455,7 @@ To enable HTTP/3 on an EntryPoint, please check out the [HTTP/3 configuration](.
|
|||||||
|
|
||||||
In `v2.6`, the [Kubernetes Gateway API provider](../providers/kubernetes-gateway.md) now only supports the version [v1alpha2](https://gateway-api.sigs.k8s.io/v1alpha2/guides/) of the specification and
|
In `v2.6`, the [Kubernetes Gateway API provider](../providers/kubernetes-gateway.md) now only supports the version [v1alpha2](https://gateway-api.sigs.k8s.io/v1alpha2/guides/) of the specification and
|
||||||
[route namespaces](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1beta1.RouteNamespaces) selectors, which requires Traefik to fetch and watch the cluster namespaces.
|
[route namespaces](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1beta1.RouteNamespaces) selectors, which requires Traefik to fetch and watch the cluster namespaces.
|
||||||
Therefore, the [RBAC](../reference/dynamic-configuration/kubernetes-gateway.md#rbac) and [CRD](../reference/dynamic-configuration/kubernetes-gateway.md#definitions) definitions must be updated.
|
Therefore, the RBAC and CRD definitions must be updated.
|
||||||
|
|
||||||
## v2.6.0 to v2.6.1
|
## v2.6.0 to v2.6.1
|
||||||
|
|
||||||
@ -550,7 +553,7 @@ The following ciphers have been removed from the default list:
|
|||||||
- `TLS_RSA_WITH_AES_128_GCM_SHA256`
|
- `TLS_RSA_WITH_AES_128_GCM_SHA256`
|
||||||
- `TLS_RSA_WITH_AES_256_GCM_SHA384`
|
- `TLS_RSA_WITH_AES_256_GCM_SHA384`
|
||||||
|
|
||||||
To enable these ciphers, please set the option `CipherSuites` in your [TLS configuration](https://doc.traefik.io/traefik/https/tls/#cipher-suites) or set the environment variable `GODEBUG=tlsrsakex=1`.
|
To enable these ciphers, please set the option `CipherSuites` in your [TLS configuration](../https/tls.md#cipher-suites) or set the environment variable `GODEBUG=tlsrsakex=1`.
|
||||||
|
|
||||||
### Minimum TLS Version
|
### Minimum TLS Version
|
||||||
|
|
||||||
@ -559,7 +562,7 @@ To enable these ciphers, please set the option `CipherSuites` in your [TLS confi
|
|||||||
> This change can be reverted with the `tls10server=1 GODEBUG` setting.
|
> This change can be reverted with the `tls10server=1 GODEBUG` setting.
|
||||||
> (https://go.dev/doc/go1.22#crypto/tls)
|
> (https://go.dev/doc/go1.22#crypto/tls)
|
||||||
|
|
||||||
To enable TLS 1.0, please set the option `MinVersion` to `VersionTLS10` in your [TLS configuration](https://doc.traefik.io/traefik/https/tls/#cipher-suites) or set the environment variable `GODEBUG=tls10server=1`.
|
To enable TLS 1.0, please set the option `MinVersion` to `VersionTLS10` in your [TLS configuration](../https/tls.md#cipher-suites) or set the environment variable `GODEBUG=tls10server=1`.
|
||||||
|
|
||||||
## v2.11.1
|
## v2.11.1
|
||||||
|
|
||||||
@ -657,11 +660,11 @@ Please check out the [entrypoint forwarded headers connection option configurati
|
|||||||
In `v2.11.14`, the `X-Forwarded-Prefix` header is now handled like the other `X-Forwarded-*` headers: Traefik removes it when it's sent from an untrusted source.
|
In `v2.11.14`, the `X-Forwarded-Prefix` header is now handled like the other `X-Forwarded-*` headers: Traefik removes it when it's sent from an untrusted source.
|
||||||
Please refer to the Forwarded headers [documentation](../routing/entrypoints.md#forwarded-headers) for more details.
|
Please refer to the Forwarded headers [documentation](../routing/entrypoints.md#forwarded-headers) for more details.
|
||||||
|
|
||||||
## v2.11.23
|
## v2.11.24
|
||||||
|
|
||||||
### Request Path Sanitization
|
### Request Path Sanitization
|
||||||
|
|
||||||
Since `v2.11.23`, the incoming request path is now cleaned before being used to match the router rules and sent to the backends.
|
Since `v2.11.24`, the incoming request path is now cleaned before being used to match the router rules and sent to the backends.
|
||||||
Any `/../`, `/./` or duplicate slash segments in the request path is interpreted and/or collapsed.
|
Any `/../`, `/./` or duplicate slash segments in the request path is interpreted and/or collapsed.
|
||||||
|
|
||||||
If you want to disable this behavior, you can set the [`sanitizePath` option](../routing/entrypoints.md#sanitizepath) to `false` in the entryPoint HTTP configuration.
|
If you want to disable this behavior, you can set the [`sanitizePath` option](../routing/entrypoints.md#sanitizepath) to `false` in the entryPoint HTTP configuration.
|
||||||
|
280
docs/content/migration/v3.md
Normal file
280
docs/content/migration/v3.md
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik Migration Documentation"
|
||||||
|
description: "Learn the steps needed to migrate to new Traefik Proxy v3 versions. Read the technical documentation."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Migration: Steps needed between the versions
|
||||||
|
|
||||||
|
## v3.0 to v3.1
|
||||||
|
|
||||||
|
### Kubernetes Provider RBACs
|
||||||
|
|
||||||
|
Starting with v3.1, the Kubernetes Providers now use the [EndpointSlices API](https://kubernetes.io/docs/concepts/services-networking/endpoint-slices/) (Kubernetes >=v1.21) to discover service endpoint addresses.
|
||||||
|
It also brings NodePort load-balancing which requires Nodes resources lookup.
|
||||||
|
|
||||||
|
Therefore, in the corresponding RBACs (see [KubernetesIngress](../routing/providers/kubernetes-ingress.md#configuration-example), [KubernetesCRD](../reference/dynamic-configuration/kubernetes-crd.md#rbac), and [KubernetesGateway](../reference/dynamic-configuration/kubernetes-gateway-rbac.yml) provider RBACs):
|
||||||
|
|
||||||
|
- the `endpoints` right has to be removed and the following `endpointslices` right has to be added:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
- apiGroups:
|
||||||
|
- discovery.k8s.io
|
||||||
|
resources:
|
||||||
|
- endpointslices
|
||||||
|
verbs:
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
- the `nodes` right has to be added:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- nodes
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Gateway API: KubernetesGateway Provider
|
||||||
|
|
||||||
|
In v3.1, the KubernetesGateway Provider is no longer an experimental feature.
|
||||||
|
It can be enabled without the associated `experimental.kubernetesgateway` option, which is now deprecated.
|
||||||
|
|
||||||
|
??? example "An example of the experimental `kubernetesgateway` option"
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
experimental:
|
||||||
|
kubernetesgateway: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[experimental]
|
||||||
|
kubernetesgateway=true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--experimental.kubernetesgateway=true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Remediation
|
||||||
|
|
||||||
|
The `kubernetesgateway` option should be removed from the experimental section of the static configuration.
|
||||||
|
To configure `kubernetesgateway`, please check out the [KubernetesGateway Provider documentation](../providers/kubernetes-gateway.md).
|
||||||
|
|
||||||
|
## v3.1.0 to v3.1.1
|
||||||
|
|
||||||
|
### IngressClass Lookup
|
||||||
|
|
||||||
|
The Kubernetes Ingress provider option `disableIngressClassLookup` has been deprecated in v3.1.1, and will be removed in the next major version.
|
||||||
|
Please use the `disableClusterScopeResources` option instead to avoid cluster scope resources discovery (IngressClass, Nodes).
|
||||||
|
|
||||||
|
## v3.1 to v3.2
|
||||||
|
|
||||||
|
### Kubernetes CRD Provider
|
||||||
|
|
||||||
|
Starting with v3.2, the CRDs has been updated on [TraefikService](../../routing/services#mirroring-service) (PR [#11032](https://github.com/traefik/traefik/pull/11032)), on [RateLimit](../../middlewares/http/ratelimit) & [InFlightReq](../../middlewares/http/inflightreq) middlewares (PR [#9747](https://github.com/traefik/traefik/pull/9747)) and on [Compress](../../middlewares/http/compress) middleware (PR [#10943](https://github.com/traefik/traefik/pull/10943)).
|
||||||
|
|
||||||
|
This update adds only new optional fields.
|
||||||
|
CRDs can be updated with this command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v3.3/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Kubernetes Gateway Provider Standard Channel
|
||||||
|
|
||||||
|
Starting with v3.2, the Kubernetes Gateway Provider now supports [GRPCRoute](https://gateway-api.sigs.k8s.io/api-types/grpcroute/).
|
||||||
|
|
||||||
|
Therefore, in the corresponding RBACs (see [KubernetesGateway](../reference/dynamic-configuration/kubernetes-gateway-rbac.yml) provider RBACs),
|
||||||
|
the `grcroutes` and `grpcroutes/status` rights have to be added.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
- apiGroups:
|
||||||
|
- gateway.networking.k8s.io
|
||||||
|
resources:
|
||||||
|
- grpcroutes
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- gateway.networking.k8s.io
|
||||||
|
resources:
|
||||||
|
- grpcroutes/status
|
||||||
|
verbs:
|
||||||
|
- update
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Kubernetes Gateway Provider Experimental Channel
|
||||||
|
|
||||||
|
!!! warning "Breaking changes"
|
||||||
|
|
||||||
|
Because of a breaking change introduced in Kubernetes Gateway [v1.2.0-rc1](https://github.com/kubernetes-sigs/gateway-api/releases/tag/v1.2.0-rc1),
|
||||||
|
Traefik v3.3 only supports Kubernetes Gateway v1.2.x when experimental channel features are enabled.
|
||||||
|
|
||||||
|
Starting with v3.2, the Kubernetes Gateway Provider now supports [BackendTLSPolicy](https://gateway-api.sigs.k8s.io/api-types/backendtlspolicy/).
|
||||||
|
|
||||||
|
Therefore, in the corresponding RBACs (see [KubernetesGateway](../reference/dynamic-configuration/kubernetes-gateway-rbac.yml) provider RBACs),
|
||||||
|
the `backendtlspolicies` and `backendtlspolicies/status` rights have to be added.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- configmaps
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- gateway.networking.k8s.io
|
||||||
|
resources:
|
||||||
|
- backendtlspolicies
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- gateway.networking.k8s.io
|
||||||
|
resources:
|
||||||
|
- backendtlspolicies/status
|
||||||
|
verbs:
|
||||||
|
- update
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
## v3.2.1
|
||||||
|
|
||||||
|
### X-Forwarded-Prefix
|
||||||
|
|
||||||
|
In `v3.2.1`, the `X-Forwarded-Prefix` header is now handled like the other `X-Forwarded-*` headers: Traefik removes it when it's sent from an untrusted source.
|
||||||
|
Please refer to the Forwarded headers [documentation](../routing/entrypoints.md#forwarded-headers) for more details.
|
||||||
|
|
||||||
|
## v3.2.2
|
||||||
|
|
||||||
|
### Swarm Provider
|
||||||
|
|
||||||
|
In `v3.2.2`, the `traefik.docker.network` and `traefik.docker.lbswarm` labels have been deprecated,
|
||||||
|
please use the `traefik.swarm.network` and `traefik.swarm.lbswarm` labels instead.
|
||||||
|
|
||||||
|
## v3.2 to v3.3
|
||||||
|
|
||||||
|
### ACME DNS Certificate Resolver
|
||||||
|
|
||||||
|
In `v3.3`, the `acme.dnsChallenge.delaybeforecheck` and `acme.dnsChallenge.disablepropagationcheck` options of the ACME certificate resolver are deprecated,
|
||||||
|
please use respectively `acme.dnsChallenge.propagation.delayBeforeChecks` and `acme.dnsChallenge.propagation.disableChecks` options instead.
|
||||||
|
|
||||||
|
### Tracing Global Attributes
|
||||||
|
|
||||||
|
In `v3.3`, the `tracing.globalAttributes` option has been deprecated, please use the `tracing.resourceAttributes` option instead.
|
||||||
|
The `tracing.globalAttributes` option is misleading as its name does not reflect the operation of adding resource attributes to be sent to the collector,
|
||||||
|
and will be removed in the next major version.
|
||||||
|
|
||||||
|
## v3.3.4
|
||||||
|
|
||||||
|
### OpenTelemetry Request Duration metric
|
||||||
|
|
||||||
|
In `v3.3.4`, the OpenTelemetry Request Duration metric (named `traefik_(entrypoint|router|service)_request_duration_seconds`) unit has been changed from milliseconds to seconds.
|
||||||
|
To be consistent with the naming and other metrics providers, the metric now reports the duration in seconds.
|
||||||
|
|
||||||
|
## v3.3.5
|
||||||
|
|
||||||
|
### Compress Middleware
|
||||||
|
|
||||||
|
In `v3.3.5`, the compress middleware `encodings` option default value is now `gzip, br, zstd`.
|
||||||
|
This change helps the algorithm selection to favor the `gzip` algorithm over the other algorithms.
|
||||||
|
|
||||||
|
It impacts requests that do not specify their preferred algorithm,
|
||||||
|
or has no order preference, in the `Accept-Encoding` header.
|
||||||
|
|
||||||
|
## v3.3.6
|
||||||
|
|
||||||
|
### Request Path Sanitization
|
||||||
|
|
||||||
|
Since `v3.3.6`, the incoming request path is now cleaned before being used to match the router rules and sent to the backends.
|
||||||
|
Any `/../`, `/./` or duplicate slash segments in the request path is interpreted and/or collapsed.
|
||||||
|
|
||||||
|
If you want to disable this behavior, you can set the [`sanitizePath` option](../reference/install-configuration/entrypoints.md#sanitizepath) to `false` in the entryPoint HTTP configuration.
|
||||||
|
This can be useful when dealing with legacy clients that are not url-encoding data in the request path.
|
||||||
|
For example, as base64 uses the “/” character internally,
|
||||||
|
if it's not url encoded,
|
||||||
|
it can lead to unsafe routing when the `sanitizePath` option is set to `false`.
|
||||||
|
|
||||||
|
!!! warning "Security"
|
||||||
|
|
||||||
|
Setting the `sanitizePath` option to `false` is not safe.
|
||||||
|
Ensure every request is properly url encoded instead.
|
||||||
|
|
||||||
|
## v3.3 to v3.4
|
||||||
|
|
||||||
|
### Kubernetes CRD Provider
|
||||||
|
|
||||||
|
#### Load-Balancing
|
||||||
|
|
||||||
|
In `v3.4`, the HTTP service definition has been updated.
|
||||||
|
The strategy field now supports two new values: `wrr` and `p2c` (please refer to the [HTTP Services Load Balancing documentation](../../routing/services/#load-balancing-strategy) for more details).
|
||||||
|
|
||||||
|
CRDs can be updated with this command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v3.4/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Please note that the `RoundRobin` strategy value is now deprecated, but still supported and equivalent to `wrr`, and will be removed in the next major release.
|
||||||
|
|
||||||
|
#### ServersTransport CA Certificate
|
||||||
|
|
||||||
|
In `v3.4`, a new `rootCAs` option has been added to the `ServersTransport` and `ServersTransportTCP` CRDs.
|
||||||
|
It allows the configuration of CA certificates from both `ConfigMaps` and `Secrets`,
|
||||||
|
and replaces the `rootCAsSecrets` option, as shown below:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: ServersTransport
|
||||||
|
metadata:
|
||||||
|
name: foo
|
||||||
|
namespace: bar
|
||||||
|
spec:
|
||||||
|
rootCAs:
|
||||||
|
- configMap: ca-config-map
|
||||||
|
- secret: ca-secret
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: ServersTransportTCP
|
||||||
|
metadata:
|
||||||
|
name: foo
|
||||||
|
namespace: bar
|
||||||
|
spec:
|
||||||
|
rootCAs:
|
||||||
|
- configMap: ca-config-map
|
||||||
|
- secret: ca-secret
|
||||||
|
```
|
||||||
|
|
||||||
|
The `rootCAsSecrets` option, which allows only `Secrets` references,
|
||||||
|
is still supported, but is now deprecated,
|
||||||
|
and will be removed in the next major release.
|
||||||
|
|
||||||
|
### Rule Syntax
|
||||||
|
|
||||||
|
In `v3.4.0`, the `core.defaultRuleSyntax` static configuration option and the `ruleSyntax` router option have been deprecated,
|
||||||
|
and will be removed in the next major version.
|
||||||
|
|
||||||
|
This `core.defaultRuleSyntax` option was used to switch between the v2 and v3 syntax for the router's rules,
|
||||||
|
and to help with the migration from v2 to v3.
|
||||||
|
|
||||||
|
The `ruleSyntax` router's option was used to override the default rule syntax for a specific router.
|
||||||
|
|
||||||
|
In preparation for the next major release, please remove any use of these two options and use the v3 syntax for writing the router's rules.
|
@ -26,6 +26,26 @@ accessLog: {}
|
|||||||
--accesslog=true
|
--accesslog=true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `addInternals`
|
||||||
|
|
||||||
|
_Optional, Default="false"_
|
||||||
|
|
||||||
|
Enables access logs for internal resources (e.g.: `ping@internal`).
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
addInternals: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog]
|
||||||
|
addInternals = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.addinternals
|
||||||
|
```
|
||||||
|
|
||||||
### `filePath`
|
### `filePath`
|
||||||
|
|
||||||
By default access logs are written to the standard output.
|
By default access logs are written to the standard output.
|
||||||
@ -244,6 +264,9 @@ 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`) |
|
||||||
|
| `TraceId` | A consistent identifier for tracking requests across services, including upstream ones managed by Traefik, shown as a 32-hex digit string |
|
||||||
|
| `SpanId` | A unique identifier for Traefik’s root span (EntryPoint) within a request trace, formatted as a 16-hex digit string. |
|
||||||
|
|
||||||
## Log Rotation
|
## Log Rotation
|
||||||
|
|
||||||
@ -269,7 +292,7 @@ version: "3.7"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
traefik:
|
traefik:
|
||||||
image: traefik:v2.11
|
image: traefik:v3.4
|
||||||
environment:
|
environment:
|
||||||
- TZ=US/Alaska
|
- TZ=US/Alaska
|
||||||
command:
|
command:
|
||||||
@ -281,4 +304,418 @@ services:
|
|||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OpenTelemetry
|
||||||
|
|
||||||
|
!!! warning "Experimental Feature"
|
||||||
|
|
||||||
|
The OpenTelemetry access logs feature is currently experimental and must be explicitly enabled in the experimental section prior to use.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
experimental:
|
||||||
|
otlpLogs: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[experimental.otlpLogs]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--experimental.otlpLogs=true
|
||||||
|
```
|
||||||
|
|
||||||
|
To enable the OpenTelemetry Logger for access logs:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! info "Default protocol"
|
||||||
|
|
||||||
|
The OpenTelemetry Logger exporter will export access logs to the collector using HTTPS by default to https://localhost:4318/v1/logs, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
||||||
|
|
||||||
|
### HTTP configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send access logs to the OpenTelemetry Collector using HTTP.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
http: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.http]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.http=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Optional, Default="`https://localhost:4318/v1/logs`", Format="`<scheme>://<host>:<port><path>`"_
|
||||||
|
|
||||||
|
URL of the OpenTelemetry Collector to send access logs to.
|
||||||
|
|
||||||
|
!!! info "Insecure mode"
|
||||||
|
|
||||||
|
To disable TLS, use `http://` instead of `https://` in the `endpoint` configuration.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
endpoint: https://collector:4318/v1/logs
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.http]
|
||||||
|
endpoint = "https://collector:4318/v1/logs"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.http.endpoint=https://collector:4318/v1/logs
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with access logs by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.http.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.http.headers.foo=bar --accesslog.otlp.http.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter to send access logs 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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.http.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.http.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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--accesslog.otlp.http.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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--accesslog.otlp.http.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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.http.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.http.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
|
### gRPC configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send access logs to the OpenTelemetry Collector using gRPC.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Required, Default="localhost:4317", Format="`<host>:<port>`"_
|
||||||
|
|
||||||
|
Address of the OpenTelemetry Collector to send access logs to.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
endpoint: localhost:4317
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc]
|
||||||
|
endpoint = "localhost:4317"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc.endpoint=localhost:4317
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `insecure`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Allows exporter to send access logs to the OpenTelemetry Collector without using a secured protocol.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
insecure: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc]
|
||||||
|
insecure = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc.insecure=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with access logs by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc.headers.foo=bar --accesslog.otlp.grpc.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter to send access logs 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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc.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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--accesslog.otlp.grpc.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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--accesslog.otlp.grpc.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)"
|
||||||
|
accesslog:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[accesslog.otlp.grpc.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog.otlp.grpc.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
@ -66,7 +66,7 @@ log:
|
|||||||
|
|
||||||
By default, the `level` is set to `ERROR`.
|
By default, the `level` is set to `ERROR`.
|
||||||
|
|
||||||
Alternative logging levels are `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`, and `PANIC`.
|
Alternative logging levels are `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`, and `PANIC`.
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
log:
|
log:
|
||||||
@ -82,12 +82,517 @@ 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: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log]
|
||||||
|
compress = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.compress=true
|
||||||
|
```
|
||||||
|
|
||||||
|
## OpenTelemetry
|
||||||
|
|
||||||
|
!!! warning "Experimental Feature"
|
||||||
|
|
||||||
|
The OpenTelemetry logs feature is currently experimental and must be explicitly enabled in the experimental section prior to use.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
experimental:
|
||||||
|
otlpLogs: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[experimental.otlpLogs]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--experimental.otlpLogs=true
|
||||||
|
```
|
||||||
|
|
||||||
|
To enable the OpenTelemetry Logger for logs:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! info "Default protocol"
|
||||||
|
|
||||||
|
The OpenTelemetry Logger exporter will export logs to the collector using HTTPS by default to https://localhost:4318/v1/logs, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
||||||
|
|
||||||
|
### HTTP configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send logs to the OpenTelemetry Collector using HTTP.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
http: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.http]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.http=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Optional, Default="`https://localhost:4318/v1/logs`", Format="`<scheme>://<host>:<port><path>`"_
|
||||||
|
|
||||||
|
URL of the OpenTelemetry Collector to send logs to.
|
||||||
|
|
||||||
|
!!! info "Insecure mode"
|
||||||
|
|
||||||
|
To disable TLS, use `http://` instead of `https://` in the `endpoint` configuration.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
endpoint: https://collector:4318/v1/logs
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.http]
|
||||||
|
endpoint = "https://collector:4318/v1/logs"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.http.endpoint=https://collector:4318/v1/logs
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with logs by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.http.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.http.headers.foo=bar --log.otlp.http.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter to send logs 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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.http.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.http.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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--log.otlp.http.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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--log.otlp.http.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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.http.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.http.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
|
### gRPC configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send logs to the OpenTelemetry Collector using gRPC.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Required, Default="localhost:4317", Format="`<host>:<port>`"_
|
||||||
|
|
||||||
|
Address of the OpenTelemetry Collector to send logs to.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
endpoint: localhost:4317
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc]
|
||||||
|
endpoint = "localhost:4317"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc.endpoint=localhost:4317
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `insecure`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Allows exporter to send logs to the OpenTelemetry Collector without using a secured protocol.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
insecure: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc]
|
||||||
|
insecure = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc.insecure=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with logs by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc.headers.foo=bar --log.otlp.grpc.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter to send logs 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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc.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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--log.otlp.grpc.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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--log.otlp.grpc.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)"
|
||||||
|
log:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[log.otlp.grpc.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--log.otlp.grpc.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
@ -27,6 +27,10 @@ _Required, Default="127.0.0.1:8125"_
|
|||||||
|
|
||||||
Address instructs exporter to send metrics to datadog-agent at this address.
|
Address instructs exporter to send metrics to datadog-agent at this address.
|
||||||
|
|
||||||
|
This address can be a Unix Domain Socket (UDS) in the following format: `unix:///path/to/datadog.socket`.
|
||||||
|
When the prefix is set to `unix`, the socket type will be automatically determined.
|
||||||
|
To explicitly define the socket type and avoid automatic detection, you can use the prefixes `unixgram` for `SOCK_DGRAM` (datagram sockets) and `unixstream` for `SOCK_STREAM` (stream sockets), respectively.
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
metrics:
|
metrics:
|
||||||
datadog:
|
datadog:
|
||||||
@ -64,6 +68,7 @@ metrics:
|
|||||||
```bash tab="CLI"
|
```bash tab="CLI"
|
||||||
--metrics.datadog.addEntryPointsLabels=true
|
--metrics.datadog.addEntryPointsLabels=true
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `addRoutersLabels`
|
#### `addRoutersLabels`
|
||||||
|
|
||||||
_Optional, Default=false_
|
_Optional, Default=false_
|
||||||
|
@ -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
|
|
||||||
```
|
|
545
docs/content/observability/metrics/opentelemetry.md
Normal file
545
docs/content/observability/metrics/opentelemetry.md
Normal file
@ -0,0 +1,545 @@
|
|||||||
|
---
|
||||||
|
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 metrics:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! info "Default protocol"
|
||||||
|
|
||||||
|
The OpenTelemetry exporter will export metrics to the collector using HTTPS by default to https://localhost:4318/v1/metrics, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
||||||
|
|
||||||
|
#### `addEntryPointsLabels`
|
||||||
|
|
||||||
|
_Optional, Default=true_
|
||||||
|
|
||||||
|
Enable metrics on entry points.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
addEntryPointsLabels: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
addEntryPointsLabels = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.addEntryPointsLabels=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `addRoutersLabels`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Enable metrics on routers.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
addRoutersLabels: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
addRoutersLabels = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.addRoutersLabels=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `addServicesLabels`
|
||||||
|
|
||||||
|
_Optional, Default=true_
|
||||||
|
|
||||||
|
Enable metrics on services.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
addServicesLabels: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
addServicesLabels = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.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:
|
||||||
|
otlp:
|
||||||
|
explicitBoundaries:
|
||||||
|
- 0.1
|
||||||
|
- 0.3
|
||||||
|
- 1.2
|
||||||
|
- 5.0
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
explicitBoundaries = [0.1,0.3,1.2,5.0]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.explicitBoundaries=0.1,0.3,1.2,5.0
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `pushInterval`
|
||||||
|
|
||||||
|
_Optional, Default=10s_
|
||||||
|
|
||||||
|
Interval at which metrics are sent to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
pushInterval: 10s
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
pushInterval = "10s"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.pushInterval=10s
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `serviceName`
|
||||||
|
|
||||||
|
_Optional, Default="traefik"_
|
||||||
|
|
||||||
|
OTEL service name to use.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
serviceName: name
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
serviceName = "name"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.serviceName=name
|
||||||
|
```
|
||||||
|
|
||||||
|
### HTTP configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send the metrics to the OpenTelemetry Collector using HTTP.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
http: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.http]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.http=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Optional, Default="https://localhost:4318/v1/metrics", Format="`<scheme>://<host>:<port><path>`"_
|
||||||
|
|
||||||
|
URL of the OpenTelemetry Collector to send metrics to.
|
||||||
|
|
||||||
|
!!! info "Insecure mode"
|
||||||
|
|
||||||
|
To disable TLS, use `http://` instead of `https://` in the `endpoint` configuration.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
endpoint: https://collector:4318/v1/metrics
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.http]
|
||||||
|
endpoint = "https://collector:4318/v1/metrics"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.http.endpoint=https://collector:4318/v1/metrics
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with metrics by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.http.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.http.headers.foo=bar --metrics.otlp.http.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter 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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.http.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.http.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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--metrics.otlp.http.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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--metrics.otlp.http.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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.http.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.http.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
|
### gRPC configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send metrics to the OpenTelemetry Collector using gRPC.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
grpc: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.grpc]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Required, Default="localhost:4317", Format="`<host>:<port>`"_
|
||||||
|
|
||||||
|
Address of the OpenTelemetry Collector to send metrics to.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
endpoint: localhost:4317
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.grpc]
|
||||||
|
endpoint = "localhost:4317"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc.endpoint=localhost:4317
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `insecure`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Allows exporter to send metrics to the OpenTelemetry Collector without using a secured protocol.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
insecure: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.grpc]
|
||||||
|
insecure = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc.insecure=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with metrics by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp.grpc.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc.headers.foo=bar --metrics.otlp.grpc.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter 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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.grpc.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc.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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--metrics.otlp.grpc.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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--metrics.otlp.grpc.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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics.otlp.grpc.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.otlp.grpc.tls.insecureSkipVerify=true
|
||||||
|
```
|
@ -1,41 +1,76 @@
|
|||||||
---
|
---
|
||||||
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
|
||||||
|
|
||||||
Traefik supports these metrics backends:
|
Traefik provides metrics in the [OpenTelemetry](./opentelemetry.md) format as well as the following vendor specific 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.
|
||||||
|
|
||||||
|
## Common Options
|
||||||
|
|
||||||
|
### `addInternals`
|
||||||
|
|
||||||
|
_Optional, Default="false"_
|
||||||
|
|
||||||
|
Enables metrics for internal resources (e.g.: `ping@internals`).
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
metrics:
|
||||||
|
addInternals: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[metrics]
|
||||||
|
addInternals = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--metrics.addinternals
|
||||||
|
```
|
||||||
|
|
||||||
## 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. |
|
||||||
|
|
||||||
|
```opentelemetry tab="OpenTelemetry"
|
||||||
|
traefik_config_reloads_total
|
||||||
|
traefik_config_last_reload_success
|
||||||
|
traefik_open_connections
|
||||||
|
traefik_tls_certs_not_after
|
||||||
|
```
|
||||||
|
|
||||||
```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,25 +78,91 @@ 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
|
### 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" |
|
||||||
|
|
||||||
|
## OpenTelemetry Semantic Conventions
|
||||||
|
|
||||||
|
Traefik Proxy follows [official OpenTelemetry semantic conventions v1.23.1](https://github.com/open-telemetry/semantic-conventions/blob/v1.23.1/docs/http/http-metrics.md).
|
||||||
|
|
||||||
|
### HTTP Server
|
||||||
|
|
||||||
|
| Metric | Type | [Labels](#labels) | Description |
|
||||||
|
|-------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|
|
||||||
|
| http.server.request.duration | Histogram | `error.type`, `http.request.method`, `http.response.status_code`, `network.protocol.name`, `server.address`, `server.port`, `url.scheme` | Duration of HTTP server requests |
|
||||||
|
|
||||||
|
#### Labels
|
||||||
|
|
||||||
|
Here is a comprehensive list of labels that are provided by the metrics:
|
||||||
|
|
||||||
|
| Label | Description | example |
|
||||||
|
|-----------------------------|--------------------------------------------------------------|---------------|
|
||||||
|
| `error.type` | Describes a class of error the operation ended with | "500" |
|
||||||
|
| `http.request.method` | HTTP request method | "GET" |
|
||||||
|
| `http.response.status_code` | HTTP response status code | "200" |
|
||||||
|
| `network.protocol.name` | OSI application layer or non-OSI equivalent | "http/1.1" |
|
||||||
|
| `network.protocol.version` | Version of the protocol specified in `network.protocol.name` | "1.1" |
|
||||||
|
| `server.address` | Name of the local HTTP server that received the request | "example.com" |
|
||||||
|
| `server.port` | Port of the local HTTP server that received the request | "80" |
|
||||||
|
| `url.scheme` | The URI scheme component identifying the used protocol | "http" |
|
||||||
|
|
||||||
|
### HTTP Client
|
||||||
|
|
||||||
|
| Metric | Type | [Labels](#labels) | Description |
|
||||||
|
|-------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|
|
||||||
|
| http.client.request.duration | Histogram | `error.type`, `http.request.method`, `http.response.status_code`, `network.protocol.name`, `server.address`, `server.port`, `url.scheme` | Duration of HTTP client requests |
|
||||||
|
|
||||||
|
#### Labels
|
||||||
|
|
||||||
|
Here is a comprehensive list of labels that are provided by the metrics:
|
||||||
|
|
||||||
|
| Label | Description | example |
|
||||||
|
|-----------------------------|--------------------------------------------------------------|---------------|
|
||||||
|
| `error.type` | Describes a class of error the operation ended with | "500" |
|
||||||
|
| `http.request.method` | HTTP request method | "GET" |
|
||||||
|
| `http.response.status_code` | HTTP response status code | "200" |
|
||||||
|
| `network.protocol.name` | OSI application layer or non-OSI equivalent | "http/1.1" |
|
||||||
|
| `network.protocol.version` | Version of the protocol specified in `network.protocol.name` | "1.1" |
|
||||||
|
| `server.address` | Name of the local HTTP server that received the request | "example.com" |
|
||||||
|
| `server.port` | Port of the local HTTP server that received the request | "80" |
|
||||||
|
| `url.scheme` | The URI scheme component identifying the used protocol | "http" |
|
||||||
|
|
||||||
|
## HTTP Metrics
|
||||||
|
|
||||||
|
On top of the official OpenTelemetry semantic conventions, Traefik provides its own metrics to monitor the incoming traffic.
|
||||||
|
|
||||||
|
### 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. |
|
||||||
|
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
```prom tab="Prometheus"
|
```prom tab="Prometheus"
|
||||||
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 +171,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,27 +188,32 @@ 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
|
### 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. |
|
||||||
|
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
```prom tab="Prometheus"
|
```prom tab="Prometheus"
|
||||||
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 +222,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,28 +239,37 @@ 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
|
### 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. |
|
||||||
| 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. |
|
||||||
| Responses bytes total | Count | `code`, `method`, `protocol`, `service` | The total size of responses in bytes returned by a service. |
|
| Responses bytes total | Count | `code`, `method`, `protocol`, `service` | The total size of responses in bytes returned by a service. |
|
||||||
|
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
```prom tab="Prometheus"
|
```prom tab="Prometheus"
|
||||||
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_server_up
|
traefik_service_server_up
|
||||||
traefik_service_requests_bytes_total
|
traefik_service_requests_bytes_total
|
||||||
traefik_service_responses_bytes_total
|
traefik_service_responses_bytes_total
|
||||||
@ -168,17 +279,17 @@ 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.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.server.up
|
traefik.service.server.up
|
||||||
traefik.service.requests.bytes.total
|
traefik.service.requests.bytes.total
|
||||||
traefik.service.responses.bytes.total
|
traefik.service.responses.bytes.total
|
||||||
@ -189,13 +300,13 @@ 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.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
|
### 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:
|
||||||
|
|
||||||
|
106
docs/content/observability/overview.md
Normal file
106
docs/content/observability/overview.md
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
---
|
||||||
|
title: "Traefik Observability Overview"
|
||||||
|
description: "Traefik provides Logs, Access Logs, Metrics and Tracing. Read the full documentation to get started."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Overview
|
||||||
|
|
||||||
|
Traefik’s observability features include logs, access logs, metrics, and tracing. You can configure these options globally or at more specific levels, such as per router or per entry point.
|
||||||
|
|
||||||
|
## Configuration Example
|
||||||
|
|
||||||
|
Enable access logs, metrics, and tracing globally
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
accessLog: {}
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
otlp: {}
|
||||||
|
|
||||||
|
tracing: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="File (TOML)"
|
||||||
|
[accessLog]
|
||||||
|
|
||||||
|
[metrics]
|
||||||
|
[metrics.otlp]
|
||||||
|
|
||||||
|
[tracing]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--accesslog=true
|
||||||
|
--metrics.otlp=true
|
||||||
|
--tracing=true
|
||||||
|
```
|
||||||
|
|
||||||
|
You can disable access logs, metrics, and tracing for a specific entrypoint attached to a router:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
# Static Configuration
|
||||||
|
entryPoints:
|
||||||
|
EntryPoint0:
|
||||||
|
address: ':8000/udp'
|
||||||
|
observability:
|
||||||
|
accessLogs: false
|
||||||
|
tracing: false
|
||||||
|
metrics: false
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
# Static Configuration
|
||||||
|
[entryPoints.EntryPoint0]
|
||||||
|
address = ":8000/udp"
|
||||||
|
|
||||||
|
[entryPoints.EntryPoint0.observability]
|
||||||
|
accessLogs = false
|
||||||
|
tracing = false
|
||||||
|
metrics = false
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# Static Configuration
|
||||||
|
--entryPoints.EntryPoint0.address=:8000/udp
|
||||||
|
--entryPoints.EntryPoint0.observability.accessLogs=false
|
||||||
|
--entryPoints.EntryPoint0.observability.metrics=false
|
||||||
|
--entryPoints.EntryPoint0.observability.tracing=false
|
||||||
|
```
|
||||||
|
|
||||||
|
!!!note "Default Behavior"
|
||||||
|
A router with its own observability configuration will override the global default.
|
||||||
|
|
||||||
|
## Configuration Options
|
||||||
|
|
||||||
|
### Logs
|
||||||
|
|
||||||
|
Traefik logs informs about everything that happens within Traefik (startup, configuration, events, shutdown, and so on).
|
||||||
|
|
||||||
|
Read the [Logs documentation](./logs.md) to learn how to configure it.
|
||||||
|
|
||||||
|
### Access Logs
|
||||||
|
|
||||||
|
Access logs are a key part of observability in Traefik.
|
||||||
|
|
||||||
|
They are providing valuable insights about incoming traffic, and allow to monitor it.
|
||||||
|
The access logs record detailed information about each request received by Traefik,
|
||||||
|
including the source IP address, requested URL, response status code, and more.
|
||||||
|
|
||||||
|
Read the [Access Logs documentation](./access-logs.md) to learn how to configure it.
|
||||||
|
|
||||||
|
### Metrics
|
||||||
|
|
||||||
|
Traefik offers a metrics feature that provides valuable insights about the performance and usage.
|
||||||
|
These metrics include the number of requests received, the requests duration, and more.
|
||||||
|
|
||||||
|
On top of supporting metrics in the OpenTelemetry format, Traefik supports the following vendor specific metrics systems: Prometheus, Datadog, InfluxDB 2.X, and StatsD.
|
||||||
|
|
||||||
|
Read the [Metrics documentation](./metrics/overview.md) to learn how to configure it.
|
||||||
|
|
||||||
|
### Tracing
|
||||||
|
|
||||||
|
The Traefik tracing system allows developers to gain deep visibility into the flow of requests through their infrastructure.
|
||||||
|
|
||||||
|
Traefik provides tracing information in the OpenTelemery format.
|
||||||
|
|
||||||
|
Read the [Tracing documentation](./tracing/overview.md) to learn how to configure it.
|
@ -1,163 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Traefik Datadog Tracing Documentation"
|
|
||||||
description: "Traefik Proxy supports Datadog for tracing. Read the technical documentation to enable Datadog for observability."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Datadog
|
|
||||||
|
|
||||||
To enable the Datadog tracer:
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
datadog: {}
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.datadog]
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.datadog=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `localAgentHostPort`
|
|
||||||
|
|
||||||
_Optional, Default="localhost:8126"_
|
|
||||||
|
|
||||||
Local Agent Host Port instructs the reporter to send spans to the Datadog Agent at this address (host:port).
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
datadog:
|
|
||||||
localAgentHostPort: localhost:8126
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.datadog]
|
|
||||||
localAgentHostPort = "localhost:8126"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--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`
|
|
||||||
|
|
||||||
_Optional, Default=false_
|
|
||||||
|
|
||||||
Enables Datadog debug.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
datadog:
|
|
||||||
debug: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.datadog]
|
|
||||||
debug = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--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`
|
|
||||||
|
|
||||||
_Optional, Default=empty_
|
|
||||||
|
|
||||||
Applies a list of shared key:value tags on all spans.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
datadog:
|
|
||||||
globalTags:
|
|
||||||
tag1: foo
|
|
||||||
tag2: bar
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.datadog]
|
|
||||||
[tracing.datadog.globalTags]
|
|
||||||
tag1 = "foo"
|
|
||||||
tag2 = "bar"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.datadog.globalTags.tag1=foo
|
|
||||||
--tracing.datadog.globalTags.tag2=bar
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `prioritySampling`
|
|
||||||
|
|
||||||
_Optional, Default=false_
|
|
||||||
|
|
||||||
Enables priority sampling.
|
|
||||||
When using distributed tracing,
|
|
||||||
this option must be enabled in order to get all the parts of a distributed trace sampled.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
datadog:
|
|
||||||
prioritySampling: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.datadog]
|
|
||||||
prioritySampling = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.datadog.prioritySampling=true
|
|
||||||
```
|
|
@ -1,93 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Traefik Elastic Documentation"
|
|
||||||
description: "Traefik supports several tracing backends, including Elastic. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Elastic
|
|
||||||
|
|
||||||
To enable the Elastic tracer:
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
elastic: {}
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.elastic]
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.elastic=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `serverURL`
|
|
||||||
|
|
||||||
_Optional, Default="http://localhost:8200"_
|
|
||||||
|
|
||||||
URL of the Elastic APM server.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
elastic:
|
|
||||||
serverURL: "http://apm:8200"
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.elastic]
|
|
||||||
serverURL = "http://apm:8200"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.elastic.serverurl="http://apm:8200"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `secretToken`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
Token used to connect to Elastic APM Server.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
elastic:
|
|
||||||
secretToken: "mytoken"
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.elastic]
|
|
||||||
secretToken = "mytoken"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.elastic.secrettoken="mytoken"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `serviceEnvironment`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
Environment's name where Traefik is deployed in, e.g. `production` or `staging`.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
elastic:
|
|
||||||
serviceEnvironment: "production"
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.elastic]
|
|
||||||
serviceEnvironment = "production"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.elastic.serviceenvironment="production"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Further
|
|
||||||
|
|
||||||
Additional configuration of Elastic APM Go agent can be done using environment variables.
|
|
||||||
See [APM Go agent reference](https://www.elastic.co/guide/en/apm/agent/go/current/configuration.html).
|
|
@ -1,176 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Traefik Haystack Documentation"
|
|
||||||
description: "Traefik supports several tracing backends, including Haystack. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Haystack
|
|
||||||
|
|
||||||
To enable the Haystack tracer:
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack: {}
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `localAgentHost`
|
|
||||||
|
|
||||||
_Required, Default="127.0.0.1"_
|
|
||||||
|
|
||||||
Local Agent Host instructs reporter to send spans to the Haystack Agent at this address.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack:
|
|
||||||
localAgentHost: 127.0.0.1
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
localAgentHost = "127.0.0.1"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack.localAgentHost=127.0.0.1
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `localAgentPort`
|
|
||||||
|
|
||||||
_Required, Default=35000_
|
|
||||||
|
|
||||||
Local Agent Port instructs reporter to send spans to the Haystack Agent at this port.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack:
|
|
||||||
localAgentPort: 35000
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
localAgentPort = 35000
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack.localAgentPort=35000
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `globalTag`
|
|
||||||
|
|
||||||
_Optional, Default=empty_
|
|
||||||
|
|
||||||
Applies shared key:value tag on all spans.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack:
|
|
||||||
globalTag: sample:test
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
globalTag = "sample:test"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack.globalTag=sample:test
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `traceIDHeaderName`
|
|
||||||
|
|
||||||
_Optional, Default=empty_
|
|
||||||
|
|
||||||
Sets the header name used to store the trace ID.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack:
|
|
||||||
traceIDHeaderName: Trace-ID
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
traceIDHeaderName = "Trace-ID"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack.traceIDHeaderName=Trace-ID
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `parentIDHeaderName`
|
|
||||||
|
|
||||||
_Optional, Default=empty_
|
|
||||||
|
|
||||||
Sets the header name used to store the parent ID.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack:
|
|
||||||
parentIDHeaderName: Parent-Message-ID
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
parentIDHeaderName = "Parent-Message-ID"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack.parentIDHeaderName=Parent-Message-ID
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `spanIDHeaderName`
|
|
||||||
|
|
||||||
_Optional, Default=empty_
|
|
||||||
|
|
||||||
Sets the header name used to store the span ID.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack:
|
|
||||||
spanIDHeaderName: Message-ID
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
spanIDHeaderName = "Message-ID"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack.spanIDHeaderName=Message-ID
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `baggagePrefixHeaderName`
|
|
||||||
|
|
||||||
_Optional, Default=empty_
|
|
||||||
|
|
||||||
Sets the header name prefix used to store baggage items in a map.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
haystack:
|
|
||||||
baggagePrefixHeaderName: "sample"
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.haystack]
|
|
||||||
baggagePrefixHeaderName = "sample"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.haystack.baggagePrefixHeaderName=sample
|
|
||||||
```
|
|
@ -1,117 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Traefik Instana Documentation"
|
|
||||||
description: "Traefik supports several tracing backends, including Instana. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Instana
|
|
||||||
|
|
||||||
To enable the Instana tracer:
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
instana: {}
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.instana]
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.instana=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `localAgentHost`
|
|
||||||
|
|
||||||
_Required, Default="127.0.0.1"_
|
|
||||||
|
|
||||||
Local Agent Host instructs reporter to send spans to the Instana Agent at this address.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
instana:
|
|
||||||
localAgentHost: 127.0.0.1
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.instana]
|
|
||||||
localAgentHost = "127.0.0.1"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.instana.localAgentHost=127.0.0.1
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `localAgentPort`
|
|
||||||
|
|
||||||
_Required, Default=42699_
|
|
||||||
|
|
||||||
Local Agent port instructs reporter to send spans to the Instana Agent listening on this port.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
instana:
|
|
||||||
localAgentPort: 42699
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.instana]
|
|
||||||
localAgentPort = 42699
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.instana.localAgentPort=42699
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `logLevel`
|
|
||||||
|
|
||||||
_Required, Default="info"_
|
|
||||||
|
|
||||||
Sets Instana tracer log level.
|
|
||||||
|
|
||||||
Valid values are:
|
|
||||||
|
|
||||||
- `error`
|
|
||||||
- `warn`
|
|
||||||
- `debug`
|
|
||||||
- `info`
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
instana:
|
|
||||||
logLevel: info
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.instana]
|
|
||||||
logLevel = "info"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.instana.logLevel=info
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `enableAutoProfile`
|
|
||||||
|
|
||||||
_Required, Default=false_
|
|
||||||
|
|
||||||
Enables [automatic profiling](https://www.ibm.com/docs/en/obi/current?topic=instana-profile-processes) for the Traefik process.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
instana:
|
|
||||||
enableAutoProfile: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.instana]
|
|
||||||
enableAutoProfile = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.instana.enableAutoProfile=true
|
|
||||||
```
|
|
@ -1,294 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Traefik Jaeger Documentation"
|
|
||||||
description: "Traefik supports several tracing backends, including Jaeger. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Jaeger
|
|
||||||
|
|
||||||
To enable the Jaeger tracer:
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger: {}
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger=true
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
Traefik is able to send data over the compact thrift protocol to the [Jaeger agent](https://www.jaegertracing.io/docs/deployment/#agent)
|
|
||||||
or a [Jaeger collector](https://www.jaegertracing.io/docs/deployment/#collector).
|
|
||||||
|
|
||||||
!!! info
|
|
||||||
All Jaeger configuration can be overridden by [environment variables](https://github.com/jaegertracing/jaeger-client-go#environment-variables)
|
|
||||||
|
|
||||||
#### `samplingServerURL`
|
|
||||||
|
|
||||||
_Required, Default="http://localhost:5778/sampling"_
|
|
||||||
|
|
||||||
Address of the Jaeger Agent HTTP sampling server.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
samplingServerURL: http://localhost:5778/sampling
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
samplingServerURL = "http://localhost:5778/sampling"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.samplingServerURL=http://localhost:5778/sampling
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `samplingType`
|
|
||||||
|
|
||||||
_Required, Default="const"_
|
|
||||||
|
|
||||||
Type of the sampler.
|
|
||||||
|
|
||||||
Valid values are:
|
|
||||||
|
|
||||||
- `const`
|
|
||||||
- `probabilistic`
|
|
||||||
- `rateLimiting`
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
samplingType: const
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
samplingType = "const"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.samplingType=const
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `samplingParam`
|
|
||||||
|
|
||||||
_Required, Default=1.0_
|
|
||||||
|
|
||||||
Value passed to the sampler.
|
|
||||||
|
|
||||||
Valid values are:
|
|
||||||
|
|
||||||
- for `const` sampler, 0 or 1 for always false/true respectively
|
|
||||||
- for `probabilistic` sampler, a probability between 0 and 1
|
|
||||||
- for `rateLimiting` sampler, the number of spans per second
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
samplingParam: 1.0
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
samplingParam = 1.0
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.samplingParam=1.0
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `localAgentHostPort`
|
|
||||||
|
|
||||||
_Required, Default="127.0.0.1:6831"_
|
|
||||||
|
|
||||||
Local Agent Host Port instructs the reporter to send spans to the Jaeger Agent at this address (host:port).
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
localAgentHostPort: 127.0.0.1:6831
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
localAgentHostPort = "127.0.0.1:6831"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.localAgentHostPort=127.0.0.1:6831
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `gen128Bit`
|
|
||||||
|
|
||||||
_Optional, Default=false_
|
|
||||||
|
|
||||||
Generates 128 bits trace IDs, compatible with OpenCensus.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
gen128Bit: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
gen128Bit = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.gen128Bit
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `propagation`
|
|
||||||
|
|
||||||
_Required, Default="jaeger"_
|
|
||||||
|
|
||||||
Sets the propagation header type.
|
|
||||||
|
|
||||||
Valid values are:
|
|
||||||
|
|
||||||
- `jaeger`, jaeger's default trace header.
|
|
||||||
- `b3`, compatible with OpenZipkin
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
propagation: jaeger
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
propagation = "jaeger"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.propagation=jaeger
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `traceContextHeaderName`
|
|
||||||
|
|
||||||
_Required, Default="uber-trace-id"_
|
|
||||||
|
|
||||||
HTTP header name used to propagate tracing context.
|
|
||||||
This must be in lower-case to avoid mismatches when decoding incoming headers.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
traceContextHeaderName: uber-trace-id
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
traceContextHeaderName = "uber-trace-id"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.traceContextHeaderName=uber-trace-id
|
|
||||||
```
|
|
||||||
|
|
||||||
### disableAttemptReconnecting
|
|
||||||
|
|
||||||
_Optional, Default=true_
|
|
||||||
|
|
||||||
Disables the UDP connection helper that periodically re-resolves the agent's hostname and reconnects if there was a change.
|
|
||||||
Enabling the re-resolving of UDP address make the client more robust in Kubernetes deployments.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
disableAttemptReconnecting: false
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger]
|
|
||||||
disableAttemptReconnecting = false
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.disableAttemptReconnecting=false
|
|
||||||
```
|
|
||||||
|
|
||||||
### `collector`
|
|
||||||
#### `endpoint`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
Collector Endpoint instructs the reporter to send spans to the Jaeger Collector at this URL.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
collector:
|
|
||||||
endpoint: http://127.0.0.1:14268/api/traces?format=jaeger.thrift
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger.collector]
|
|
||||||
endpoint = "http://127.0.0.1:14268/api/traces?format=jaeger.thrift"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.collector.endpoint=http://127.0.0.1:14268/api/traces?format=jaeger.thrift
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `user`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
User instructs the reporter to include a user for basic HTTP authentication when sending spans to the Jaeger Collector.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
collector:
|
|
||||||
user: my-user
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger.collector]
|
|
||||||
user = "my-user"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.collector.user=my-user
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `password`
|
|
||||||
|
|
||||||
_Optional, Default=""_
|
|
||||||
|
|
||||||
Password instructs the reporter to include a password for basic HTTP authentication when sending spans to the Jaeger Collector.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
jaeger:
|
|
||||||
collector:
|
|
||||||
password: my-password
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.jaeger.collector]
|
|
||||||
password = "my-password"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.jaeger.collector.password=my-password
|
|
||||||
```
|
|
432
docs/content/observability/tracing/opentelemetry.md
Normal file
432
docs/content/observability/tracing/opentelemetry.md
Normal file
@ -0,0 +1,432 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
|
|
||||||
|
Traefik Proxy follows [official OpenTelemetry semantic conventions v1.26.0](https://github.com/open-telemetry/semantic-conventions/blob/v1.26.0/docs/http/http-spans.md).
|
||||||
|
|
||||||
|
To enable the OpenTelemetry tracer:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp=true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! info "Default protocol"
|
||||||
|
|
||||||
|
The OpenTelemetry trace exporter will export traces to the collector using HTTPS by default to https://localhost:4318/v1/traces, see the [gRPC Section](#grpc-configuration) to use gRPC.
|
||||||
|
|
||||||
|
!!! info "Trace sampling"
|
||||||
|
|
||||||
|
By default, the OpenTelemetry trace exporter 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.
|
||||||
|
|
||||||
|
!!! info "Propagation"
|
||||||
|
|
||||||
|
Traefik supports the `OTEL_PROPAGATORS` env variable to set up the propragators. The supported propagators are:
|
||||||
|
|
||||||
|
- tracecontext (default)
|
||||||
|
- baggage (default)
|
||||||
|
- b3
|
||||||
|
- b3multi
|
||||||
|
- jaeger
|
||||||
|
- xray
|
||||||
|
- ottrace
|
||||||
|
|
||||||
|
Example of configuration:
|
||||||
|
|
||||||
|
OTEL_PROPAGATORS=b3,jaeger
|
||||||
|
|
||||||
|
|
||||||
|
### HTTP configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send spans to the OpenTelemetry Collector using HTTP.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp:
|
||||||
|
http: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp.http]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.http=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Optional, Default="https://localhost:4318/v1/traces", Format="`<scheme>://<host>:<port><path>`"_
|
||||||
|
|
||||||
|
URL of the OpenTelemetry Collector to send spans to.
|
||||||
|
|
||||||
|
!!! info "Insecure mode"
|
||||||
|
|
||||||
|
To disable TLS, use `http://` instead of `https://` in the `endpoint` configuration.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
endpoint: https://collector:4318/v1/traces
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp.http]
|
||||||
|
endpoint = "https://collector:4318/v1/traces"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.http.endpoint=https://collector:4318/v1/traces
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with traces by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp.http.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.http.headers.foo=bar --tracing.otlp.http.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter 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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.http.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.http.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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--tracing.otlp.http.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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.http.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.http.tls.cert=path/to/foo.cert
|
||||||
|
--tracing.otlp.http.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:
|
||||||
|
otlp:
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.http.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.http.tls.insecureSkipVerify=true
|
||||||
|
```
|
||||||
|
|
||||||
|
### gRPC configuration
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
This instructs the exporter to send spans to the OpenTelemetry Collector using gRPC.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp:
|
||||||
|
grpc: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp.grpc]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `endpoint`
|
||||||
|
|
||||||
|
_Required, Default="localhost:4317", Format="`<host>:<port>`"_
|
||||||
|
|
||||||
|
Address of the OpenTelemetry Collector to send spans to.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
endpoint: localhost:4317
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp.grpc]
|
||||||
|
endpoint = "localhost:4317"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc.endpoint=localhost:4317
|
||||||
|
```
|
||||||
|
#### `insecure`
|
||||||
|
|
||||||
|
_Optional, Default=false_
|
||||||
|
|
||||||
|
Allows exporter to send spans to the OpenTelemetry Collector without using a secured protocol.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
insecure: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp.grpc]
|
||||||
|
insecure = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc.insecure=true
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `headers`
|
||||||
|
|
||||||
|
_Optional, Default={}_
|
||||||
|
|
||||||
|
Additional headers sent with traces by the exporter to the OpenTelemetry Collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
headers:
|
||||||
|
foo: bar
|
||||||
|
baz: buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.otlp.grpc.headers]
|
||||||
|
foo = "bar"
|
||||||
|
baz = "buz"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc.headers.foo=bar --tracing.otlp.grpc.headers.baz=buz
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `tls`
|
||||||
|
|
||||||
|
_Optional_
|
||||||
|
|
||||||
|
Defines the Client TLS configuration used by the exporter 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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
ca: path/to/ca.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.grpc.tls]
|
||||||
|
ca = "path/to/ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc.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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--tracing.otlp.grpc.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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
cert: path/to/foo.cert
|
||||||
|
key: path/to/foo.key
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.grpc.tls]
|
||||||
|
cert = "path/to/foo.cert"
|
||||||
|
key = "path/to/foo.key"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc.tls.cert=path/to/foo.cert
|
||||||
|
--tracing.otlp.grpc.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:
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
tls:
|
||||||
|
insecureSkipVerify: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing.otlp.grpc.tls]
|
||||||
|
insecureSkipVerify = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.otlp.grpc.tls.insecureSkipVerify=true
|
||||||
|
```
|
@ -10,21 +10,12 @@ Visualize the Requests Flow
|
|||||||
|
|
||||||
The tracing system allows developers to visualize call flows in their infrastructure.
|
The tracing system allows developers to visualize call flows in their infrastructure.
|
||||||
|
|
||||||
Traefik uses OpenTracing, an open standard designed for distributed tracing.
|
Traefik uses [OpenTelemetry](https://opentelemetry.io/ "Link to website of OTel"), an open standard designed for distributed tracing.
|
||||||
|
|
||||||
Traefik supports six tracing backends:
|
Please check our dedicated [OTel docs](./opentelemetry.md) to learn more.
|
||||||
|
|
||||||
- [Jaeger](./jaeger.md)
|
|
||||||
- [Zipkin](./zipkin.md)
|
|
||||||
- [Datadog](./datadog.md)
|
|
||||||
- [Instana](./instana.md)
|
|
||||||
- [Haystack](./haystack.md)
|
|
||||||
- [Elastic](./elastic.md)
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
By default, Traefik uses Jaeger as tracing backend.
|
|
||||||
|
|
||||||
To enable the tracing:
|
To enable the tracing:
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
@ -41,6 +32,26 @@ tracing: {}
|
|||||||
|
|
||||||
### Common Options
|
### Common Options
|
||||||
|
|
||||||
|
#### `addInternals`
|
||||||
|
|
||||||
|
_Optional, Default="false"_
|
||||||
|
|
||||||
|
Enables tracing for internal resources (e.g.: `ping@internal`).
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
addInternals: true
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
addInternals = true
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.addinternals
|
||||||
|
```
|
||||||
|
|
||||||
#### `serviceName`
|
#### `serviceName`
|
||||||
|
|
||||||
_Required, Default="traefik"_
|
_Required, Default="traefik"_
|
||||||
@ -61,25 +72,116 @@ tracing:
|
|||||||
--tracing.serviceName=traefik
|
--tracing.serviceName=traefik
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `spanNameLimit`
|
#### `sampleRate`
|
||||||
|
|
||||||
_Required, Default=0_
|
_Optional, Default=1.0_
|
||||||
|
|
||||||
Span name limit allows for name truncation in case of very long names.
|
The proportion of requests to trace, specified between 0.0 and 1.0.
|
||||||
This can prevent certain tracing providers to drop traces that exceed their length limits.
|
|
||||||
|
|
||||||
`0` means no truncation will occur.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
tracing:
|
tracing:
|
||||||
spanNameLimit: 150
|
sampleRate: 0.2
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
[tracing]
|
[tracing]
|
||||||
spanNameLimit = 150
|
sampleRate = 0.2
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash tab="CLI"
|
```bash tab="CLI"
|
||||||
--tracing.spanNameLimit=150
|
--tracing.sampleRate=0.2
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `resourceAttributes`
|
||||||
|
|
||||||
|
_Optional, Default=empty_
|
||||||
|
|
||||||
|
Defines additional resource attributes to be sent to the collector.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
resourceAttributes:
|
||||||
|
attr1: foo
|
||||||
|
attr2: bar
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
[tracing.resourceAttributes]
|
||||||
|
attr1 = "foo"
|
||||||
|
attr2 = "bar"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.resourceAttributes.attr1=foo
|
||||||
|
--tracing.resourceAttributes.attr2=bar
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `capturedRequestHeaders`
|
||||||
|
|
||||||
|
_Optional, Default=empty_
|
||||||
|
|
||||||
|
Defines the list of request headers to add as attributes.
|
||||||
|
It applies to client and server kind spans.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
capturedRequestHeaders:
|
||||||
|
- X-CustomHeader
|
||||||
|
- X-OtherHeader
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
capturedRequestHeaders = ["X-CustomHeader", "X-OtherHeader"]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.capturedRequestHeaders="X-CustomHeader,X-OtherHeader"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `capturedResponseHeaders`
|
||||||
|
|
||||||
|
_Optional, Default=empty_
|
||||||
|
|
||||||
|
Defines the list of response headers to add as attributes.
|
||||||
|
It applies to client and server kind spans.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
capturedResponseHeaders:
|
||||||
|
- X-CustomHeader
|
||||||
|
- X-OtherHeader
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
capturedResponseHeaders = ["X-CustomHeader", "X-OtherHeader"]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.capturedResponseHeaders="X-CustomHeader,X-OtherHeader"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `safeQueryParams`
|
||||||
|
|
||||||
|
_Optional, Default=[]_
|
||||||
|
|
||||||
|
By default, all query parameters are redacted.
|
||||||
|
Defines the list of query parameters to not redact.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
tracing:
|
||||||
|
safeQueryParams:
|
||||||
|
- bar
|
||||||
|
- buz
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[tracing]
|
||||||
|
safeQueryParams = ["bar", "buz"]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--tracing.safeQueryParams=bar,buz
|
||||||
```
|
```
|
||||||
|
@ -1,110 +0,0 @@
|
|||||||
---
|
|
||||||
title: "Traefik Zipkin Documentation"
|
|
||||||
description: "Traefik supports several tracing backends, including Zipkin. Learn how to implement it for observability in Traefik Proxy. Read the technical documentation."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Zipkin
|
|
||||||
|
|
||||||
To enable the Zipkin tracer:
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
zipkin: {}
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.zipkin]
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.zipkin=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `httpEndpoint`
|
|
||||||
|
|
||||||
_Required, Default="http://localhost:9411/api/v2/spans"_
|
|
||||||
|
|
||||||
HTTP endpoint used to send data.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
zipkin:
|
|
||||||
httpEndpoint: http://localhost:9411/api/v2/spans
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.zipkin]
|
|
||||||
httpEndpoint = "http://localhost:9411/api/v2/spans"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.zipkin.httpEndpoint=http://localhost:9411/api/v2/spans
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `sameSpan`
|
|
||||||
|
|
||||||
_Optional, Default=false_
|
|
||||||
|
|
||||||
Uses SameSpan RPC style traces.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
zipkin:
|
|
||||||
sameSpan: true
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.zipkin]
|
|
||||||
sameSpan = true
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.zipkin.sameSpan=true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `id128Bit`
|
|
||||||
|
|
||||||
_Optional, Default=true_
|
|
||||||
|
|
||||||
Uses 128 bits trace IDs.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
zipkin:
|
|
||||||
id128Bit: false
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.zipkin]
|
|
||||||
id128Bit = false
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.zipkin.id128Bit=false
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `sampleRate`
|
|
||||||
|
|
||||||
_Required, Default=1.0_
|
|
||||||
|
|
||||||
The proportion of requests to trace, specified between 0.0 and 1.0.
|
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
|
||||||
tracing:
|
|
||||||
zipkin:
|
|
||||||
sampleRate: 0.2
|
|
||||||
```
|
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
|
||||||
[tracing]
|
|
||||||
[tracing.zipkin]
|
|
||||||
sampleRate = 0.2
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash tab="CLI"
|
|
||||||
--tracing.zipkin.sampleRate=0.2
|
|
||||||
```
|
|
@ -145,34 +145,35 @@ All the following endpoints must be accessed with a `GET` HTTP request.
|
|||||||
curl https://traefik.example.com:8080/api/http/routers?page=2&per_page=20
|
curl https://traefik.example.com:8080/api/http/routers?page=2&per_page=20
|
||||||
```
|
```
|
||||||
|
|
||||||
| Path | Description |
|
| Path | Description |
|
||||||
|--------------------------------|---------------------------------------------------------------------------------------------|
|
|--------------------------------|-----------------------------------------------------------------------------------------------------|
|
||||||
| `/api/http/routers` | Lists all the HTTP routers information. |
|
| `/api/http/routers` | Lists all the HTTP routers information. |
|
||||||
| `/api/http/routers/{name}` | Returns the information of the HTTP router specified by `name`. |
|
| `/api/http/routers/{name}` | Returns the information of the HTTP router specified by `name`. |
|
||||||
| `/api/http/services` | Lists all the HTTP services information. |
|
| `/api/http/services` | Lists all the HTTP services information. |
|
||||||
| `/api/http/services/{name}` | Returns the information of the HTTP service specified by `name`. |
|
| `/api/http/services/{name}` | Returns the information of the HTTP service specified by `name`. |
|
||||||
| `/api/http/middlewares` | Lists all the HTTP middlewares information. |
|
| `/api/http/middlewares` | Lists all the HTTP middlewares information. |
|
||||||
| `/api/http/middlewares/{name}` | Returns the information of the HTTP middleware specified by `name`. |
|
| `/api/http/middlewares/{name}` | Returns the information of the HTTP middleware specified by `name`. |
|
||||||
| `/api/tcp/routers` | Lists all the TCP routers information. |
|
| `/api/tcp/routers` | Lists all the TCP routers information. |
|
||||||
| `/api/tcp/routers/{name}` | Returns the information of the TCP router specified by `name`. |
|
| `/api/tcp/routers/{name}` | Returns the information of the TCP router specified by `name`. |
|
||||||
| `/api/tcp/services` | Lists all the TCP services information. |
|
| `/api/tcp/services` | Lists all the TCP services information. |
|
||||||
| `/api/tcp/services/{name}` | Returns the information of the TCP service specified by `name`. |
|
| `/api/tcp/services/{name}` | Returns the information of the TCP service specified by `name`. |
|
||||||
| `/api/tcp/middlewares` | Lists all the TCP middlewares information. |
|
| `/api/tcp/middlewares` | Lists all the TCP middlewares information. |
|
||||||
| `/api/tcp/middlewares/{name}` | Returns the information of the TCP middleware specified by `name`. |
|
| `/api/tcp/middlewares/{name}` | Returns the information of the TCP middleware specified by `name`. |
|
||||||
| `/api/udp/routers` | Lists all the UDP routers information. |
|
| `/api/udp/routers` | Lists all the UDP routers information. |
|
||||||
| `/api/udp/routers/{name}` | Returns the information of the UDP router specified by `name`. |
|
| `/api/udp/routers/{name}` | Returns the information of the UDP router specified by `name`. |
|
||||||
| `/api/udp/services` | Lists all the UDP services information. |
|
| `/api/udp/services` | Lists all the UDP services information. |
|
||||||
| `/api/udp/services/{name}` | Returns the information of the UDP service specified by `name`. |
|
| `/api/udp/services/{name}` | Returns the information of the UDP service specified by `name`. |
|
||||||
| `/api/entrypoints` | Lists all the entry points information. |
|
| `/api/entrypoints` | Lists all the entry points information. |
|
||||||
| `/api/entrypoints/{name}` | Returns the information of the entry point specified by `name`. |
|
| `/api/entrypoints/{name}` | Returns the information of the entry point specified by `name`. |
|
||||||
| `/api/overview` | Returns statistic information about http and tcp as well as enabled features and providers. |
|
| `/api/overview` | Returns statistic information about http and tcp as well as enabled features and providers. |
|
||||||
| `/api/rawdata` | Returns information about dynamic configurations, errors, status and dependency relations. |
|
| `/api/support-dump` | Returns an archive that contains the anonymized static configuration and the runtime configuration. |
|
||||||
| `/api/version` | Returns information about Traefik version. |
|
| `/api/rawdata` | Returns information about dynamic configurations, errors, status and dependency relations. |
|
||||||
| `/debug/vars` | See the [expvar](https://golang.org/pkg/expvar/) Go documentation. |
|
| `/api/version` | Returns information about Traefik version. |
|
||||||
| `/debug/pprof/` | See the [pprof Index](https://golang.org/pkg/net/http/pprof/#Index) Go documentation. |
|
| `/debug/vars` | See the [expvar](https://golang.org/pkg/expvar/) Go documentation. |
|
||||||
| `/debug/pprof/cmdline` | See the [pprof Cmdline](https://golang.org/pkg/net/http/pprof/#Cmdline) Go documentation. |
|
| `/debug/pprof/` | See the [pprof Index](https://golang.org/pkg/net/http/pprof/#Index) Go documentation. |
|
||||||
| `/debug/pprof/profile` | See the [pprof Profile](https://golang.org/pkg/net/http/pprof/#Profile) Go documentation. |
|
| `/debug/pprof/cmdline` | See the [pprof Cmdline](https://golang.org/pkg/net/http/pprof/#Cmdline) Go documentation. |
|
||||||
| `/debug/pprof/symbol` | See the [pprof Symbol](https://golang.org/pkg/net/http/pprof/#Symbol) Go documentation. |
|
| `/debug/pprof/profile` | See the [pprof Profile](https://golang.org/pkg/net/http/pprof/#Profile) Go documentation. |
|
||||||
| `/debug/pprof/trace` | See the [pprof Trace](https://golang.org/pkg/net/http/pprof/#Trace) Go documentation. |
|
| `/debug/pprof/symbol` | See the [pprof Symbol](https://golang.org/pkg/net/http/pprof/#Symbol) Go documentation. |
|
||||||
|
| `/debug/pprof/trace` | See the [pprof Trace](https://golang.org/pkg/net/http/pprof/#Trace) Go documentation. |
|
||||||
|
|
||||||
{!traefik-for-business-applications.md!}
|
{!traefik-for-business-applications.md!}
|
||||||
|
@ -55,7 +55,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 to as "Traefik-ception").
|
through Traefik itself (sometimes referred to as "Traefik-ception").
|
||||||
@ -76,19 +76,55 @@ 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"
|
||||||
--8<-- "content/operations/include-dashboard-examples.md"
|
--8<-- "content/operations/include-dashboard-examples.md"
|
||||||
|
|
||||||
|
### Custom API Base Path
|
||||||
|
|
||||||
|
As shown above, by default Traefik exposes its API and Dashboard under the `/` base path,
|
||||||
|
which means that respectively the API is served under the `/api` path,
|
||||||
|
and the dashboard under the `/dashboard` path.
|
||||||
|
|
||||||
|
However, it is possible to configure this base path:
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
api:
|
||||||
|
# Customizes the base path:
|
||||||
|
# - Serving API under `/traefik/api`
|
||||||
|
# - Serving Dashboard under `/traefik/dashboard`
|
||||||
|
basePath: /traefik
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[api]
|
||||||
|
# Customizes the base path:
|
||||||
|
# - Serving API under `/traefik/api`
|
||||||
|
# - Serving Dashboard under `/traefik/dashboard`
|
||||||
|
basePath = "/traefik"
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
# Customizes the base path:
|
||||||
|
# - Serving API under `/traefik/api`
|
||||||
|
# - Serving Dashboard under `/traefik/dashboard`
|
||||||
|
--api.basePath=/traefik
|
||||||
|
```
|
||||||
|
|
||||||
|
??? example "Dashboard Under Custom Path Dynamic Configuration Examples"
|
||||||
|
--8<-- "content/operations/include-dashboard-custom-path-examples.md"
|
||||||
|
|
||||||
## Insecure Mode
|
## Insecure Mode
|
||||||
|
|
||||||
|
!!! warning "Please note that this mode is incompatible with the [custom API base path option](#custom-api-base-path)."
|
||||||
|
|
||||||
When _insecure_ mode is enabled, one can access the dashboard on the `traefik` port (default: `8080`) of the Traefik instance,
|
When _insecure_ mode is enabled, one can access the dashboard on the `traefik` port (default: `8080`) of the Traefik instance,
|
||||||
at the following URL: `http://<Traefik IP>:8080/dashboard/` (trailing slash is mandatory).
|
at the following URL: `http://<Traefik IP>:8080/dashboard/` (trailing slash is mandatory).
|
||||||
|
|
||||||
|
@ -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`)"
|
||||||
@ -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:
|
||||||
|
@ -0,0 +1,83 @@
|
|||||||
|
```yaml tab="Docker & Swarm"
|
||||||
|
# Dynamic Configuration
|
||||||
|
labels:
|
||||||
|
- "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && PathPrefix(`/traefik`)"
|
||||||
|
- "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="Docker (Swarm)"
|
||||||
|
# Dynamic Configuration
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
- "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && PathPrefix(`/traefik`)"
|
||||||
|
- "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"
|
||||||
|
# Dummy service for Swarm port detection. The port can be any valid integer value.
|
||||||
|
- "traefik.http.services.dummy-svc.loadbalancer.server.port=9999"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Kubernetes CRD"
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: traefik-dashboard
|
||||||
|
spec:
|
||||||
|
routes:
|
||||||
|
- match: Host(`traefik.example.com`) && PathPrefix(`/traefik`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: api@internal
|
||||||
|
kind: TraefikService
|
||||||
|
middlewares:
|
||||||
|
- name: auth
|
||||||
|
---
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: auth
|
||||||
|
spec:
|
||||||
|
basicAuth:
|
||||||
|
secret: secretName # Kubernetes secret named "secretName"
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml tab="Consul Catalog"
|
||||||
|
# Dynamic Configuration
|
||||||
|
- "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && PathPrefix(`/traefik`)"
|
||||||
|
- "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)"
|
||||||
|
# Dynamic Configuration
|
||||||
|
http:
|
||||||
|
routers:
|
||||||
|
dashboard:
|
||||||
|
rule: Host(`traefik.example.com`) && PathPrefix(`/traefik`)
|
||||||
|
service: api@internal
|
||||||
|
middlewares:
|
||||||
|
- auth
|
||||||
|
middlewares:
|
||||||
|
auth:
|
||||||
|
basicAuth:
|
||||||
|
users:
|
||||||
|
- "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
|
||||||
|
- "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
# Dynamic Configuration
|
||||||
|
[http.routers.my-api]
|
||||||
|
rule = "Host(`traefik.example.com`) && PathPrefix(`/traefik`)"
|
||||||
|
service = "api@internal"
|
||||||
|
middlewares = ["auth"]
|
||||||
|
|
||||||
|
[http.middlewares.auth.basicAuth]
|
||||||
|
users = [
|
||||||
|
"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
|
||||||
|
"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
|
||||||
|
]
|
||||||
|
```
|
@ -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`))"
|
||||||
@ -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:
|
||||||
|
@ -674,41 +674,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=""_
|
||||||
@ -749,6 +714,32 @@ providers:
|
|||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `strictChecks`
|
||||||
|
|
||||||
|
_Optional, Default="passing,warning"_
|
||||||
|
|
||||||
|
Define which [Consul Service health checks](https://developer.hashicorp.com/consul/docs/services/usage/checks#define-initial-health-check-status) are allowed to take on traffic.
|
||||||
|
|
||||||
|
```yaml tab="File (YAML)"
|
||||||
|
providers:
|
||||||
|
consulCatalog:
|
||||||
|
strictChecks:
|
||||||
|
- "passing"
|
||||||
|
- "warning"
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```toml tab="File (TOML)"
|
||||||
|
[providers.consulCatalog]
|
||||||
|
strictChecks = ["passing", "warning"]
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash tab="CLI"
|
||||||
|
--providers.consulcatalog.strictChecks=passing,warning
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
### `watch`
|
### `watch`
|
||||||
|
|
||||||
_Optional, Default=false_
|
_Optional, Default=false_
|
||||||
|
@ -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=""_
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user