mirror of
https://github.com/traefik/traefik.git
synced 2026-02-03 20:39:51 -05:00
Compare commits
129 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4a91344ed | ||
|
|
8425e09806 | ||
|
|
5969d1680d | ||
|
|
b19e4a435b | ||
|
|
b3528b4f4d | ||
|
|
7d13368150 | ||
|
|
f32d58c577 | ||
|
|
1bc9569399 | ||
|
|
72ba481bbc | ||
|
|
54fca86901 | ||
|
|
dd8045ad4e | ||
|
|
3678d2332f | ||
|
|
f4f129a279 | ||
|
|
2c47d71666 | ||
|
|
50faaf298a | ||
|
|
121dfa6060 | ||
|
|
5c97bfbbbc | ||
|
|
ed990f279a | ||
|
|
731d8c0ba7 | ||
|
|
a9c5a3828b | ||
|
|
fb54793b93 | ||
|
|
7e5ee8988e | ||
|
|
d4d61dbd80 | ||
|
|
91381590d3 | ||
|
|
85cd5485b7 | ||
|
|
27912e3849 | ||
|
|
9ac5d3ac1c | ||
|
|
d675b163b3 | ||
|
|
139b59def9 | ||
|
|
94eba471f1 | ||
|
|
ef5d040fd6 | ||
|
|
954eaab5f7 | ||
|
|
7cb25da31c | ||
|
|
82c756006b | ||
|
|
63820e1d78 | ||
|
|
bb35197d5a | ||
|
|
08b1336af0 | ||
|
|
6cd85caa99 | ||
|
|
3315a9fbec | ||
|
|
77af7e4dea | ||
|
|
27b27e9b1f | ||
|
|
34d8491ac2 | ||
|
|
97158ac770 | ||
|
|
51343bc15f | ||
|
|
105bf1cfd6 | ||
|
|
a6516d36eb | ||
|
|
1728364341 | ||
|
|
8479d66d18 | ||
|
|
9e5d4ba5a1 | ||
|
|
adf47fba31 | ||
|
|
5492079915 | ||
|
|
794916a183 | ||
|
|
5d3706468d | ||
|
|
2e6dfbae57 | ||
|
|
dc6d54532d | ||
|
|
ee265a8509 | ||
|
|
5a9f3e6999 | ||
|
|
fc67185987 | ||
|
|
d054299ed0 | ||
|
|
93f7cb1082 | ||
|
|
df50421b53 | ||
|
|
dc04dc1940 | ||
|
|
26f4a669b8 | ||
|
|
e8067f4e01 | ||
|
|
1881434ac6 | ||
|
|
862488569d | ||
|
|
2b710f05b3 | ||
|
|
c7487c4a69 | ||
|
|
12d792cdef | ||
|
|
e9f3089e90 | ||
|
|
7e703742cb | ||
|
|
4de6d6b902 | ||
|
|
1778ff3bac | ||
|
|
7e1654ae27 | ||
|
|
5d00096f82 | ||
|
|
be27044099 | ||
|
|
dbebe5fa3e | ||
|
|
413b7c8cca | ||
|
|
3b6949c18c | ||
|
|
66bf4632e2 | ||
|
|
1de72c715d | ||
|
|
f7280439e6 | ||
|
|
cabcf19303 | ||
|
|
47d7094dfb | ||
|
|
0e360966a0 | ||
|
|
c2b21d3719 | ||
|
|
5b17f0116e | ||
|
|
d1765c7768 | ||
|
|
23788e90cb | ||
|
|
90ce858347 | ||
|
|
6af404b9da | ||
|
|
50c254a522 | ||
|
|
8e6ce08f33 | ||
|
|
97f94349d5 | ||
|
|
278d903bb4 | ||
|
|
1d445d5c9d | ||
|
|
a16c2326b3 | ||
|
|
f726a50038 | ||
|
|
b4abd8dc2c | ||
|
|
f71b941995 | ||
|
|
3ef6c06b51 | ||
|
|
e6b9f14022 | ||
|
|
78e2dab155 | ||
|
|
023adeff12 | ||
|
|
e40d8c3d11 | ||
|
|
704f69272c | ||
|
|
8ebab1b243 | ||
|
|
5fe10e2098 | ||
|
|
fd36de5a0a | ||
|
|
50e5720464 | ||
|
|
4854dee208 | ||
|
|
60b19b7b81 | ||
|
|
e4f0c3051c | ||
|
|
1e0e03edc7 | ||
|
|
0a3239463b | ||
|
|
653b105cb7 | ||
|
|
e0e49533ab | ||
|
|
928f7ed8ce | ||
|
|
950e957b03 | ||
|
|
351dcbd186 | ||
|
|
f0957c8df4 | ||
|
|
7f40f3cd58 | ||
|
|
4e441f8b18 | ||
|
|
cd562a0451 | ||
|
|
c63be08b07 | ||
|
|
e931a71660 | ||
|
|
34b91218f4 | ||
|
|
8bdcd72042 | ||
|
|
2ad42cd0ec |
736 changed files with 26335 additions and 18672 deletions
7
.github/workflows/build.yaml
vendored
7
.github/workflows/build.yaml
vendored
|
|
@ -20,6 +20,7 @@ jobs:
|
|||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -51,12 +52,12 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
env:
|
||||
ImageOS: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.goarm }}
|
||||
with:
|
||||
|
|
@ -64,7 +65,7 @@ jobs:
|
|||
check-latest: true
|
||||
|
||||
- name: Artifact webui
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
||||
with:
|
||||
name: webui.tar.gz
|
||||
|
||||
|
|
|
|||
63
.github/workflows/check_doc.yaml
vendored
Normal file
63
.github/workflows/check_doc.yaml
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
name: Check Documentation
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths:
|
||||
- '.github/workflows/check_doc.yaml'
|
||||
- 'docs/**'
|
||||
|
||||
jobs:
|
||||
|
||||
docs:
|
||||
name: lint, build and verify
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install markdownlint
|
||||
run: |
|
||||
npm install --global markdownlint@0.29.0 markdownlint-cli@0.35.0
|
||||
|
||||
- name: Lint
|
||||
run: ./docs/scripts/lint.sh docs
|
||||
|
||||
- name: Setup python
|
||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||
with:
|
||||
python-version: '3.12'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: "./docs/requirements.txt"
|
||||
|
||||
- name: Build documentation
|
||||
working-directory: ./docs
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
mkdocs build --strict
|
||||
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@90be1154f987f4dc0fe0dd0feedac9e473aa4ba8 # v1.286.0
|
||||
with:
|
||||
ruby-version: '3.4'
|
||||
|
||||
- name: Install html-proofer
|
||||
run: |
|
||||
gem install nokogiri --version 1.18.6 --no-document -- --use-system-libraries
|
||||
gem install html-proofer --version 5.0.10 --no-document -- --use-system-libraries
|
||||
env:
|
||||
NOKOGIRI_USE_SYSTEM_LIBRARIES: "true"
|
||||
|
||||
# Comes from https://github.com/gjtorikian/html-proofer?tab=readme-ov-file#caching-with-continuous-integration
|
||||
- name: Cache HTMLProofer
|
||||
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
|
||||
with:
|
||||
path: tmp/.htmlproofer
|
||||
key: ${{ runner.os }}-htmlproofer
|
||||
|
||||
- name: Verify
|
||||
run: ./docs/scripts/verify.sh docs/site
|
||||
25
.github/workflows/check_doc.yml
vendored
25
.github/workflows/check_doc.yml
vendored
|
|
@ -1,25 +0,0 @@
|
|||
name: Check Documentation
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
|
||||
docs:
|
||||
name: Check, verify and build documentation
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check documentation
|
||||
run: make docs-pull-images docs
|
||||
env:
|
||||
# These variables are not passed to workflows that are triggered by a pull request from a fork.
|
||||
DOCS_VERIFY_SKIP: ${{ vars.DOCS_VERIFY_SKIP }}
|
||||
DOCS_LINT_SKIP: ${{ vars.DOCS_LINT_SKIP }}
|
||||
11
.github/workflows/codeql.yml
vendored
11
.github/workflows/codeql.yml
vendored
|
|
@ -12,6 +12,7 @@ jobs:
|
|||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
|
@ -28,17 +29,17 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
if: ${{ matrix.language == 'go' }}
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
uses: github/codeql-action/init@38e701f46e33fb233075bf4238cb1e5d68e429e4 # v3.31.11
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
|
|
@ -52,7 +53,7 @@ jobs:
|
|||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
uses: github/codeql-action/autobuild@38e701f46e33fb233075bf4238cb1e5d68e429e4 # v3.31.11
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
|
@ -65,6 +66,6 @@ jobs:
|
|||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
uses: github/codeql-action/analyze@38e701f46e33fb233075bf4238cb1e5d68e429e4 # v3.31.11
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
|
|
|||
|
|
@ -16,16 +16,17 @@ jobs:
|
|||
docs:
|
||||
name: Doc Process
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
if: github.repository == 'traefik/traefik'
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
13
.github/workflows/experimental.yaml
vendored
13
.github/workflows/experimental.yaml
vendored
|
|
@ -20,15 +20,16 @@ jobs:
|
|||
if: github.repository == 'traefik/traefik'
|
||||
name: Build experimental image on branch
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
env:
|
||||
ImageOS: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.goarm }}
|
||||
with:
|
||||
|
|
@ -42,19 +43,19 @@ jobs:
|
|||
run: echo ${GITHUB_REF##*/}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||
|
||||
- name: Artifact webui
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
||||
with:
|
||||
name: webui.tar.gz
|
||||
|
||||
|
|
|
|||
21
.github/workflows/release.yaml
vendored
21
.github/workflows/release.yaml
vendored
|
|
@ -21,21 +21,22 @@ jobs:
|
|||
build:
|
||||
if: github.ref_type == 'tag' && github.repository == 'traefik/traefik'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ linux-amd64, linux-386, linux-arm, linux-arm64, linux-ppc64le, linux-s390x, linux-riscv64, darwin, windows-amd64, windows-arm64, windows-386, freebsd, openbsd ]
|
||||
os: [ linux-amd64, linux-386, linux-arm, linux-arm64, linux-ppc64le, linux-s390x, linux-riscv64, darwin-amd64, darwin-arm64, windows-amd64, windows-arm64, windows-386, freebsd-amd64, freebsd-386, openbsd-amd64, openbsd-386, openbsd-riscv64 ]
|
||||
needs:
|
||||
- build-webui
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
env:
|
||||
# Ensure cache consistency on Linux, see https://github.com/actions/setup-go/pull/383
|
||||
ImageOS: ${{ matrix.os }}
|
||||
|
|
@ -44,7 +45,7 @@ jobs:
|
|||
check-latest: true
|
||||
|
||||
- name: Artifact webui
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
||||
with:
|
||||
name: webui.tar.gz
|
||||
|
||||
|
|
@ -63,7 +64,7 @@ jobs:
|
|||
echo "GORELEASER_CONFIG_FILE_PATH=$GORELEASER_CONFIG_FILE_PATH" >> $GITHUB_ENV
|
||||
|
||||
- name: Build with goreleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||
with:
|
||||
distribution: goreleaser
|
||||
# 'latest', 'nightly', or a semver
|
||||
|
|
@ -71,7 +72,7 @@ jobs:
|
|||
args: release --clean --timeout="90m" --config "${{ env.GORELEASER_CONFIG_FILE_PATH }}"
|
||||
|
||||
- name: Artifact binaries
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: ${{ matrix.os }}-binaries
|
||||
path: |
|
||||
|
|
@ -83,18 +84,19 @@ jobs:
|
|||
release:
|
||||
if: github.ref_type == 'tag' && github.repository == 'traefik/traefik'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
|
||||
needs:
|
||||
- build
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Artifact webui
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
||||
with:
|
||||
name: webui.tar.gz
|
||||
|
||||
|
|
@ -111,7 +113,7 @@ jobs:
|
|||
echo "${TRAEFIKER_RSA}" | base64 --decode > ~/.ssh/traefiker_rsa
|
||||
|
||||
- name: Download All Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
||||
with:
|
||||
path: dist/
|
||||
pattern: "*-binaries"
|
||||
|
|
@ -133,4 +135,3 @@ jobs:
|
|||
gh release create ${VERSION} ./dist/**/traefik*.{zip,tar.gz} ./dist/traefik*.{tar.gz,txt} --repo traefik/traefik --title ${VERSION} --notes ${VERSION} --latest=false
|
||||
|
||||
./script/deploy.sh
|
||||
|
||||
|
|
|
|||
5
.github/workflows/sync-docker-images.yaml
vendored
5
.github/workflows/sync-docker-images.yaml
vendored
|
|
@ -8,15 +8,16 @@ on:
|
|||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
if: github.repository == 'traefik/traefik'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
|
||||
- uses: imjasonh/setup-crane@v0.4
|
||||
- uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
|
||||
|
||||
- name: Sync
|
||||
run: |
|
||||
|
|
|
|||
7
.github/workflows/template-webui.yaml
vendored
7
.github/workflows/template-webui.yaml
vendored
|
|
@ -7,10 +7,11 @@ jobs:
|
|||
|
||||
build-webui:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
|
@ -18,7 +19,7 @@ jobs:
|
|||
run: corepack enable
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version-file: webui/.nvmrc
|
||||
cache: yarn
|
||||
|
|
@ -41,7 +42,7 @@ jobs:
|
|||
tar czvf webui.tar.gz ./webui/static/
|
||||
|
||||
- name: Artifact webui
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: webui.tar.gz
|
||||
path: webui.tar.gz
|
||||
|
|
|
|||
|
|
@ -19,15 +19,16 @@ jobs:
|
|||
|
||||
test-gateway-api-conformance:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
|
|
|
|||
20
.github/workflows/test-integration.yaml
vendored
20
.github/workflows/test-integration.yaml
vendored
|
|
@ -17,15 +17,16 @@ jobs:
|
|||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
|
@ -38,14 +39,14 @@ jobs:
|
|||
run: make binary-linux-amd64
|
||||
|
||||
- name: Save go cache build
|
||||
uses: actions/cache/save@v4
|
||||
uses: actions/cache/save@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
key: ${{ runner.os }}-go-build-cache-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
|
||||
|
||||
- name: Artifact traefik binary
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: traefik
|
||||
path: ./dist/linux/amd64/traefik
|
||||
|
|
@ -53,6 +54,7 @@ jobs:
|
|||
|
||||
test-integration:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
needs:
|
||||
- build
|
||||
strategy:
|
||||
|
|
@ -63,18 +65,18 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
||||
- name: Download traefik binary
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
||||
with:
|
||||
name: traefik
|
||||
path: ./dist/linux/amd64/
|
||||
|
|
@ -83,7 +85,7 @@ jobs:
|
|||
run: chmod +x ./dist/linux/amd64/traefik
|
||||
|
||||
- name: Restore go cache build
|
||||
uses: actions/cache/restore@v4
|
||||
uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
|
|
@ -91,7 +93,7 @@ jobs:
|
|||
|
||||
- name: Generate go test Slice
|
||||
id: test_split
|
||||
uses: hashicorp-forge/go-test-split-action@v2.0.0
|
||||
uses: hashicorp-forge/go-test-split-action@ddb2685fb140c29505663b405af7eb2cd953dd13 # v2.0.1
|
||||
with:
|
||||
packages: ./integration
|
||||
total: ${{ matrix.parallel }}
|
||||
|
|
|
|||
|
|
@ -19,20 +19,21 @@ jobs:
|
|||
|
||||
test-knative-conformance:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Set up KO
|
||||
uses: ko-build/setup-ko@v0.6
|
||||
uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
|
||||
env:
|
||||
KO_DOCKER_REPO: ko.local
|
||||
|
||||
|
|
|
|||
15
.github/workflows/test-unit.yaml
vendored
15
.github/workflows/test-unit.yaml
vendored
|
|
@ -16,16 +16,17 @@ jobs:
|
|||
generate-packages:
|
||||
name: List Go Packages
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
|
@ -39,6 +40,7 @@ jobs:
|
|||
|
||||
test-unit:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
needs: generate-packages
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
@ -46,12 +48,12 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
|
@ -62,10 +64,11 @@ jobs:
|
|||
|
||||
test-ui-unit:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
|
@ -73,7 +76,7 @@ jobs:
|
|||
run: corepack enable
|
||||
|
||||
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
||||
with:
|
||||
node-version-file: webui/.nvmrc
|
||||
cache: 'yarn'
|
||||
|
|
|
|||
21
.github/workflows/validate.yaml
vendored
21
.github/workflows/validate.yaml
vendored
|
|
@ -7,42 +7,44 @@ on:
|
|||
|
||||
env:
|
||||
GO_VERSION: '1.24'
|
||||
GOLANGCI_LINT_VERSION: v2.0.2
|
||||
MISSPELL_VERSION: v0.6.0
|
||||
GOLANGCI_LINT_VERSION: v2.8.0
|
||||
MISSPELL_VERSION: v0.7.0
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v7
|
||||
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
|
||||
with:
|
||||
version: "${{ env.GOLANGCI_LINT_VERSION }}"
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
|
@ -55,15 +57,16 @@ jobs:
|
|||
|
||||
validate-generate:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
check-latest: true
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ linters:
|
|||
- nilnil # Not relevant
|
||||
- nlreturn # Not relevant
|
||||
- noctx # Too strict
|
||||
- noinlineerr # Too strict
|
||||
- nonamedreturns # Too strict
|
||||
- paralleltest # Not relevant
|
||||
- prealloc # Too many false-positive.
|
||||
|
|
@ -47,6 +48,7 @@ linters:
|
|||
- varnamelen # Not relevant
|
||||
- wrapcheck # Too strict
|
||||
- wsl # Too strict
|
||||
- wsl_v5 # Too strict
|
||||
|
||||
settings:
|
||||
depguard:
|
||||
|
|
@ -80,6 +82,7 @@ linters:
|
|||
toolchain-pattern: go1\.\d+\.\d+$
|
||||
tool-forbidden: true
|
||||
go-version-pattern: ^1\.\d+(\.0)?$
|
||||
replace-local: true
|
||||
replace-allow-list:
|
||||
- github.com/abbot/go-http-auth
|
||||
- github.com/gorilla/mux
|
||||
|
|
@ -295,15 +298,31 @@ linters:
|
|||
source: 'errors.New\("Nomad provider'
|
||||
text: 'ST1005: error strings should not be capitalized'
|
||||
- path: (.+)\.go
|
||||
text: 'struct-tag: unknown option ''inline'' in JSON tag'
|
||||
text: 'omitzero: Omitempty has no effect on nested struct field'
|
||||
linters:
|
||||
- modernize
|
||||
- path: (.+)\.go
|
||||
text: 'struct-tag: unknown option "inline" in json tag'
|
||||
linters:
|
||||
- revive
|
||||
- path: (.+)\.go
|
||||
text: 'struct-tag: unknown option ''omitzero'' in TOML tag'
|
||||
text: 'struct-tag: unknown option "omitzero" in toml tag'
|
||||
linters:
|
||||
- revive
|
||||
- path: (pkg/types/.+|pkg/api/.+|pkg/observability/types/.+)\.go
|
||||
text: 'var-naming: avoid meaningless package names'
|
||||
linters:
|
||||
- revive
|
||||
- path: (pkg/muxer/http/.+|pkg/provider/http/.+)\.go
|
||||
text: 'var-naming: avoid package names that conflict with Go standard library package names'
|
||||
linters:
|
||||
- revive
|
||||
- path: (.+)\.go$
|
||||
text: 'SA1019: http.CloseNotifier has been deprecated' # FIXME must be fixed
|
||||
- path: (.+)\.go$
|
||||
text: 'SA1019: dynamic.(TCPIPWhiteList|IPWhiteList) is deprecated: please use IPAllowList instead.'
|
||||
- path: (.+)\.go$
|
||||
text: 'SA1019: middlewareTCP.Spec.IPWhiteList is deprecated: please use IPAllowList instead.'
|
||||
- path: (.+)\.go$
|
||||
text: 'SA1019: cfg.(SSLRedirect|SSLTemporaryRedirect|SSLHost|SSLForceHost|FeaturePolicy) is deprecated'
|
||||
- path: (.+)\.go$
|
||||
|
|
|
|||
|
|
@ -54,10 +54,12 @@ changelog:
|
|||
archives:
|
||||
- id: traefik
|
||||
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
|
||||
format: tar.gz
|
||||
formats:
|
||||
- tar.gz
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
formats:
|
||||
- zip
|
||||
files:
|
||||
- LICENSE.md
|
||||
- CHANGELOG.md
|
||||
|
|
|
|||
109
CHANGELOG.md
109
CHANGELOG.md
|
|
@ -1,7 +1,104 @@
|
|||
## [v3.6.3](https://github.com/traefik/traefik/tree/v3.6.3) (2025-12-04)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v3.6.2...v3.6.3)
|
||||
## [v3.6.7](https://github.com/traefik/traefik/tree/v3.6.7) (2026-01-14)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v3.6.6...v3.6.7)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[acme]** Bump github.com/go-acme/lego/v4 to v4.31.0 ([#12529](https://github.com/traefik/traefik/pull/12529) by [ldez](https://github.com/ldez))
|
||||
- **[acme]** Add missing renew options ([#12467](https://github.com/traefik/traefik/pull/12467) by [ldez](https://github.com/ldez))
|
||||
- **[acme]** Replace hardcoded references to LetsEncrypt in log messages ([#12464](https://github.com/traefik/traefik/pull/12464) by [schildbach](https://github.com/schildbach))
|
||||
- **[k8s/ingress-nginx]** Fix use-regex nginx annotation ([#12531](https://github.com/traefik/traefik/pull/12531) by [LBF38](https://github.com/LBF38))
|
||||
- **[k8s/ingress-nginx]** Prevent Ingress Nginx provider http router to attach to an entrypoint with TLS ([#12528](https://github.com/traefik/traefik/pull/12528) by [rtribotte](https://github.com/rtribotte))
|
||||
- **[k8s/ingress]** Fix panic for empty defaultBackend and defaultBackend without resources ([#12509](https://github.com/traefik/traefik/pull/12509) by [gndz07](https://github.com/gndz07))
|
||||
- **[k8s]** Fix condition used for serving and fenced endpoints ([#12521](https://github.com/traefik/traefik/pull/12521) by [LBF38](https://github.com/LBF38))
|
||||
- **[webui]** Validate X-Forwarded-Prefix value for dashboard redirect ([#12514](https://github.com/traefik/traefik/pull/12514) by [LBF38](https://github.com/LBF38))
|
||||
- **[acme]** Add timeout to ACME-TLS/1 challenge handshake ([#12516](https://github.com/traefik/traefik/pull/12516) by [LBF38](https://github.com/LBF38))
|
||||
- **[server]** Make encoded character options opt-in ([#12540](https://github.com/traefik/traefik/pull/12540) by [gndz07](https://github.com/gndz07))
|
||||
|
||||
**Documentation:**
|
||||
- **[docker/swarm]** Update swarm.md traefik version ([#12508](https://github.com/traefik/traefik/pull/12508) by [DBouraoui](https://github.com/DBouraoui))
|
||||
- **[k8s/ingress-nginx]** Fix ingress-nginx annotations documentation ([#12510](https://github.com/traefik/traefik/pull/12510) by [nmengin](https://github.com/nmengin))
|
||||
- **[k8s]** Fix Kubernetes reference yml file ([#12406](https://github.com/traefik/traefik/pull/12406) by [mmatur](https://github.com/mmatur))
|
||||
- Fix code copy button positioning ([#12520](https://github.com/traefik/traefik/pull/12520) by [AnuragEkkati](https://github.com/AnuragEkkati))
|
||||
- Fix typo in kubernetes.md ([#12515](https://github.com/traefik/traefik/pull/12515) by [EdwardSalkeld](https://github.com/EdwardSalkeld))
|
||||
- Bring back security section on API & Dashboard documentation page ([#12507](https://github.com/traefik/traefik/pull/12507) by [gndz07](https://github.com/gndz07))
|
||||
- Fix link description in Traefik Proxy documentation ([#12488](https://github.com/traefik/traefik/pull/12488) by [schaerfo](https://github.com/schaerfo))
|
||||
- Add product comparison matrix and features page ([#12037](https://github.com/traefik/traefik/pull/12037) by [sheddy-traefik](https://github.com/sheddy-traefik))
|
||||
|
||||
**Misc:**
|
||||
- Merge branch v2.11 into v3.6 ([#12552](https://github.com/traefik/traefik/pull/12552) by [rtribotte](https://github.com/rtribotte))
|
||||
- Merge branch v2.11 into v3.6 ([#12533](https://github.com/traefik/traefik/pull/12533) by [mmatur](https://github.com/mmatur))
|
||||
- Merge branch v2.11 into v3.6 ([#12497](https://github.com/traefik/traefik/pull/12497) by [mmatur](https://github.com/mmatur))
|
||||
|
||||
## [v2.11.35](https://github.com/traefik/traefik/tree/v2.11.35) (2026-01-14)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.11.34...v2.11.35)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[acme]** Add timeout to ACME-TLS/1 challenge handshake ([#12516](https://github.com/traefik/traefik/pull/12516) by [LBF38](https://github.com/LBF38))
|
||||
- **[server]** Make encoded character options opt-in ([#12540](https://github.com/traefik/traefik/pull/12540) by [gndz07](https://github.com/gndz07))
|
||||
|
||||
## [v3.6.6](https://github.com/traefik/traefik/tree/v3.6.6) (2025-12-29)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v3.6.5...v3.6.6)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[acme]** Bump github.com/go-acme/lego/v4 to v4.30.1 ([#12432](https://github.com/traefik/traefik/pull/12432) by [ldez](https://github.com/ldez))
|
||||
- **[http3]** Bump github.com/quic-go/quic-go to v0.58.0 ([#12448](https://github.com/traefik/traefik/pull/12448) by [GreyXor](https://github.com/GreyXor))
|
||||
- **[redis]** Fix mutually exclusive verification for Redis ([#12442](https://github.com/traefik/traefik/pull/12442) by [juliens](https://github.com/juliens))
|
||||
- **[server]** Fix deny encoded characters ([#12454](https://github.com/traefik/traefik/pull/12454) by [rtribotte](https://github.com/rtribotte))
|
||||
|
||||
**Documentation:**
|
||||
- **[k8s/ingress,k8s]** Fix Kubernetes Ingress provider documentation ([#12443](https://github.com/traefik/traefik/pull/12443) by [nmengin](https://github.com/nmengin))
|
||||
- **[k8s/ingress-nginx]** Add RBAC documentation for Ingress NGINX provider ([#12445](https://github.com/traefik/traefik/pull/12445) by [nmn3m](https://github.com/nmn3m))
|
||||
- **[k8s]** Improve the K8S multi-tenancy security note ([#12444](https://github.com/traefik/traefik/pull/12444) by [nmengin](https://github.com/nmengin))
|
||||
- Restore documentation on http.maxHeaderBytes ([#12440](https://github.com/traefik/traefik/pull/12440) by [mloiseleur](https://github.com/mloiseleur))
|
||||
- Fix Menu Item Naming ([#12431](https://github.com/traefik/traefik/pull/12431) by [sheddy-traefik](https://github.com/sheddy-traefik))
|
||||
|
||||
**Misc:**
|
||||
- Merge branch v2.11 into v3.6 ([#12475](https://github.com/traefik/traefik/pull/12475) by [mmatur](https://github.com/mmatur))
|
||||
- Merge branch v2.11 into v3.6 ([#12438](https://github.com/traefik/traefik/pull/12438) by [kevinpollet](https://github.com/kevinpollet))
|
||||
|
||||
## [v2.11.34](https://github.com/traefik/traefik/tree/v2.11.34) (2025-12-23)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.11.33...v2.11.34)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[server]** Fix deny encoded characters ([#12457](https://github.com/traefik/traefik/pull/12457) by [rtribotte](https://github.com/rtribotte))
|
||||
|
||||
## [v2.11.33](https://github.com/traefik/traefik/tree/v2.11.33) (2025-12-17)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.11.32...v2.11.33)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[server]** Print access logs for rejected requests and warn about new behavior ([#12426](https://github.com/traefik/traefik/pull/12426) by [rtribotte](https://github.com/rtribotte))
|
||||
|
||||
**Documentation:**
|
||||
- Clarify doc about encoded characters rejection ([#12391](https://github.com/traefik/traefik/pull/12391) by [rtribotte](https://github.com/rtribotte))
|
||||
- Fix encoded characters entryPoint option documentation ([#12384](https://github.com/traefik/traefik/pull/12384) by [rtribotte](https://github.com/rtribotte))
|
||||
- Fix encoded characters option documentation ([#12373](https://github.com/traefik/traefik/pull/12373) by [kevinpollet](https://github.com/kevinpollet))
|
||||
|
||||
## [v3.6.5](https://github.com/traefik/traefik/tree/v3.6.5) (2025-12-16)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v3.6.4...v3.6.5)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[k8s/ingress-nginx]** Fix NGINX sslredirect annotation support ([#12387](https://github.com/traefik/traefik/pull/12387) by [rtribotte](https://github.com/rtribotte))
|
||||
- **[server]** Print access logs for rejected requests and warn about new behavior ([#12424](https://github.com/traefik/traefik/pull/12424) by [kevinpollet](https://github.com/kevinpollet))
|
||||
|
||||
**Documentation:**
|
||||
- **[k8s/ingress-nginx]** Add auth-signin to unsupported nginx annotations list ([#12370](https://github.com/traefik/traefik/pull/12370) by [fibsifan](https://github.com/fibsifan))
|
||||
- Add a Breaking change note to the changelog ([#12398](https://github.com/traefik/traefik/pull/12398) by [nmengin](https://github.com/nmengin))
|
||||
- Fix encodedCharacters entryPoint option documentation ([#12385](https://github.com/traefik/traefik/pull/12385) by [rtribotte](https://github.com/rtribotte))
|
||||
|
||||
## [v3.6.4](https://github.com/traefik/traefik/tree/v3.6.4) (2025-12-05)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v3.6.2...v3.6.4)
|
||||
|
||||
**CVE's fixed:**
|
||||
- [CVE-2025-66490](https://nvd.nist.gov/vuln/detail/CVE-2025-66490) (Advisory [GHSA-gm3x-23wp-hc2c](https://github.com/traefik/traefik/security/advisories/GHSA-gm3x-23wp-hc2c)): **Breaking Change** please read the [migration guide](https://doc.traefik.io/traefik/v3.6/migrate/v3/#v364).
|
||||
- [CVE-2025-66491](https://nvd.nist.gov/vuln/detail/CVE-2025-66491) (Advisory [GHSA-7vww-mvcr-x6vj](https://github.com/traefik/traefik/security/advisories/GHSA-7vww-mvcr-x6vj))
|
||||
|
||||
**Important:** Please read the [migration guide](https://doc.traefik.io/traefik/v3.6/migrate/v3/#v364).
|
||||
|
||||
**Bug fixes:**
|
||||
- **[server]** Reject suspicious encoded characters ([#12360](https://github.com/traefik/traefik/pull/12360) by [rtribotte](https://github.com/rtribotte))
|
||||
- **[plugins]** Validate plugin module name ([#12291](https://github.com/traefik/traefik/pull/12291) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[http3]** Bump github.com/quic-go/quic-go to v0.57.1 ([#12319](https://github.com/traefik/traefik/pull/12319) by [GreyXor](https://github.com/GreyXor))
|
||||
- **[http3]** Bump github.com/quic-go/quic-go to v0.57.0 ([#12308](https://github.com/traefik/traefik/pull/12308) by [GreyXor](https://github.com/GreyXor))
|
||||
- **[server]** Bump golang.org/x/crypto to v0.45.0 ([#12296](https://github.com/traefik/traefik/pull/12296) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[acme]** Bump github.com/go-acme/lego/v4 to v4.29.0 ([#12333](https://github.com/traefik/traefik/pull/12333) by [ldez](https://github.com/ldez))
|
||||
- **[k8s/ingress-nginx]** Fix SSL redirect to match NGINX behavior ([#12361](https://github.com/traefik/traefik/pull/12361) by [mmatur](https://github.com/mmatur))
|
||||
- **[k8s/ingress-nginx]** Fix the service name for ingress-nginx provider ([#12352](https://github.com/traefik/traefik/pull/12352) by [mmatur](https://github.com/mmatur))
|
||||
|
|
@ -23,11 +120,17 @@
|
|||
**Misc:**
|
||||
- Merge branch v2.11 into v3.6 ([#12364](https://github.com/traefik/traefik/pull/12364) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- Merge branch v2.11 into v3.6 ([#12341](https://github.com/traefik/traefik/pull/12341) by [mmatur](https://github.com/mmatur))
|
||||
- Merge branch v2.11 into v3.6 ([#12368](https://github.com/traefik/traefik/pull/12368) by [mmatur](https://github.com/mmatur))
|
||||
|
||||
## [v3.6.3](https://github.com/traefik/traefik/tree/v3.6.3) (2025-12-04)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v3.6.2...v3.6.3)
|
||||
|
||||
Release canceled.
|
||||
|
||||
## [v2.11.32](https://github.com/traefik/traefik/tree/v2.11.32) (2025-12-04)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.11.31...v2.11.32)
|
||||
|
||||
**Bug fixes:**
|
||||
**Bug fixes:**
|
||||
- **[server]** Reject suspicious encoded characters ([#12360](https://github.com/traefik/traefik/pull/12360) by [rtribotte](https://github.com/rtribotte))
|
||||
- **[plugins]** Validate plugin module name ([#12291](https://github.com/traefik/traefik/pull/12291) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[http3]** Bump github.com/quic-go/quic-go to v0.57.1 ([#12319](https://github.com/traefik/traefik/pull/12319) by [GreyXor](https://github.com/GreyXor))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# syntax=docker/dockerfile:1.2
|
||||
FROM alpine:3.22
|
||||
FROM alpine:3.23
|
||||
|
||||
RUN apk add --no-cache --no-progress ca-certificates tzdata
|
||||
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -103,7 +103,7 @@ test-integration:
|
|||
#? test-gateway-api-conformance: Run the Gateway API conformance tests
|
||||
test-gateway-api-conformance: build-image-dirty
|
||||
# In case of a new Minor/Major version, the traefikVersion needs to be updated.
|
||||
GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./integration -v -tags gatewayAPIConformance -test.run GatewayAPIConformanceSuite -traefikVersion="v3.6" $(TESTFLAGS)
|
||||
GOOS=$(GOOS) GOARCH=$(GOARCH) go test ./integration -v -tags gatewayAPIConformance -test.run GatewayAPIConformanceSuite -traefikVersion="v3.7" $(TESTFLAGS)
|
||||
|
||||
.PHONY: test-knative-conformance
|
||||
#? test-knative-conformance: Run the Knative conformance tests
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
// TraefikCmdConfiguration wraps the static configuration and extra parameters.
|
||||
type TraefikCmdConfiguration struct {
|
||||
static.Configuration `export:"true"`
|
||||
|
||||
// ConfigFile is the path to the configuration file.
|
||||
ConfigFile string `description:"Configuration file to use. If specified all other flags are ignored." export:"true"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,12 @@ func Do(staticConfiguration static.Configuration) (*http.Response, error) {
|
|||
return nil, fmt.Errorf("ping: missing %s entry point", ep)
|
||||
}
|
||||
|
||||
client := &http.Client{Timeout: 5 * time.Second}
|
||||
client := &http.Client{
|
||||
Timeout: 5 * time.Second,
|
||||
Transport: &http.Transport{
|
||||
Proxy: nil,
|
||||
},
|
||||
}
|
||||
protocol := "http"
|
||||
|
||||
// TODO Handle TLS on ping etc...
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func run(dest string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return os.WriteFile(filepath.Join(dest, "marshaler.go"), []byte(fmt.Sprintf(marsh, destPkg)), 0o666)
|
||||
return os.WriteFile(filepath.Join(dest, "marshaler.go"), fmt.Appendf(nil, marsh, destPkg), 0o666)
|
||||
}
|
||||
|
||||
func cleanType(typ types.Type, base string) string {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,11 @@ func runCmd(staticConfiguration *static.Configuration) error {
|
|||
return fmt.Errorf("setting up logger: %w", err)
|
||||
}
|
||||
|
||||
log.Warn().Msg("Traefik can reject some encoded characters in the request path." +
|
||||
"When your backend is not fully compliant with [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)," +
|
||||
"it is recommended to set these options to `false` to avoid split-view situation." +
|
||||
"Refer to the documentation for more details: https://doc.traefik.io/traefik/v3.6/migrate/v3/#encoded-characters-configuration-default-values")
|
||||
|
||||
http.DefaultTransport.(*http.Transport).Proxy = http.ProxyFromEnvironment
|
||||
|
||||
staticConfiguration.SetEffectiveConfiguration()
|
||||
|
|
@ -226,6 +231,7 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
|||
|
||||
if staticConfiguration.API != nil {
|
||||
version.DisableDashboardAd = staticConfiguration.API.DisableDashboardAd
|
||||
version.DashboardName = staticConfiguration.API.DashboardName
|
||||
}
|
||||
|
||||
// Plugins
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ docs: docs-clean docs-image docs-lint docs-build docs-verify
|
|||
# Writer Mode: build and serve docs on http://localhost:8000 with livereload
|
||||
.PHONY: docs-serve
|
||||
docs-serve: docs-image
|
||||
docker run $(DOCKER_RUN_DOC_OPTS) $(TRAEFIK_DOCS_BUILD_IMAGE) mkdocs serve
|
||||
docker run $(DOCKER_RUN_DOC_OPTS) $(TRAEFIK_DOCS_BUILD_IMAGE) mkdocs serve -a 0.0.0.0:8000
|
||||
|
||||
## Pull image for doc building
|
||||
.PHONY: docs-pull-images
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM alpine:3.22
|
||||
FROM alpine:3.23
|
||||
|
||||
RUN apk --no-cache --no-progress add \
|
||||
build-base \
|
||||
|
|
@ -34,6 +34,7 @@ RUN apk --no-cache --no-progress add \
|
|||
|
||||
COPY ./scripts/verify.sh /verify.sh
|
||||
COPY ./scripts/lint.sh /lint.sh
|
||||
COPY ./scripts/lint-yaml.sh /lint-yaml.sh
|
||||
|
||||
WORKDIR /app
|
||||
VOLUME ["/tmp","/app"]
|
||||
|
|
|
|||
18
docs/content/assets/css/code-copy.css
Normal file
18
docs/content/assets/css/code-copy.css
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* Fix positioning of the built-in clipboard button for code blocks.
|
||||
* In this theme, the button can end up positioned relative to <body>,
|
||||
* so anchor it to the code block container instead.
|
||||
*/
|
||||
|
||||
.md-typeset pre.highlight {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.md-typeset pre.highlight > button.md-clipboard {
|
||||
position: absolute;
|
||||
top: .25rem;
|
||||
right: .25rem;
|
||||
z-index: 10;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,14 @@
|
|||
/* Highlight */
|
||||
(function(hljs) {
|
||||
hljs.initHighlightingOnLoad();
|
||||
})(hljs);
|
||||
})(hljs);
|
||||
|
||||
/* Scarf Analytics - cookieless, anonymous company-level intelligence */
|
||||
(function() {
|
||||
var img = document.createElement('img');
|
||||
img.src = 'https://static.scarf.sh/a.png?x-pxid=1a49232a-b165-4015-8ed2-a1092f1f0d83';
|
||||
img.referrerPolicy = 'no-referrer-when-downgrade';
|
||||
img.loading = 'eager';
|
||||
img.style.cssText = 'visibility:hidden;position:absolute;width:1px;height:1px;';
|
||||
document.body.appendChild(img);
|
||||
})();
|
||||
|
|
@ -23,6 +23,7 @@ description: "Traefik Proxy is an open source software with a thriving community
|
|||
* Simon Delicata [@sdelicata](https://github.com/sdelicata)
|
||||
* Baptiste Mayelle [@youkoulayley](https://github.com/youkoulayley)
|
||||
* Jesper Noordsij [@jnoordsij](https://github.com/jnoordsij)
|
||||
* Gina Adzani [@gndz07](https://github.com/gndz07)
|
||||
|
||||
## Past Maintainers
|
||||
|
||||
|
|
|
|||
|
|
@ -6,25 +6,14 @@ Below is a non-exhaustive list of versions and their maintenance status:
|
|||
|
||||
| Version | Release Date | Active Support | Security Support |
|
||||
|---------|--------------|--------------------|-------------------|
|
||||
| 3.5 | Jul 23, 2025 | Yes | Yes |
|
||||
| 3.6 | Nov 07, 2025 | Yes | Yes |
|
||||
| 3.5 | Jul 23, 2025 | Ended Nov 07, 2025 | No |
|
||||
| 3.4 | May 05, 2025 | Ended Jul 23, 2025 | No |
|
||||
| 3.3 | Jan 06, 2025 | Ended May 05, 2025 | No |
|
||||
| 3.2 | Oct 28, 2024 | Ended Jan 06, 2025 | No |
|
||||
| 3.1 | Jul 15, 2024 | Ended Oct 28, 2024 | No |
|
||||
| 3.0 | Apr 29, 2024 | Ended Jul 15, 2024 | No |
|
||||
| 2.11 | Feb 12, 2024 | Ended Apr 29, 2025 | Ends Feb 01, 2026 |
|
||||
| 2.10 | Apr 24, 2023 | Ended Feb 12, 2024 | No |
|
||||
| 2.9 | Oct 03, 2022 | Ended Apr 24, 2023 | No |
|
||||
| 2.8 | Jun 29, 2022 | Ended Oct 03, 2022 | No |
|
||||
| 2.7 | May 24, 2022 | Ended Jun 29, 2022 | No |
|
||||
| 2.6 | Jan 24, 2022 | Ended May 24, 2022 | No |
|
||||
| 2.5 | Aug 17, 2021 | Ended Jan 24, 2022 | No |
|
||||
| 2.4 | Jan 19, 2021 | Ended Aug 17, 2021 | No |
|
||||
| 2.3 | Sep 23, 2020 | Ended Jan 19, 2021 | No |
|
||||
| 2.2 | Mar 25, 2020 | Ended Sep 23, 2020 | No |
|
||||
| 2.1 | Dec 11, 2019 | Ended Mar 25, 2020 | No |
|
||||
| 2.0 | Sep 16, 2019 | Ended Dec 11, 2019 | No |
|
||||
| 1.7 | Sep 24, 2018 | Ended Dec 31, 2021 | No |
|
||||
|
||||
??? example "Active Support / Security Support"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,252 +1,29 @@
|
|||
# Exposing Services with Traefik on Docker
|
||||
# Exposing Services with Traefik on Docker - Advanced
|
||||
|
||||
This guide will help you expose your services securely through Traefik Proxy using Docker. We'll cover routing HTTP and HTTPS traffic, implementing TLS, adding middlewares, Let's Encrypt integration, and sticky sessions.
|
||||
This guide builds on the concepts and setup from the [Basic Guide](basic.md). Make sure you've completed the basic guide and have a working Traefik setup with Docker before proceeding.
|
||||
|
||||
In this advanced guide, you'll learn how to enhance your Traefik deployment with:
|
||||
|
||||
- **Middlewares** for security headers and access control
|
||||
- **Let's Encrypt** for automated certificate management
|
||||
- **Sticky sessions** for stateful applications
|
||||
- **Multi-layer routing** for hierarchical routing with a complex authentication based routing example
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Completed the [Basic Guide](basic.md)
|
||||
- Docker and Docker Compose installed
|
||||
- Basic understanding of Docker concepts
|
||||
- Traefik deployed using the Traefik Docker Setup guide
|
||||
|
||||
## Expose Your First HTTP Service
|
||||
|
||||
Let's expose a simple HTTP service using the [whoami](https://hub.docker.com/r/traefik/whoami) application. This will demonstrate basic routing to a backend service.
|
||||
|
||||
First, create a `docker-compose.yml` file:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
traefik:
|
||||
image: "traefik:v3.4"
|
||||
container_name: "traefik"
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
networks:
|
||||
- proxy
|
||||
command:
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=proxy"
|
||||
- "--entryPoints.web.address=:80"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
|
||||
whoami:
|
||||
image: "traefik/whoami"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=web"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
name: proxy
|
||||
```
|
||||
|
||||
Save this as `docker-compose.yml` and start the services:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Verify Your Service
|
||||
|
||||
Your service is now available at http://whoami.docker.localhost/. Test that it works:
|
||||
|
||||
```bash
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
```
|
||||
|
||||
You should see output similar to:
|
||||
|
||||
```bash
|
||||
Hostname: whoami
|
||||
IP: 127.0.0.1
|
||||
IP: ::1
|
||||
IP: 172.18.0.3
|
||||
IP: fe80::215:5dff:fe00:c9e
|
||||
RemoteAddr: 172.18.0.2:55108
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.docker.localhost
|
||||
User-Agent: curl/7.68.0
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 172.18.0.1
|
||||
X-Forwarded-Host: whoami.docker.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: 5789f594e7d5
|
||||
X-Real-Ip: 172.18.0.1
|
||||
```
|
||||
|
||||
This confirms that Traefik is successfully routing requests to your whoami application.
|
||||
|
||||
## Add Routing Rules
|
||||
|
||||
Now we'll enhance our routing by directing traffic to different services based on [URL paths](../reference/routing-configuration/http/routing/rules-and-priority.md#path-pathprefix-and-pathregexp). This is useful for API versioning, frontend/backend separation, or organizing microservices.
|
||||
|
||||
Update your `docker-compose.yml` to add another service:
|
||||
|
||||
```yaml
|
||||
# ...
|
||||
|
||||
# New service
|
||||
whoami-api:
|
||||
image: "traefik/whoami"
|
||||
networks:
|
||||
- proxy
|
||||
container_name: "whoami-api"
|
||||
environment:
|
||||
- WHOAMI_NAME=API Service
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# Path-based routing
|
||||
- "traefik.http.routers.whoami-api.rule=Host(`whoami.docker.localhost`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.whoami-api.entrypoints=web"
|
||||
```
|
||||
|
||||
Apply the changes:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Test the Path-Based Routing
|
||||
|
||||
Verify that different paths route to different services:
|
||||
|
||||
```bash
|
||||
# Root path should go to the main whoami service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
|
||||
# /api path should go to the whoami-api service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/api
|
||||
```
|
||||
|
||||
For the `/api` requests, you should see the response showing "API Service" in the environment variables section, confirming that your path-based routing is working correctly.
|
||||
|
||||
## Enable TLS
|
||||
|
||||
Let's secure our service with HTTPS by adding TLS. We'll start with a self-signed certificate for local development.
|
||||
|
||||
### Create a Self-Signed Certificate
|
||||
|
||||
Generate a self-signed certificate:
|
||||
|
||||
```bash
|
||||
mkdir -p certs
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout certs/local.key -out certs/local.crt \
|
||||
-subj "/CN=*.docker.localhost"
|
||||
```
|
||||
|
||||
Create a directory for dynamic configuration and add a TLS configuration file:
|
||||
|
||||
```bash
|
||||
mkdir -p dynamic
|
||||
cat > dynamic/tls.yml << EOF
|
||||
tls:
|
||||
certificates:
|
||||
- certFile: /certs/local.crt
|
||||
keyFile: /certs/local.key
|
||||
EOF
|
||||
```
|
||||
|
||||
Update your `docker-compose.yml` file with the following changes:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
traefik:
|
||||
image: "traefik:v3.4"
|
||||
container_name: "traefik"
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
networks:
|
||||
- proxy
|
||||
command:
|
||||
- "--api.insecure=false"
|
||||
- "--api.dashboard=true"
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=proxy"
|
||||
- "--providers.file.directory=/etc/traefik/dynamic"
|
||||
- "--entryPoints.web.address=:80"
|
||||
- "--entryPoints.websecure.address=:443"
|
||||
- "--entryPoints.websecure.http.tls=true"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
# Add the following volumes
|
||||
- "./certs:/certs:ro"
|
||||
- "./dynamic:/etc/traefik/dynamic:ro"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.dashboard.rule=Host(`dashboard.docker.localhost`)"
|
||||
- "traefik.http.routers.dashboard.entrypoints=websecure"
|
||||
- "traefik.http.routers.dashboard.service=api@internal"
|
||||
# Add the following label
|
||||
- "traefik.http.routers.dashboard.tls=true"
|
||||
|
||||
whoami:
|
||||
image: "traefik/whoami"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=websecure"
|
||||
# Add the following label
|
||||
- "traefik.http.routers.whoami.tls=true"
|
||||
|
||||
whoami-api:
|
||||
image: "traefik/whoami"
|
||||
container_name: "whoami-api"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=API Service
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami-api.rule=Host(`whoami.docker.localhost`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.whoami-api.entrypoints=websecure"
|
||||
# Add the following label
|
||||
- "traefik.http.routers.whoami-api.tls=true"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
name: proxy
|
||||
```
|
||||
|
||||
Apply the changes:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Your browser can access https://whoami.docker.localhost/ for the service. You'll need to accept the security warning for the self-signed certificate.
|
||||
- Working Traefik setup from the basic guide
|
||||
|
||||
## Add Middlewares
|
||||
|
||||
Middlewares allow you to modify requests or responses as they pass through Traefik. Let's add two useful middlewares: [Headers](../reference/routing-configuration/http/middlewares/headers.md) for security and [IP allowlisting](../reference/routing-configuration/http/middlewares/ipallowlist.md) for access control.
|
||||
Middlewares allow you to modify requests or responses as they pass through Traefik. Let's add two useful middlewares: [Headers](../../reference/routing-configuration/http/middlewares/headers.md) for security and [IP allowlisting](../../reference/routing-configuration/http/middlewares/ipallowlist.md) for access control.
|
||||
|
||||
Add the following labels to your whoami service in `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
labels:
|
||||
|
||||
|
||||
# Secure Headers Middleware
|
||||
- "traefik.http.middlewares.secure-headers.headers.frameDeny=true"
|
||||
- "traefik.http.middlewares.secure-headers.headers.sslRedirect=true"
|
||||
|
|
@ -255,10 +32,10 @@ labels:
|
|||
- "traefik.http.middlewares.secure-headers.headers.stsIncludeSubdomains=true"
|
||||
- "traefik.http.middlewares.secure-headers.headers.stsPreload=true"
|
||||
- "traefik.http.middlewares.secure-headers.headers.stsSeconds=31536000"
|
||||
|
||||
|
||||
# IP Allowlist Middleware
|
||||
- "traefik.http.middlewares.ip-allowlist.ipallowlist.sourceRange=127.0.0.1/32,192.168.0.0/16,10.0.0.0/8"
|
||||
|
||||
|
||||
# Apply middlewares to whoami router
|
||||
- "traefik.http.routers.whoami.middlewares=secure-headers,ip-allowlist"
|
||||
```
|
||||
|
|
@ -288,7 +65,7 @@ curl -k -I -H "Host: whoami.docker.localhost" https://localhost/
|
|||
|
||||
In the response headers, you should see security headers set by the middleware:
|
||||
|
||||
- `X-Frame-Options: DENY`
|
||||
- `X-Frame-Options: DENY`
|
||||
- `X-Content-Type-Options: nosniff`
|
||||
- `X-XSS-Protection: 1; mode=block`
|
||||
- `Strict-Transport-Security` with the appropriate settings
|
||||
|
|
@ -438,28 +215,191 @@ You should see different `Hostname` values in these responses, as each request i
|
|||
!!! important "Browser Testing"
|
||||
When testing in browsers, you need to use the same browser session to maintain the cookie. The cookie is set with `httpOnly` and `secure` flags for security, so it will only be sent over HTTPS connections and won't be accessible via JavaScript.
|
||||
|
||||
For more advanced configuration options, see the [reference documentation](../reference/routing-configuration/http/load-balancing/service.md).
|
||||
For more advanced configuration options, see the [reference documentation](../../reference/routing-configuration/http/load-balancing/service.md).
|
||||
|
||||
## Multi-Layer Routing
|
||||
|
||||
Multi-layer routing enables hierarchical relationships between routers, where parent routers can process requests through middleware before child routers make final routing decisions. This is particularly useful for authentication-based routing or staged middleware application.
|
||||
|
||||
!!! info "Provider Requirement"
|
||||
Multi-layer routing requires the File provider, as Docker labels do not support the `parentRefs` field. However, you can use **both Docker and File providers together** - Docker labels for service discovery and File configuration for multi-layer routing.
|
||||
|
||||
### Setup Multi-Layer Routing with Docker
|
||||
|
||||
To use multi-layer routing with Docker, you need to enable the File provider alongside the Docker provider.
|
||||
|
||||
Update your Traefik service in `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
traefik:
|
||||
image: "traefik:latest"
|
||||
container_name: "traefik"
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
networks:
|
||||
- proxy
|
||||
command:
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=proxy"
|
||||
- "--providers.file.directory=/etc/traefik/dynamic" # Enable File provider
|
||||
- "--entryPoints.web.address=:80"
|
||||
- "--entryPoints.websecure.address=:443"
|
||||
- "--entryPoints.websecure.http.tls=true"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
- "./dynamic:/etc/traefik/dynamic:ro" # Mount directory for dynamic config
|
||||
```
|
||||
|
||||
### Authentication-Based Routing Example
|
||||
|
||||
Let's create a multi-layer routing setup where a parent router authenticates requests, and child routers direct traffic based on user roles.
|
||||
|
||||
First, keep your Docker services defined with labels as usual:
|
||||
|
||||
```yaml
|
||||
# In docker-compose.yml
|
||||
services:
|
||||
# ... traefik service from above ...
|
||||
|
||||
# Mock authentication service that adds X-User-Role header
|
||||
auth-service:
|
||||
image: "traefik/whoami"
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=Auth Service
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.services.auth-service.loadbalancer.server.port=80"
|
||||
|
||||
# Admin backend service
|
||||
admin-backend:
|
||||
image: "traefik/whoami"
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=Admin Backend
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.services.admin-backend.loadbalancer.server.port=80"
|
||||
|
||||
# User backend service
|
||||
user-backend:
|
||||
image: "traefik/whoami"
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=User Backend
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.services.user-backend.loadbalancer.server.port=80"
|
||||
```
|
||||
|
||||
Now create the multi-layer routing configuration in a file. Create `dynamic/mlr.yml`:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
routers:
|
||||
# Parent router with authentication middleware
|
||||
api-parent:
|
||||
rule: "Host(`api.docker.localhost`) && PathPrefix(`/api`)"
|
||||
middlewares:
|
||||
- auth-middleware
|
||||
entryPoints:
|
||||
- websecure
|
||||
# Note: No service and no TLS config - this is a parent router
|
||||
|
||||
# Child router for admin users
|
||||
api-admin:
|
||||
rule: "HeadersRegexp(`X-Auth-User`, `admin`)"
|
||||
service: admin-backend@docker # Reference Docker service
|
||||
parentRefs:
|
||||
- api-parent@file # Explicit reference to parent in file provider
|
||||
|
||||
# Child router for regular users
|
||||
api-user:
|
||||
rule: "HeadersRegexp(`X-Auth-User`, `user`)"
|
||||
service: user-backend@docker # Reference Docker service
|
||||
parentRefs:
|
||||
- api-parent@file # Explicit reference to parent in file provider
|
||||
|
||||
middlewares:
|
||||
auth-middleware:
|
||||
basicAuth:
|
||||
users:
|
||||
- "admin:$apr1$DmXR3Add$wfdbGw6RWIhFb0ffXMM4d0"
|
||||
- "user:$apr1$GJtcIY1o$mSLdsWYeXpPHVsxGDqadI."
|
||||
headerField: X-Auth-User
|
||||
```
|
||||
|
||||
!!! note "Generating Password Hashes"
|
||||
The password hashes above are generated using `htpasswd`. To create your own user credentials:
|
||||
|
||||
```bash
|
||||
# Using htpasswd (Apache utils)
|
||||
htpasswd -nb admin yourpassword
|
||||
```
|
||||
|
||||
!!! important "Cross-Provider References"
|
||||
Notice the `@docker` suffix on service names and the `@file` suffix in `parentRefs`. When using the File provider to orchestrate multi-layer routing with Docker services:
|
||||
|
||||
- Use `service-name@docker` to reference Docker services
|
||||
- Use `parent-name@file` in `parentRefs` to reference the parent router in the File provider
|
||||
|
||||
The `@provider` suffix tells Traefik which provider namespace to look in for the resource.
|
||||
|
||||
Apply the changes:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Test Multi-Layer Routing
|
||||
|
||||
Test the routing behavior:
|
||||
|
||||
```bash
|
||||
# Request goes through parent router → auth middleware → admin child router
|
||||
curl -k -u admin:test -H "Host: api.docker.localhost" https://localhost/api
|
||||
```
|
||||
|
||||
You should see the response from the admin-backend service when authenticating as `admin`. Try with `user:test` credentials to reach the user-backend service instead.
|
||||
|
||||
### How It Works
|
||||
|
||||
1. **Request arrives** at `api.docker.localhost/api`
|
||||
2. **Parent router** (`api-parent`) matches based on host and path
|
||||
3. **BasicAuth middleware** authenticates the user and sets the `X-Auth-User` header with the username
|
||||
4. **Child router** (`api-admin` or `api-user`) matches based on the header value
|
||||
5. **Request forwarded** to the appropriate Docker service
|
||||
|
||||
For more details about multi-layer routing, see the [Multi-Layer Routing documentation](../../reference/routing-configuration/http/routing/multi-layer-routing.md).
|
||||
|
||||
## Conclusion
|
||||
|
||||
In this guide, you've learned how to:
|
||||
In this advanced guide, you've learned how to:
|
||||
|
||||
- Expose HTTP services through Traefik in Docker
|
||||
- Set up path-based routing to direct traffic to different backend services
|
||||
- Secure your services with TLS using self-signed certificates
|
||||
- Add security with middlewares like secure headers and IP allow listing
|
||||
- Automate certificate management with Let's Encrypt
|
||||
- Implement sticky sessions for stateful applications
|
||||
- Setup multi-layer routing for authentication-based routing
|
||||
|
||||
These fundamental capabilities provide a solid foundation for exposing any application through Traefik Proxy in Docker. Each of these can be further customized to meet your specific requirements.
|
||||
These advanced capabilities allow you to build production-ready Traefik deployments with Docker. Each of these can be further customized to meet your specific requirements.
|
||||
|
||||
### Next Steps
|
||||
|
||||
Now that you understand the basics of exposing services with Traefik Proxy, you might want to explore:
|
||||
Now that you've mastered both basic and advanced Traefik features with Docker, you might want to explore:
|
||||
|
||||
- [Advanced routing options](../reference/routing-configuration/http/routing/rules-and-priority.md) like query parameter matching, header-based routing, and more
|
||||
- [Additional middlewares](../reference/routing-configuration/http/middlewares/overview.md) for authentication, rate limiting, and request modifications
|
||||
- [Observability features](../reference/install-configuration/observability/metrics.md) for monitoring and debugging your Traefik deployment
|
||||
- [TCP services](../reference/routing-configuration/tcp/service.md) for exposing TCP services
|
||||
- [UDP services](../reference/routing-configuration/udp/service.md) for exposing UDP services
|
||||
- [Docker provider documentation](../reference/install-configuration/providers/docker.md) for more details about the Docker integration
|
||||
- [Advanced routing options](../../reference/routing-configuration/http/routing/rules-and-priority.md) like query parameter matching, header-based routing, and more
|
||||
- [Additional middlewares](../../reference/routing-configuration/http/middlewares/overview.md) for authentication, rate limiting, and request modifications
|
||||
- [Observability features](../../reference/install-configuration/observability/metrics.md) for monitoring and debugging your Traefik deployment
|
||||
- [TCP services](../../reference/routing-configuration/tcp/service.md) for exposing TCP services
|
||||
- [UDP services](../../reference/routing-configuration/udp/service.md) for exposing UDP services
|
||||
- [Docker provider documentation](../../reference/install-configuration/providers/docker.md) for more details about the Docker integration
|
||||
250
docs/content/expose/docker/basic.md
Normal file
250
docs/content/expose/docker/basic.md
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
# Exposing Services with Traefik on Docker - Basic
|
||||
|
||||
This guide will help you get started with exposing your services through Traefik Proxy using Docker. You'll learn the fundamentals of routing HTTP traffic, setting up path-based routing, and securing your services with TLS.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Docker and Docker Compose installed
|
||||
- Basic understanding of Docker concepts
|
||||
- Traefik deployed using the [Traefik Docker Setup guide](../../setup/docker.md)
|
||||
|
||||
## Expose Your First HTTP Service
|
||||
|
||||
Let's expose a simple HTTP service using the [whoami](https://hub.docker.com/r/traefik/whoami) application. This will demonstrate basic routing to a backend service.
|
||||
|
||||
First, create a `docker-compose.yml` file:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
traefik:
|
||||
image: "traefik:v3.4"
|
||||
container_name: "traefik"
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
networks:
|
||||
- proxy
|
||||
command:
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=proxy"
|
||||
- "--entryPoints.web.address=:80"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
|
||||
whoami:
|
||||
image: "traefik/whoami"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=web"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
name: proxy
|
||||
```
|
||||
|
||||
Save this as `docker-compose.yml` and start the services:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Verify Your Service
|
||||
|
||||
Your service is now available at http://whoami.docker.localhost/. Test that it works:
|
||||
|
||||
```bash
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
```
|
||||
|
||||
You should see output similar to:
|
||||
|
||||
```bash
|
||||
Hostname: whoami
|
||||
IP: 127.0.0.1
|
||||
IP: ::1
|
||||
IP: 172.18.0.3
|
||||
IP: fe80::215:5dff:fe00:c9e
|
||||
RemoteAddr: 172.18.0.2:55108
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.docker.localhost
|
||||
User-Agent: curl/7.68.0
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 172.18.0.1
|
||||
X-Forwarded-Host: whoami.docker.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: 5789f594e7d5
|
||||
X-Real-Ip: 172.18.0.1
|
||||
```
|
||||
|
||||
This confirms that Traefik is successfully routing requests to your whoami application.
|
||||
|
||||
## Add Routing Rules
|
||||
|
||||
Now we'll enhance our routing by directing traffic to different services based on [URL paths](../../reference/routing-configuration/http/routing/rules-and-priority.md#path-pathprefix-and-pathregexp). This is useful for API versioning, frontend/backend separation, or organizing microservices.
|
||||
|
||||
Update your `docker-compose.yml` to add another service:
|
||||
|
||||
```yaml
|
||||
# ...
|
||||
|
||||
# New service
|
||||
whoami-api:
|
||||
image: "traefik/whoami"
|
||||
networks:
|
||||
- proxy
|
||||
container_name: "whoami-api"
|
||||
environment:
|
||||
- WHOAMI_NAME=API Service
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# Path-based routing
|
||||
- "traefik.http.routers.whoami-api.rule=Host(`whoami.docker.localhost`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.whoami-api.entrypoints=web"
|
||||
```
|
||||
|
||||
Apply the changes:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Test the Path-Based Routing
|
||||
|
||||
Verify that different paths route to different services:
|
||||
|
||||
```bash
|
||||
# Root path should go to the main whoami service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
|
||||
# /api path should go to the whoami-api service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/api
|
||||
```
|
||||
|
||||
For the `/api` requests, you should see the response showing "API Service" in the environment variables section, confirming that your path-based routing is working correctly.
|
||||
|
||||
## Enable TLS
|
||||
|
||||
Let's secure our service with HTTPS by adding TLS. We'll start with a self-signed certificate for local development.
|
||||
|
||||
### Create a Self-Signed Certificate
|
||||
|
||||
Generate a self-signed certificate:
|
||||
|
||||
```bash
|
||||
mkdir -p certs
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout certs/local.key -out certs/local.crt \
|
||||
-subj "/CN=*.docker.localhost"
|
||||
```
|
||||
|
||||
Create a directory for dynamic configuration and add a TLS configuration file:
|
||||
|
||||
```bash
|
||||
mkdir -p dynamic
|
||||
cat > dynamic/tls.yml << EOF
|
||||
tls:
|
||||
certificates:
|
||||
- certFile: /certs/local.crt
|
||||
keyFile: /certs/local.key
|
||||
EOF
|
||||
```
|
||||
|
||||
Update your `docker-compose.yml` file with the following changes:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
traefik:
|
||||
image: "traefik:v3.4"
|
||||
container_name: "traefik"
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
networks:
|
||||
- proxy
|
||||
command:
|
||||
- "--api.insecure=false"
|
||||
- "--api.dashboard=true"
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=proxy"
|
||||
- "--providers.file.directory=/etc/traefik/dynamic"
|
||||
- "--entryPoints.web.address=:80"
|
||||
- "--entryPoints.websecure.address=:443"
|
||||
- "--entryPoints.websecure.http.tls=true"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
# Add the following volumes
|
||||
- "./certs:/certs:ro"
|
||||
- "./dynamic:/etc/traefik/dynamic:ro"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.dashboard.rule=Host(`dashboard.docker.localhost`)"
|
||||
- "traefik.http.routers.dashboard.entrypoints=websecure"
|
||||
- "traefik.http.routers.dashboard.service=api@internal"
|
||||
# Add the following label
|
||||
- "traefik.http.routers.dashboard.tls=true"
|
||||
|
||||
whoami:
|
||||
image: "traefik/whoami"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=websecure"
|
||||
# Add the following label
|
||||
- "traefik.http.routers.whoami.tls=true"
|
||||
|
||||
whoami-api:
|
||||
image: "traefik/whoami"
|
||||
container_name: "whoami-api"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=API Service
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami-api.rule=Host(`whoami.docker.localhost`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.whoami-api.entrypoints=websecure"
|
||||
# Add the following label
|
||||
- "traefik.http.routers.whoami-api.tls=true"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
name: proxy
|
||||
```
|
||||
|
||||
Apply the changes:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Your browser can access https://whoami.docker.localhost/ for the service. You'll need to accept the security warning for the self-signed certificate.
|
||||
|
||||
## Next Steps
|
||||
|
||||
Now that you've mastered the basics of exposing services with Traefik on Docker, you're ready to explore more advanced features like middlewares, Let's Encrypt certificates, sticky sessions, and multi-layer routing.
|
||||
|
||||
Continue to the [Advanced Guide](advanced.md) to learn about:
|
||||
|
||||
- Adding middlewares for security and access control
|
||||
- Generating certificates with Let's Encrypt
|
||||
- Configuring sticky sessions for stateful applications
|
||||
- Setting up multi-layer routing for authentication-based routing
|
||||
|
|
@ -1,432 +1,25 @@
|
|||
# Exposing Services with Traefik on Kubernetes
|
||||
# Exposing Services with Traefik on Kubernetes - Advanced
|
||||
|
||||
This guide will help you expose your services securely through Traefik Proxy on Kubernetes. We'll cover routing HTTP and HTTPS traffic, implementing TLS, adding security middleware, and configuring sticky sessions. For routing, this guide gives you two options:
|
||||
This guide builds on the concepts and setup from the [Basic Guide](basic.md). Make sure you've completed the basic guide and have a working Traefik setup with Kubernetes before proceeding.
|
||||
|
||||
- [Gateway API](../reference/routing-configuration/kubernetes/gateway-api.md)
|
||||
- [IngressRoute](../reference/routing-configuration/kubernetes/crd/http/ingressroute.md)
|
||||
In this advanced guide, you'll learn how to enhance your Traefik deployment with:
|
||||
|
||||
Feel free to choose the one that fits your needs best.
|
||||
- **Middlewares** for security headers and access control
|
||||
- **Let's Encrypt** for automated certificate management (IngressRoute)
|
||||
- **cert-manager** for automated certificate management (Gateway API)
|
||||
- **Sticky sessions** for stateful applications
|
||||
- **Multi-layer routing** for hierarchical routing with complex authentication scenarios (IngressRoute only)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Completed the [Basic Guide](basic.md)
|
||||
- A Kubernetes cluster with Traefik Proxy installed
|
||||
- `kubectl` configured to interact with your cluster
|
||||
- Traefik deployed using the Traefik Kubernetes Setup guide
|
||||
|
||||
## Expose Your First HTTP Service
|
||||
|
||||
Let's expose a simple HTTP service using the [whoami](https://github.com/traefik/whoami) application. This will demonstrate basic routing to a backend service.
|
||||
|
||||
First, create the deployment and service:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whoami
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: whoami
|
||||
spec:
|
||||
containers:
|
||||
- name: whoami
|
||||
image: traefik/whoami
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: whoami
|
||||
ports:
|
||||
- port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami.yaml
|
||||
```
|
||||
|
||||
Now, let's create routes using either Gateway API or IngressRoute.
|
||||
|
||||
### Using Gateway API
|
||||
|
||||
```yaml
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: traefik-gateway # This Gateway is automatically created by Traefik
|
||||
hostnames:
|
||||
- "whoami.docker.localhost"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-route.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-route.yaml
|
||||
```
|
||||
|
||||
### Using IngressRoute
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
routes:
|
||||
- match: Host(`whoami.docker.localhost`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-ingressroute.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-ingressroute.yaml
|
||||
```
|
||||
|
||||
### Verify Your Service
|
||||
|
||||
Your service is now available at http://whoami.docker.localhost/. Test that it works:
|
||||
|
||||
```bash
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
```
|
||||
|
||||
!!! info
|
||||
Make sure to remove the `ports.web.redirections` block from the `values.yaml` file if you followed the Kubernetes Setup Guide to install Traefik otherwise you will be redirected to the HTTPS entrypoint:
|
||||
|
||||
```yaml
|
||||
redirections:
|
||||
entryPoint:
|
||||
to: websecure
|
||||
```
|
||||
|
||||
You should see output similar to:
|
||||
|
||||
```bash
|
||||
Hostname: whoami-6d5d964cb-8pv4k
|
||||
IP: 127.0.0.1
|
||||
IP: ::1
|
||||
IP: 10.42.0.18
|
||||
IP: fe80::d4c0:3bff:fe20:b0a3
|
||||
RemoteAddr: 10.42.0.17:39872
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.docker.localhost
|
||||
User-Agent: curl/7.68.0
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 10.42.0.1
|
||||
X-Forwarded-Host: whoami.docker.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: traefik-76cbd5b89c-rx5xn
|
||||
X-Real-Ip: 10.42.0.1
|
||||
```
|
||||
|
||||
This confirms that Traefik is successfully routing requests to your whoami application.
|
||||
|
||||
## Add Routing Rules
|
||||
|
||||
Now we'll enhance our routing by directing traffic to different services based on URL paths. This is useful for API versioning, frontend/backend separation, or organizing microservices.
|
||||
|
||||
First, deploy a second service to represent an API:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: whoami-api
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whoami-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: whoami-api
|
||||
spec:
|
||||
containers:
|
||||
- name: whoami
|
||||
image: traefik/whoami
|
||||
env:
|
||||
- name: WHOAMI_NAME
|
||||
value: "API Service"
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: whoami-api
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: whoami-api
|
||||
ports:
|
||||
- port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-api.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-api.yaml
|
||||
```
|
||||
|
||||
Now set up path-based routing:
|
||||
|
||||
### Gateway API with Path Rules
|
||||
|
||||
Update your existing `HTTPRoute` to include path-based routing:
|
||||
|
||||
```yaml
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: traefik-gateway
|
||||
hostnames:
|
||||
- "whoami.docker.localhost"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /api
|
||||
backendRefs:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Update the file `whoami-route.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-route.yaml
|
||||
```
|
||||
|
||||
### IngressRoute with Path Rules
|
||||
|
||||
Update your existing IngressRoute to include path-based routing:
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
routes:
|
||||
- match: Host(`whoami.docker.localhost`) && Path(`/api`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- match: Host(`whoami.docker.localhost`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-ingressroute.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-ingressroute.yaml
|
||||
```
|
||||
|
||||
### Test the Path-Based Routing
|
||||
|
||||
Verify that different paths route to different services:
|
||||
|
||||
```bash
|
||||
# Root path should go to the main whoami service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
|
||||
# /api path should go to the whoami-api service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/api
|
||||
```
|
||||
|
||||
For the `/api` requests, you should see the response showing "API Service" in the environment variables section, confirming that your path-based routing is working correctly:
|
||||
|
||||
```bash
|
||||
{"hostname":"whoami-api-67d97b4868-dvvll","ip":["127.0.0.1","::1","10.42.0.9","fe80::10aa:37ff:fe74:31f2"],"headers":{"Accept":["*/*"],"Accept-Encoding":["gzip"],"User-Agent":["curl/8.7.1"],"X-Forwarded-For":["10.42.0.1"],"X-Forwarded-Host":["whoami.docker.localhost"],"X-Forwarded-Port":["80"],"X-Forwarded-Proto":["http"],"X-Forwarded-Server":["traefik-669c479df8-vkj22"],"X-Real-Ip":["10.42.0.1"]},"url":"/api","host":"whoami.docker.localhost","method":"GET","name":"API Service","remoteAddr":"10.42.0.13:36592"}
|
||||
```
|
||||
|
||||
## Enable TLS
|
||||
|
||||
Let's secure our service with HTTPS by adding TLS. We'll start with a self-signed certificate for local development.
|
||||
|
||||
### Create a Self-Signed Certificate
|
||||
|
||||
Generate a self-signed certificate:
|
||||
|
||||
```bash
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout tls.key -out tls.crt \
|
||||
-subj "/CN=whoami.docker.localhost"
|
||||
```
|
||||
|
||||
Create a TLS secret in Kubernetes:
|
||||
|
||||
```bash
|
||||
kubectl create secret tls whoami-tls --cert=tls.crt --key=tls.key
|
||||
```
|
||||
|
||||
!!! important "Prerequisite for Gateway API with TLS"
|
||||
Before using the Gateway API with TLS, you must define the `websecure` listener in your Traefik installation. This is typically done in your Helm values.
|
||||
|
||||
Example configuration in `values.yaml`:
|
||||
```yaml
|
||||
gateway:
|
||||
listeners:
|
||||
web:
|
||||
port: 80
|
||||
protocol: HTTP
|
||||
namespacePolicy:
|
||||
from: All
|
||||
websecure:
|
||||
port: 443
|
||||
protocol: HTTPS
|
||||
namespacePolicy:
|
||||
from: All
|
||||
mode: Terminate
|
||||
certificateRefs:
|
||||
- kind: Secret
|
||||
name: local-selfsigned-tls
|
||||
group: ""
|
||||
```
|
||||
|
||||
See the Traefik Kubernetes Setup Guide for complete installation details.
|
||||
|
||||
### Gateway API with TLS
|
||||
|
||||
Update your existing `HTTPRoute` to use the secured gateway listener:
|
||||
|
||||
```yaml
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: traefik-gateway
|
||||
sectionName: websecure # The HTTPS listener
|
||||
hostnames:
|
||||
- "whoami.docker.localhost"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /api
|
||||
backendRefs:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Update the file `whoami-route.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-route.yaml
|
||||
```
|
||||
|
||||
### IngressRoute with TLS
|
||||
|
||||
Update your existing IngressRoute to use TLS:
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure # Changed from 'web' to 'websecure'
|
||||
routes:
|
||||
- match: Host(`whoami.docker.localhost`) && Path(`/api`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- match: Host(`whoami.docker.localhost`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami
|
||||
port: 80
|
||||
tls:
|
||||
secretName: whoami-tls # Added TLS configuration
|
||||
```
|
||||
|
||||
Update the file `whoami-ingressroute.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-ingressroute.yaml
|
||||
```
|
||||
|
||||
### Verify HTTPS Access
|
||||
|
||||
Now you can access your service securely. Since we're using a self-signed certificate, you'll need to skip certificate verification:
|
||||
|
||||
```bash
|
||||
curl -k -H "Host: whoami.docker.localhost" https://localhost/
|
||||
```
|
||||
|
||||
Your browser can also access https://whoami.docker.localhost/ (you'll need to accept the security warning for the self-signed certificate).
|
||||
- Working Traefik setup from the basic guide
|
||||
|
||||
## Add Middlewares
|
||||
|
||||
Middlewares allow you to modify requests or responses as they pass through Traefik. Let's add two useful middlewares: [Headers](../reference/routing-configuration/http/middlewares/headers.md) for security and [IP allowlisting](../reference/routing-configuration/http/middlewares/ipallowlist.md) for access control.
|
||||
Middlewares allow you to modify requests or responses as they pass through Traefik. Let's add two useful middlewares: [Headers](../../reference/routing-configuration/http/middlewares/headers.md) for security and [IP allowlisting](../../reference/routing-configuration/http/middlewares/ipallowlist.md) for access control.
|
||||
|
||||
### Create Middlewares
|
||||
|
||||
|
|
@ -469,37 +62,6 @@ kubectl apply -f middlewares.yaml
|
|||
|
||||
In Gateway API, you can apply middlewares using the `ExtensionRef` filter type. This is the preferred and standard way to use Traefik middlewares with Gateway API, as it integrates directly with the HTTPRoute specification.
|
||||
|
||||
First, make sure you have the same middlewares defined:
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: secure-headers
|
||||
namespace: default
|
||||
spec:
|
||||
headers:
|
||||
frameDeny: true
|
||||
sslRedirect: true
|
||||
browserXssFilter: true
|
||||
contentTypeNosniff: true
|
||||
stsIncludeSubdomains: true
|
||||
stsPreload: true
|
||||
stsSeconds: 31536000
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: ip-allowlist
|
||||
namespace: default
|
||||
spec:
|
||||
ipAllowList:
|
||||
sourceRange:
|
||||
- 127.0.0.1/32
|
||||
- 10.0.0.0/8 # Typical cluster network range
|
||||
- 192.168.0.0/16 # Common local network range
|
||||
```
|
||||
|
||||
Now, update your `HTTPRoute` to reference these middlewares using the `ExtensionRef` filter:
|
||||
|
||||
```yaml
|
||||
|
|
@ -525,7 +87,7 @@ spec:
|
|||
group: traefik.io
|
||||
kind: Middleware
|
||||
name: secure-headers
|
||||
- type: ExtensionRef
|
||||
- type: ExtensionRef
|
||||
extensionRef: # IP AllowList Middleware Definition
|
||||
group: traefik.io
|
||||
kind: Middleware
|
||||
|
|
@ -543,7 +105,7 @@ spec:
|
|||
group: traefik.io
|
||||
kind: Middleware
|
||||
name: secure-headers
|
||||
- type: ExtensionRef
|
||||
- type: ExtensionRef
|
||||
extensionRef: # IP AllowList Middleware Definition
|
||||
group: traefik.io
|
||||
kind: Middleware
|
||||
|
|
@ -854,7 +416,7 @@ spec:
|
|||
group: traefik.io
|
||||
kind: Middleware
|
||||
name: secure-headers
|
||||
- type: ExtensionRef
|
||||
- type: ExtensionRef
|
||||
extensionRef: # IP AllowList Middleware Definition
|
||||
group: traefik.io
|
||||
kind: Middleware
|
||||
|
|
@ -876,7 +438,7 @@ spec:
|
|||
group: traefik.io
|
||||
kind: Middleware
|
||||
name: secure-headers
|
||||
- type: ExtensionRef
|
||||
- type: ExtensionRef
|
||||
extensionRef: # IP AllowList Middleware Definition
|
||||
group: traefik.io
|
||||
kind: Middleware
|
||||
|
|
@ -986,29 +548,283 @@ You should see different `Hostname` values in these responses, as each request i
|
|||
!!! important "Browser Testing"
|
||||
When testing in browsers, you need to use the same browser session to maintain the cookie. The cookie is set with `httpOnly` and `secure` flags for security, so it will only be sent over HTTPS connections and won't be accessible via JavaScript.
|
||||
|
||||
For more advanced configuration options, see the [reference documentation](../reference/routing-configuration/http/load-balancing/service.md).
|
||||
For more advanced configuration options, see the [reference documentation](../../reference/routing-configuration/http/load-balancing/service.md).
|
||||
|
||||
## Setup Multi-Layer Routing
|
||||
|
||||
Multi-layer routing enables hierarchical relationships between routers, where parent routers can process requests through middleware before child routers make final routing decisions. This is particularly useful for authentication-based routing or staged middleware application.
|
||||
|
||||
!!! info "IngressRoute Support"
|
||||
Multi-layer routing is **natively supported** by Kubernetes IngressRoute (CRD) using the `spec.parentRefs` field. This feature is not available when using standard Kubernetes Ingress or Gateway API resources.
|
||||
|
||||
### Authentication-Based Routing Example
|
||||
|
||||
Let's create a multi-layer routing setup where a parent IngressRoute authenticates requests, and child IngressRoutes direct traffic based on user roles.
|
||||
|
||||
!!! important "Parent Router Requirements"
|
||||
Parent routers in multi-layer routing must not have a service defined. The child routers will handle the service selection based on their matching rules. Make sure all child IngressRoutes reference the parent correctly using `parentRefs`.
|
||||
|
||||
First, deploy your backend services:
|
||||
|
||||
```yaml
|
||||
# whoami-backends.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: admin-backend
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: admin-backend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: admin-backend
|
||||
spec:
|
||||
containers:
|
||||
- name: whoami
|
||||
image: traefik/whoami
|
||||
env:
|
||||
- name: WHOAMI_NAME
|
||||
value: "Admin Backend"
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: admin-backend
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: admin-backend
|
||||
ports:
|
||||
- port: 80
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: user-backend
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: user-backend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: user-backend
|
||||
spec:
|
||||
containers:
|
||||
- name: whoami
|
||||
image: traefik/whoami
|
||||
env:
|
||||
- name: WHOAMI_NAME
|
||||
value: "User Backend"
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: user-backend
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: user-backend
|
||||
ports:
|
||||
- port: 80
|
||||
```
|
||||
|
||||
Apply the backend services:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-backends.yaml
|
||||
```
|
||||
|
||||
Now create the middleware and IngressRoutes for multi-layer routing:
|
||||
|
||||
```yaml
|
||||
# mlr-ingressroute.yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: auth-secret
|
||||
namespace: default
|
||||
type: Opaque
|
||||
stringData:
|
||||
users: |
|
||||
admin:$apr1$DmXR3Add$wfdbGw6RWIhFb0ffXMM4d0
|
||||
user:$apr1$GJtcIY1o$mSLdsWYeXpPHVsxGDqadI.
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: auth-middleware
|
||||
namespace: default
|
||||
spec:
|
||||
basicAuth:
|
||||
secret: auth-secret
|
||||
headerField: X-Auth-User
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: api-parent
|
||||
namespace: default
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`api.docker.localhost`) && PathPrefix(`/api`)
|
||||
kind: Rule
|
||||
middlewares:
|
||||
- name: auth-middleware
|
||||
# Note: No services and no TLS config - this is a parent IngressRoute
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: api-admin
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: api-parent
|
||||
namespace: default # Optional, defaults to same namespace
|
||||
routes:
|
||||
- match: HeadersRegexp(`X-Auth-User`, `admin`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: admin-backend
|
||||
port: 80
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: api-user
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: api-parent
|
||||
namespace: default # Optional, defaults to same namespace
|
||||
routes:
|
||||
- match: HeadersRegexp(`X-Auth-User`, `user`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: user-backend
|
||||
port: 80
|
||||
```
|
||||
|
||||
!!! note "Generating Password Hashes"
|
||||
The password hashes above are generated using `htpasswd`. To create your own user credentials:
|
||||
|
||||
```bash
|
||||
# Using htpasswd (Apache utils)
|
||||
htpasswd -nb admin yourpassword
|
||||
```
|
||||
|
||||
Apply the multi-layer routing configuration:
|
||||
|
||||
```bash
|
||||
kubectl apply -f mlr-ingressroute.yaml
|
||||
```
|
||||
|
||||
### Test Multi-Layer Routing
|
||||
|
||||
Test the routing behavior:
|
||||
|
||||
```bash
|
||||
# Request goes through parent router → auth middleware → admin child router
|
||||
curl -k -u admin:test -H "Host: api.docker.localhost" https://localhost/api
|
||||
```
|
||||
|
||||
You should see the response from the admin-backend service when authenticating as `admin`. Try with `user:test` credentials to reach the user-backend service instead.
|
||||
|
||||
### How It Works
|
||||
|
||||
1. **Request arrives** at `api.docker.localhost/api`
|
||||
2. **Parent IngressRoute** (`api-parent`) matches based on host and path
|
||||
3. **BasicAuth middleware** authenticates the user and sets the `X-Auth-User` header with the username
|
||||
4. **Child IngressRoute** (`api-admin` or `api-user`) matches based on the header value
|
||||
5. **Request forwarded** to the appropriate Kubernetes service
|
||||
|
||||
### Cross-Namespace Parent References
|
||||
|
||||
You can reference parent IngressRoutes in different namespaces by specifying the `namespace` field:
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: api-child
|
||||
namespace: app-namespace
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: api-parent
|
||||
namespace: shared-namespace # Parent in different namespace
|
||||
routes:
|
||||
- match: Path(`/child`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: child-service
|
||||
port: 80
|
||||
```
|
||||
|
||||
!!! important "Cross-Namespace Requirement"
|
||||
To use cross-namespace parent references, you must enable the `allowCrossNamespace` option in your Traefik Helm values:
|
||||
|
||||
```yaml
|
||||
providers:
|
||||
kubernetesCRD:
|
||||
allowCrossNamespace: true
|
||||
```
|
||||
|
||||
### Multiple Parent References
|
||||
|
||||
Child IngressRoutes can reference multiple parent IngressRoutes:
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: api-child
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: parent-one
|
||||
- name: parent-two
|
||||
routes:
|
||||
- match: Path(`/api`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: child-service
|
||||
port: 80
|
||||
```
|
||||
|
||||
For more details about multi-layer routing, see the [Multi-Layer Routing documentation](../../reference/routing-configuration/http/routing/multi-layer-routing.md).
|
||||
|
||||
## Conclusion
|
||||
|
||||
In this guide, you've learned how to:
|
||||
In this advanced guide, you've learned how to:
|
||||
|
||||
- Expose HTTP services through Traefik in Kubernetes using both Gateway API and IngressRoute
|
||||
- Set up path-based routing to direct traffic to different backend services
|
||||
- Secure your services with TLS using self-signed certificates
|
||||
- Add security with middlewares like secure headers and IP allow listing
|
||||
- Automate certificate management with Let's Encrypt
|
||||
- Automate certificate management with Let's Encrypt (IngressRoute) and cert-manager (Gateway API)
|
||||
- Implement sticky sessions for stateful applications
|
||||
- Setup multi-layer routing for authentication-based routing (IngressRoute only)
|
||||
|
||||
These fundamental capabilities provide a solid foundation for exposing any application through Traefik Proxy in Kubernetes. Each of these can be further customized to meet your specific requirements.
|
||||
These advanced capabilities allow you to build production-ready Traefik deployments with Kubernetes. Each of these can be further customized to meet your specific requirements.
|
||||
|
||||
### Next Steps
|
||||
|
||||
Now that you understand the basics of exposing services with Traefik Proxy, you might want to explore:
|
||||
Now that you've mastered both basic and advanced Traefik features with Kubernetes, you might want to explore:
|
||||
|
||||
- [Advanced routing options](../reference/routing-configuration/http/routing/rules-and-priority.md) like query parameter matching, header-based routing, and more
|
||||
- [Additional middlewares](../reference/routing-configuration/http/middlewares/overview.md) for authentication, rate limiting, and request modifications
|
||||
- [Observability features](../reference/install-configuration/observability/metrics.md) for monitoring and debugging your Traefik deployment
|
||||
- [TCP services](../reference/routing-configuration/tcp/service.md) for exposing TCP services
|
||||
- [UDP services](../reference/routing-configuration/udp/service.md) for exposing UDP services
|
||||
- [Kubernetes Provider documentation](../reference/install-configuration/providers/kubernetes/kubernetes-crd.md) for more details about the Kubernetes integration.
|
||||
- [Gateway API provider documentation](../reference/install-configuration/providers/kubernetes/kubernetes-gateway.md) for more details about the Gateway API integration.
|
||||
- [Advanced routing options](../../reference/routing-configuration/http/routing/rules-and-priority.md) like query parameter matching, header-based routing, and more
|
||||
- [Additional middlewares](../../reference/routing-configuration/http/middlewares/overview.md) for authentication, rate limiting, and request modifications
|
||||
- [Observability features](../../reference/install-configuration/observability/metrics.md) for monitoring and debugging your Traefik deployment
|
||||
- [TCP services](../../reference/routing-configuration/tcp/service.md) for exposing TCP services
|
||||
- [UDP services](../../reference/routing-configuration/udp/service.md) for exposing UDP services
|
||||
- [Kubernetes Provider documentation](../../reference/install-configuration/providers/kubernetes/kubernetes-crd.md) for more details about the Kubernetes integration
|
||||
- [Gateway API provider documentation](../../reference/install-configuration/providers/kubernetes/kubernetes-gateway.md) for more details about the Gateway API integration
|
||||
438
docs/content/expose/kubernetes/basic.md
Normal file
438
docs/content/expose/kubernetes/basic.md
Normal file
|
|
@ -0,0 +1,438 @@
|
|||
# Exposing Services with Traefik on Kubernetes - Basic
|
||||
|
||||
This guide will help you get started with exposing your services through Traefik Proxy on Kubernetes. You'll learn the fundamentals of routing HTTP traffic, setting up path-based routing, and securing your services with TLS.
|
||||
|
||||
For routing, this guide gives you two options:
|
||||
|
||||
- [Gateway API](../../reference/routing-configuration/kubernetes/gateway-api.md)
|
||||
- [IngressRoute](../../reference/routing-configuration/kubernetes/crd/http/ingressroute.md)
|
||||
|
||||
Feel free to choose the one that fits your needs best.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A Kubernetes cluster with Traefik Proxy installed
|
||||
- `kubectl` configured to interact with your cluster
|
||||
- Traefik deployed using the [Traefik Kubernetes Setup guide](../../setup/kubernetes.md)
|
||||
|
||||
## Expose Your First HTTP Service
|
||||
|
||||
Let's expose a simple HTTP service using the [whoami](https://github.com/traefik/whoami) application. This will demonstrate basic routing to a backend service.
|
||||
|
||||
First, create the deployment and service:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whoami
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: whoami
|
||||
spec:
|
||||
containers:
|
||||
- name: whoami
|
||||
image: traefik/whoami
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: whoami
|
||||
ports:
|
||||
- port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami.yaml
|
||||
```
|
||||
|
||||
Now, let's create routes using either Gateway API or IngressRoute.
|
||||
|
||||
### Using Gateway API
|
||||
|
||||
```yaml
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: traefik-gateway # This Gateway is automatically created by Traefik
|
||||
hostnames:
|
||||
- "whoami.docker.localhost"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-route.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-route.yaml
|
||||
```
|
||||
|
||||
### Using IngressRoute
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
routes:
|
||||
- match: Host(`whoami.docker.localhost`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-ingressroute.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-ingressroute.yaml
|
||||
```
|
||||
|
||||
### Verify Your Service
|
||||
|
||||
Your service is now available at http://whoami.docker.localhost/. Test that it works:
|
||||
|
||||
```bash
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
```
|
||||
|
||||
!!! info
|
||||
Make sure to remove the `ports.web.redirections` block from the `values.yaml` file if you followed the Kubernetes Setup Guide to install Traefik otherwise you will be redirected to the HTTPS entrypoint:
|
||||
|
||||
```yaml
|
||||
redirections:
|
||||
entryPoint:
|
||||
to: websecure
|
||||
```
|
||||
|
||||
You should see output similar to:
|
||||
|
||||
```bash
|
||||
Hostname: whoami-6d5d964cb-8pv4k
|
||||
IP: 127.0.0.1
|
||||
IP: ::1
|
||||
IP: 10.42.0.18
|
||||
IP: fe80::d4c0:3bff:fe20:b0a3
|
||||
RemoteAddr: 10.42.0.17:39872
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.docker.localhost
|
||||
User-Agent: curl/7.68.0
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 10.42.0.1
|
||||
X-Forwarded-Host: whoami.docker.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: traefik-76cbd5b89c-rx5xn
|
||||
X-Real-Ip: 10.42.0.1
|
||||
```
|
||||
|
||||
This confirms that Traefik is successfully routing requests to your whoami application.
|
||||
|
||||
## Add Routing Rules
|
||||
|
||||
Now we'll enhance our routing by directing traffic to different services based on URL paths. This is useful for API versioning, frontend/backend separation, or organizing microservices.
|
||||
|
||||
First, deploy a second service to represent an API:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: whoami-api
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: whoami-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: whoami-api
|
||||
spec:
|
||||
containers:
|
||||
- name: whoami
|
||||
image: traefik/whoami
|
||||
env:
|
||||
- name: WHOAMI_NAME
|
||||
value: "API Service"
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: whoami-api
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
app: whoami-api
|
||||
ports:
|
||||
- port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-api.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-api.yaml
|
||||
```
|
||||
|
||||
Now set up path-based routing:
|
||||
|
||||
### Gateway API with Path Rules
|
||||
|
||||
Update your existing `HTTPRoute` to include path-based routing:
|
||||
|
||||
```yaml
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: traefik-gateway
|
||||
hostnames:
|
||||
- "whoami.docker.localhost"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /api
|
||||
backendRefs:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Update the file `whoami-route.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-route.yaml
|
||||
```
|
||||
|
||||
### IngressRoute with Path Rules
|
||||
|
||||
Update your existing IngressRoute to include path-based routing:
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
routes:
|
||||
- match: Host(`whoami.docker.localhost`) && Path(`/api`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- match: Host(`whoami.docker.localhost`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Save this as `whoami-ingressroute.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-ingressroute.yaml
|
||||
```
|
||||
|
||||
### Test the Path-Based Routing
|
||||
|
||||
Verify that different paths route to different services:
|
||||
|
||||
```bash
|
||||
# Root path should go to the main whoami service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/
|
||||
|
||||
# /api path should go to the whoami-api service
|
||||
curl -H "Host: whoami.docker.localhost" http://localhost/api
|
||||
```
|
||||
|
||||
For the `/api` requests, you should see the response showing "API Service" in the environment variables section, confirming that your path-based routing is working correctly:
|
||||
|
||||
```bash
|
||||
{"hostname":"whoami-api-67d97b4868-dvvll","ip":["127.0.0.1","::1","10.42.0.9","fe80::10aa:37ff:fe74:31f2"],"headers":{"Accept":["*/*"],"Accept-Encoding":["gzip"],"User-Agent":["curl/8.7.1"],"X-Forwarded-For":["10.42.0.1"],"X-Forwarded-Host":["whoami.docker.localhost"],"X-Forwarded-Port":["80"],"X-Forwarded-Proto":["http"],"X-Forwarded-Server":["traefik-669c479df8-vkj22"],"X-Real-Ip":["10.42.0.1"]},"url":"/api","host":"whoami.docker.localhost","method":"GET","name":"API Service","remoteAddr":"10.42.0.13:36592"}
|
||||
```
|
||||
|
||||
## Enable TLS
|
||||
|
||||
Let's secure our service with HTTPS by adding TLS. We'll start with a self-signed certificate for local development.
|
||||
|
||||
### Create a Self-Signed Certificate
|
||||
|
||||
Generate a self-signed certificate:
|
||||
|
||||
```bash
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout tls.key -out tls.crt \
|
||||
-subj "/CN=whoami.docker.localhost"
|
||||
```
|
||||
|
||||
Create a TLS secret in Kubernetes:
|
||||
|
||||
```bash
|
||||
kubectl create secret tls whoami-tls --cert=tls.crt --key=tls.key
|
||||
```
|
||||
|
||||
!!! important "Prerequisite for Gateway API with TLS"
|
||||
Before using the Gateway API with TLS, you must define the `websecure` listener in your Traefik installation. This is typically done in your Helm values.
|
||||
|
||||
Example configuration in `values.yaml`:
|
||||
```yaml
|
||||
gateway:
|
||||
listeners:
|
||||
web:
|
||||
port: 80
|
||||
protocol: HTTP
|
||||
namespacePolicy:
|
||||
from: All
|
||||
websecure:
|
||||
port: 443
|
||||
protocol: HTTPS
|
||||
namespacePolicy:
|
||||
from: All
|
||||
mode: Terminate
|
||||
certificateRefs:
|
||||
- kind: Secret
|
||||
name: local-selfsigned-tls
|
||||
group: ""
|
||||
```
|
||||
|
||||
See the Traefik Kubernetes Setup Guide for complete installation details.
|
||||
|
||||
### Gateway API with TLS
|
||||
|
||||
Update your existing `HTTPRoute` to use the secured gateway listener:
|
||||
|
||||
```yaml
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: traefik-gateway
|
||||
sectionName: websecure # The HTTPS listener
|
||||
hostnames:
|
||||
- "whoami.docker.localhost"
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /api
|
||||
backendRefs:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: whoami
|
||||
port: 80
|
||||
```
|
||||
|
||||
Update the file `whoami-route.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-route.yaml
|
||||
```
|
||||
|
||||
### IngressRoute with TLS
|
||||
|
||||
Update your existing IngressRoute to use TLS:
|
||||
|
||||
```yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: whoami
|
||||
namespace: default
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure # Changed from 'web' to 'websecure'
|
||||
routes:
|
||||
- match: Host(`whoami.docker.localhost`) && Path(`/api`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami-api
|
||||
port: 80
|
||||
- match: Host(`whoami.docker.localhost`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: whoami
|
||||
port: 80
|
||||
tls:
|
||||
secretName: whoami-tls # Added TLS configuration
|
||||
```
|
||||
|
||||
Update the file `whoami-ingressroute.yaml` and apply it:
|
||||
|
||||
```bash
|
||||
kubectl apply -f whoami-ingressroute.yaml
|
||||
```
|
||||
|
||||
### Verify HTTPS Access
|
||||
|
||||
Now you can access your service securely. Since we're using a self-signed certificate, you'll need to skip certificate verification:
|
||||
|
||||
```bash
|
||||
curl -k -H "Host: whoami.docker.localhost" https://localhost/
|
||||
```
|
||||
|
||||
Your browser can also access https://whoami.docker.localhost/ (you'll need to accept the security warning for the self-signed certificate).
|
||||
|
||||
## Next Steps
|
||||
|
||||
Now that you've mastered the basics of exposing services with Traefik on Kubernetes, you're ready to explore more advanced features like middlewares, Let's Encrypt certificates, sticky sessions, and multi-layer routing.
|
||||
|
||||
Continue to the [Advanced Guide](advanced.md) to learn about:
|
||||
|
||||
- Adding middlewares for security and access control
|
||||
- Generating certificates with Let's Encrypt (IngressRoute) or cert-manager (Gateway API)
|
||||
- Configuring sticky sessions for stateful applications
|
||||
- Setting up multi-layer routing for authentication-based routing with IngressRoute
|
||||
|
|
@ -17,6 +17,100 @@ Following these guides, you'll learn how to:
|
|||
|
||||
For detailed steps tailored to your environment, follow the guide for your platform:
|
||||
|
||||
- [Kubernetes](./kubernetes.md)
|
||||
- [Docker](./docker.md)
|
||||
- [Docker Swarm](./swarm.md)
|
||||
- [Kubernetes](./kubernetes/basic.md)
|
||||
- [Docker](./docker/basic.md)
|
||||
- [Docker Swarm](./swarm/basic.md)
|
||||
|
||||
## Advanced Use Cases
|
||||
|
||||
### Exposing gRPC Services
|
||||
|
||||
Traefik Proxy supports gRPC applications without requiring specific configuration. You can expose gRPC services using either HTTP (h2c) or HTTPS.
|
||||
|
||||
??? example "Using HTTP (h2c)"
|
||||
|
||||
For unencrypted gRPC communication, configure your service to use the `h2c://` protocol scheme:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
routers:
|
||||
grpc-router:
|
||||
service: grpc-service
|
||||
rule: Host(`grpc.example.com`)
|
||||
|
||||
services:
|
||||
grpc-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: h2c://backend:8080
|
||||
```
|
||||
|
||||
!!! note
|
||||
For providers with labels (Docker, Kubernetes), specify the scheme using:
|
||||
`traefik.http.services.<service-name>.loadbalancer.server.scheme=h2c`
|
||||
|
||||
??? example "Using HTTPS"
|
||||
|
||||
For encrypted gRPC communication, use standard HTTPS URLs. Traefik will use HTTP/2 over TLS to communicate with your gRPC backend:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
routers:
|
||||
grpc-router:
|
||||
service: grpc-service
|
||||
rule: Host(`grpc.example.com`)
|
||||
tls: {}
|
||||
|
||||
services:
|
||||
grpc-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: https://backend:8080
|
||||
```
|
||||
|
||||
Traefik handles the protocol negotiation automatically. Configure TLS certificates for your backends using [ServersTransport](../reference/routing-configuration/http/load-balancing/serverstransport.md) if needed.
|
||||
|
||||
### Exposing WebSocket Services
|
||||
|
||||
Traefik Proxy supports WebSocket (WS) and WebSocket Secure (WSS) connections out of the box. No special configuration is required beyond standard HTTP routing.
|
||||
|
||||
??? example "Basic WebSocket"
|
||||
|
||||
Configure a router and service pointing to your WebSocket server. Traefik automatically detects and handles the WebSocket upgrade:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
routers:
|
||||
websocket-router:
|
||||
rule: Host(`ws.example.com`)
|
||||
service: websocket-service
|
||||
|
||||
services:
|
||||
websocket-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: http://websocket-backend:8000
|
||||
```
|
||||
|
||||
??? example "WebSocket Secure (WSS)"
|
||||
|
||||
For encrypted WebSocket connections, enable TLS on your router. Clients connect using `wss://` while you can choose whether backends use encrypted or unencrypted connections:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
routers:
|
||||
websocket-secure-router:
|
||||
rule: Host(`wss.example.com`)
|
||||
service: websocket-service
|
||||
tls: {}
|
||||
|
||||
services:
|
||||
websocket-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: http://websocket-backend:8000 # SSL termination at Traefik
|
||||
# OR
|
||||
# - url: https://websocket-backend:8443 # End-to-end encryption
|
||||
```
|
||||
|
||||
Traefik preserves WebSocket headers including `Origin`, `Sec-WebSocket-Key`, and `Sec-WebSocket-Version`. Use the [Headers middleware](../reference/routing-configuration/http/middlewares/headers.md) if you need to modify headers for origin checking or other requirements.
|
||||
|
|
|
|||
|
|
@ -1,186 +1,23 @@
|
|||
# Exposing Services with Traefik on Docker Swarm
|
||||
# Exposing Services with Traefik on Docker Swarm - Advanced
|
||||
|
||||
This guide will help you expose your services securely through Traefik Proxy using Docker Swarm. We'll cover routing HTTP and HTTPS traffic, implementing TLS, adding middlewares, Let's Encrypt integration, and sticky sessions.
|
||||
This guide builds on the concepts and setup from the [Basic Guide](basic.md). Make sure you've completed the basic guide and have a working Traefik setup with Docker Swarm before proceeding.
|
||||
|
||||
In this advanced guide, you'll learn how to enhance your Traefik deployment with:
|
||||
|
||||
- **Middlewares** for security headers and access control
|
||||
- **Let's Encrypt** for automated certificate management
|
||||
- **Sticky sessions** for stateful applications
|
||||
- **Multi-layer routing** for complex authentication scenarios
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Completed the [Basic Guide](basic.md)
|
||||
- Docker Swarm cluster initialized
|
||||
- Basic understanding of Docker Swarm concepts
|
||||
- Traefik deployed using the Traefik Docker Swarm Setup guide
|
||||
|
||||
## Expose Your First HTTP Service
|
||||
|
||||
Let's expose a simple HTTP service using the [whoami](https://hub.docker.com/r/traefik/whoami) application. This will demonstrate basic routing to a backend service.
|
||||
|
||||
First, update your existing `docker-compose.yml` file if you haven't already:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
whoami:
|
||||
image: traefik/whoami
|
||||
networks:
|
||||
- traefik_proxy
|
||||
deploy:
|
||||
replicas: 3
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.swarm.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=web,websecure"
|
||||
```
|
||||
|
||||
Save this as `docker-compose.yml` and deploy the stack:
|
||||
|
||||
```bash
|
||||
docker stack deploy -c docker-compose.yml traefik
|
||||
```
|
||||
|
||||
### Verify Your Service
|
||||
|
||||
Your service is now available at http://whoami.swarm.localhost/. Test that it works:
|
||||
|
||||
```bash
|
||||
curl -H "Host: whoami.swarm.localhost" http://localhost/
|
||||
```
|
||||
|
||||
You should see output similar to:
|
||||
|
||||
```bash
|
||||
Hostname: whoami.1.7c8f7tr56q3p949rscxrkp80e
|
||||
IP: 127.0.0.1
|
||||
IP: ::1
|
||||
IP: 10.0.1.8
|
||||
IP: fe80::215:5dff:fe00:c9e
|
||||
RemoteAddr: 10.0.1.2:45098
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.swarm.localhost
|
||||
User-Agent: curl/7.68.0
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 10.0.1.1
|
||||
X-Forwarded-Host: whoami.swarm.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: 5789f594e7d5
|
||||
X-Real-Ip: 10.0.1.1
|
||||
```
|
||||
|
||||
This confirms that Traefik is successfully routing requests to your whoami application.
|
||||
|
||||
## Add Routing Rules
|
||||
|
||||
Now we'll enhance our routing by directing traffic to different services based on [URL paths](../reference/routing-configuration/http/routing/rules-and-priority.md#path-pathprefix-and-pathregexp). This is useful for API versioning, frontend/backend separation, or organizing microservices.
|
||||
|
||||
Update your `docker-compose.yml` to add another service:
|
||||
|
||||
```yaml
|
||||
# ...
|
||||
|
||||
# New service
|
||||
whoami-api:
|
||||
image: traefik/whoami
|
||||
networks:
|
||||
- traefik_proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=API Service
|
||||
deploy:
|
||||
replicas: 2
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# Path-based routing
|
||||
- "traefik.http.routers.whoami-api.rule=Host(`whoami.swarm.localhost`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.whoami-api.entrypoints=web,websecure"
|
||||
- "traefik.http.routers.whoami-api.service=whoami-api-svc"
|
||||
- "traefik.http.services.whoami-api-svc.loadbalancer.server.port=80"
|
||||
|
||||
# ...
|
||||
```
|
||||
|
||||
Apply the changes:
|
||||
|
||||
```bash
|
||||
docker stack deploy -c docker-compose.yml traefik
|
||||
```
|
||||
|
||||
### Test the Path-Based Routing
|
||||
|
||||
Verify that different paths route to different services:
|
||||
|
||||
```bash
|
||||
# Root path should go to the main whoami service
|
||||
curl -H "Host: whoami.swarm.localhost" http://localhost/
|
||||
|
||||
# /api path should go to the whoami-api service
|
||||
curl -H "Host: whoami.swarm.localhost" http://localhost/api
|
||||
```
|
||||
|
||||
For the `/api` requests, you should see the response showing "API Service" in the environment variables section, confirming that your path-based routing is working correctly.
|
||||
|
||||
## Enable TLS
|
||||
|
||||
Let's secure our service with HTTPS by adding TLS. We'll start with a self-signed certificate for local development.
|
||||
|
||||
### Create a Self-Signed Certificate
|
||||
|
||||
Generate a self-signed certificate and dynamic config file to tell Traefik where the cert lives:
|
||||
|
||||
```bash
|
||||
mkdir -p certs
|
||||
|
||||
# key + cert (valid for one year)
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout certs/local.key -out certs/local.crt \
|
||||
-subj "/CN=*.swarm.localhost"
|
||||
|
||||
# dynamic config that tells Traefik where the cert lives
|
||||
cat > certs/tls.yml <<'EOF'
|
||||
tls:
|
||||
certificates:
|
||||
- certFile: /certificates/local.crt
|
||||
keyFile: /certificates/local.key
|
||||
EOF
|
||||
```
|
||||
|
||||
Create a Docker config for the certificate files:
|
||||
|
||||
```bash
|
||||
docker config create swarm-cert.crt certs/local.crt
|
||||
docker config create swarm-cert.key certs/local.key
|
||||
docker config create swarm-tls.yml certs/tls.yml
|
||||
```
|
||||
|
||||
Update your `docker-compose.yml` file with the following changes:
|
||||
|
||||
```yaml
|
||||
# Add to the Traefik command section:
|
||||
command:
|
||||
# ... existing commands ...
|
||||
- "--entryPoints.websecure.address=:443"
|
||||
- "--entryPoints.websecure.http.tls=true"
|
||||
- "--providers.file.directory=/etc/traefik/dynamic"
|
||||
```
|
||||
|
||||
```yaml
|
||||
# Add to the root of your docker-compose.yml file:
|
||||
configs:
|
||||
swarm-cert.crt:
|
||||
file: ./certs/local.crt
|
||||
swarm-cert.key:
|
||||
file: ./certs/local.key
|
||||
swarm-tls.yml:
|
||||
file: ./certs/tls.yml
|
||||
```
|
||||
|
||||
Deploy the stack:
|
||||
|
||||
```bash
|
||||
docker stack deploy -c docker-compose.yml traefik
|
||||
```
|
||||
|
||||
Your browser can access https://whoami.swarm.localhost/ for the service. You'll need to accept the security warning for the self-signed certificate.
|
||||
- Working Traefik setup from the basic guide
|
||||
|
||||
## Add Middlewares
|
||||
|
||||
Middlewares allow you to modify requests or responses as they pass through Traefik. Let's add two useful middlewares: [Headers](../reference/routing-configuration/http/middlewares/headers.md) for security and [IP allowlisting](../reference/routing-configuration/http/middlewares/ipallowlist.md) for access control.
|
||||
Middlewares allow you to modify requests or responses as they pass through Traefik. Let's add two useful middlewares: [Headers](../../reference/routing-configuration/http/middlewares/headers.md) for security and [IP allowlisting](../../reference/routing-configuration/http/middlewares/ipallowlist.md) for access control.
|
||||
|
||||
Add the following labels to your whoami service deployment section in `docker-compose.yml`:
|
||||
|
||||
|
|
@ -189,7 +26,7 @@ deploy:
|
|||
# ... existing configuration ...
|
||||
labels:
|
||||
# ... existing labels ...
|
||||
|
||||
|
||||
# Secure Headers Middleware
|
||||
- "traefik.http.middlewares.secure-headers.headers.frameDeny=true"
|
||||
- "traefik.http.middlewares.secure-headers.headers.sslRedirect=true"
|
||||
|
|
@ -198,10 +35,10 @@ deploy:
|
|||
- "traefik.http.middlewares.secure-headers.headers.stsIncludeSubdomains=true"
|
||||
- "traefik.http.middlewares.secure-headers.headers.stsPreload=true"
|
||||
- "traefik.http.middlewares.secure-headers.headers.stsSeconds=31536000"
|
||||
|
||||
|
||||
# IP Allowlist Middleware
|
||||
- "traefik.http.middlewares.ip-allowlist.ipallowlist.sourceRange=127.0.0.1/32,192.168.0.0/16,10.0.0.0/8"
|
||||
|
||||
|
||||
# Apply the middlewares
|
||||
- "traefik.http.routers.whoami.middlewares=secure-headers,ip-allowlist"
|
||||
```
|
||||
|
|
@ -332,7 +169,7 @@ deploy:
|
|||
# ... existing configuration ...
|
||||
labels:
|
||||
# ... existing labels ...
|
||||
|
||||
|
||||
# Sticky Sessions Configuration
|
||||
- "traefik.http.services.whoami.loadbalancer.sticky.cookie=true"
|
||||
- "traefik.http.services.whoami.loadbalancer.sticky.cookie.name=sticky_cookie"
|
||||
|
|
@ -374,28 +211,195 @@ You should see different `Hostname` values in these responses, as each request i
|
|||
!!! important "Browser Testing"
|
||||
When testing in browsers, you need to use the same browser session to maintain the cookie. The cookie is set with `httpOnly` and `secure` flags for security, so it will only be sent over HTTPS connections and won't be accessible via JavaScript.
|
||||
|
||||
For more advanced configuration options, see the [reference documentation](../reference/routing-configuration/http/load-balancing/service.md).
|
||||
For more advanced configuration options, see the [reference documentation](../../reference/routing-configuration/http/load-balancing/service.md).
|
||||
|
||||
## Multi-Layer Routing
|
||||
|
||||
Multi-layer routing enables hierarchical relationships between routers, where parent routers can process requests through middleware before child routers make final routing decisions. This is particularly useful for authentication-based routing or staged middleware application.
|
||||
|
||||
!!! info "Provider Requirement"
|
||||
Multi-layer routing requires the File provider, as Docker Swarm labels do not support the `parentRefs` field. However, you can use **both Docker Swarm and File providers together** - Swarm labels for service discovery and File configuration for multi-layer routing.
|
||||
|
||||
### Setup Multi-Layer Routing with Docker Swarm
|
||||
|
||||
To use multi-layer routing with Docker Swarm, you need to enable the File provider alongside the Docker provider.
|
||||
|
||||
Update your Traefik service in `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v3.4
|
||||
command:
|
||||
- "--api.dashboard=true"
|
||||
- "--providers.docker.swarmMode=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=traefik_proxy"
|
||||
- "--providers.file.directory=/etc/traefik/dynamic" # Enable File provider
|
||||
- "--entrypoints.web.address=:80"
|
||||
- "--entrypoints.websecure.address=:443"
|
||||
- "--entrypoints.websecure.http.tls=true"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
configs:
|
||||
- source: mlr-config
|
||||
target: /etc/traefik/dynamic/mlr.yml
|
||||
networks:
|
||||
- traefik_proxy
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == manager
|
||||
|
||||
configs:
|
||||
mlr-config:
|
||||
file: ./dynamic/mlr.yml
|
||||
|
||||
networks:
|
||||
traefik_proxy:
|
||||
external: true
|
||||
```
|
||||
|
||||
### Authentication-Based Routing Example
|
||||
|
||||
Let's create a multi-layer routing setup where a parent router authenticates requests, and child routers direct traffic based on user roles.
|
||||
|
||||
First, keep your Docker Swarm services defined with labels as usual:
|
||||
|
||||
```yaml
|
||||
# In docker-compose.yml
|
||||
services:
|
||||
# ... traefik service from above ...
|
||||
|
||||
# Admin backend service
|
||||
admin-backend:
|
||||
image: traefik/whoami
|
||||
networks:
|
||||
- traefik_proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=Admin Backend
|
||||
deploy:
|
||||
replicas: 2
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.services.admin-backend.loadbalancer.server.port=80"
|
||||
|
||||
# User backend service
|
||||
user-backend:
|
||||
image: traefik/whoami
|
||||
networks:
|
||||
- traefik_proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=User Backend
|
||||
deploy:
|
||||
replicas: 2
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.services.user-backend.loadbalancer.server.port=80"
|
||||
```
|
||||
|
||||
Now create the multi-layer routing configuration in a file. Create `dynamic/mlr.yml`:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
routers:
|
||||
# Parent router with authentication middleware
|
||||
api-parent:
|
||||
rule: "Host(`api.swarm.localhost`) && PathPrefix(`/api`)"
|
||||
middlewares:
|
||||
- auth-middleware
|
||||
entryPoints:
|
||||
- websecure
|
||||
# Note: No service and no TLS config - this is a parent router
|
||||
|
||||
# Child router for admin users
|
||||
api-admin:
|
||||
rule: "HeadersRegexp(`X-Auth-User`, `admin`)"
|
||||
service: admin-backend@swarm # Reference Swarm service
|
||||
parentRefs:
|
||||
- api-parent@file # Explicit reference to parent in file provider
|
||||
|
||||
# Child router for regular users
|
||||
api-user:
|
||||
rule: "HeadersRegexp(`X-Auth-User`, `user`)"
|
||||
service: user-backend@swarm # Reference Swarm service
|
||||
parentRefs:
|
||||
- api-parent@file # Explicit reference to parent in file provider
|
||||
|
||||
middlewares:
|
||||
auth-middleware:
|
||||
basicAuth:
|
||||
users:
|
||||
- "admin:$apr1$DmXR3Add$wfdbGw6RWIhFb0ffXMM4d0"
|
||||
- "user:$apr1$GJtcIY1o$mSLdsWYeXpPHVsxGDqadI."
|
||||
headerField: X-Auth-User
|
||||
```
|
||||
|
||||
!!! note "Generating Password Hashes"
|
||||
The password hashes above are generated using `htpasswd`. To create your own user credentials:
|
||||
|
||||
```bash
|
||||
# Using htpasswd (Apache utils)
|
||||
htpasswd -nb admin yourpassword
|
||||
```
|
||||
|
||||
!!! important "Cross-Provider References"
|
||||
Notice the `@swarm` suffix on service names and the `@file` suffix in `parentRefs`. When using the File provider to orchestrate multi-layer routing with Swarm services:
|
||||
|
||||
- Use `service-name@swarm` to reference Swarm services
|
||||
- Use `parent-name@file` in `parentRefs` to reference the parent router in the File provider
|
||||
|
||||
The `@provider` suffix tells Traefik which provider namespace to look in for the resource.
|
||||
|
||||
Deploy the stack:
|
||||
|
||||
```bash
|
||||
docker stack deploy -c docker-compose.yml traefik
|
||||
```
|
||||
|
||||
### Test Multi-Layer Routing
|
||||
|
||||
Test the routing behavior:
|
||||
|
||||
```bash
|
||||
# Request goes through parent router → auth middleware → admin child router
|
||||
curl -k -u admin:test -H "Host: api.swarm.localhost" https://localhost/api
|
||||
```
|
||||
|
||||
You should see the response from the admin-backend service when authenticating as `admin`. Try with `user:test` credentials to reach the user-backend service instead.
|
||||
|
||||
### How It Works
|
||||
|
||||
1. **Request arrives** at `api.swarm.localhost/api`
|
||||
2. **Parent router** (`api-parent`) matches based on host and path
|
||||
3. **BasicAuth middleware** authenticates the user and sets the `X-Auth-User` header with the username
|
||||
4. **Child router** (`api-admin` or `api-user`) matches based on the header value
|
||||
5. **Request forwarded** to the appropriate Swarm service
|
||||
|
||||
For more details about multi-layer routing, see the [Multi-Layer Routing documentation](../../reference/routing-configuration/http/routing/multi-layer-routing.md).
|
||||
|
||||
## Conclusion
|
||||
|
||||
In this guide, you've learned how to:
|
||||
In this advanced guide, you've learned how to:
|
||||
|
||||
- Expose HTTP services through Traefik in Docker Swarm
|
||||
- Set up path-based routing to direct traffic to different backend services
|
||||
- Secure your services with TLS using self-signed certificates
|
||||
- Add security with middlewares like secure headers and IP allow listing
|
||||
- Automate certificate management with Let's Encrypt
|
||||
- Implement sticky sessions for stateful applications
|
||||
- Setup multi-layer routing for authentication-based routing
|
||||
|
||||
These fundamental capabilities provide a solid foundation for exposing any application through Traefik Proxy in Docker Swarm. Each of these can be further customized to meet your specific requirements.
|
||||
These advanced capabilities allow you to build production-ready Traefik deployments with Docker Swarm. Each of these can be further customized to meet your specific requirements.
|
||||
|
||||
### Next Steps
|
||||
|
||||
Now that you understand the basics of exposing services with Traefik Proxy, you might want to explore:
|
||||
Now that you've mastered both basic and advanced Traefik features with Docker Swarm, you might want to explore:
|
||||
|
||||
- [Advanced routing options](../reference/routing-configuration/http/routing/rules-and-priority.md) like query parameter matching, header-based routing, and more
|
||||
- [Additional middlewares](../reference/routing-configuration/http/middlewares/overview.md) for authentication, rate limiting, and request modifications
|
||||
- [Observability features](../reference/install-configuration/observability/metrics.md) for monitoring and debugging your Traefik deployment
|
||||
- [TCP services](../reference/routing-configuration/tcp/service.md) for exposing TCP services
|
||||
- [UDP services](../reference/routing-configuration/udp/service.md) for exposing UDP services
|
||||
- [Docker provider documentation](../reference/install-configuration/providers/docker.md) for more details about the Docker integration
|
||||
- [Advanced routing options](../../reference/routing-configuration/http/routing/rules-and-priority.md) like query parameter matching, header-based routing, and more
|
||||
- [Additional middlewares](../../reference/routing-configuration/http/middlewares/overview.md) for authentication, rate limiting, and request modifications
|
||||
- [Observability features](../../reference/install-configuration/observability/metrics.md) for monitoring and debugging your Traefik deployment
|
||||
- [TCP services](../../reference/routing-configuration/tcp/service.md) for exposing TCP services
|
||||
- [UDP services](../../reference/routing-configuration/udp/service.md) for exposing UDP services
|
||||
- [Docker provider documentation](../../reference/install-configuration/providers/docker.md) for more details about the Docker integration
|
||||
191
docs/content/expose/swarm/basic.md
Normal file
191
docs/content/expose/swarm/basic.md
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
# Exposing Services with Traefik on Docker Swarm - Basic
|
||||
|
||||
This guide will help you get started with exposing your services through Traefik Proxy using Docker Swarm. You'll learn the fundamentals of routing HTTP traffic, setting up path-based routing, and securing your services with TLS.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Docker Swarm cluster initialized
|
||||
- Basic understanding of Docker Swarm concepts
|
||||
- Traefik deployed using the [Traefik Docker Swarm Setup guide](../../setup/swarm.md)
|
||||
|
||||
|
||||
## Expose Your First HTTP Service
|
||||
|
||||
Let's expose a simple HTTP service using the [whoami](https://hub.docker.com/r/traefik/whoami) application. This will demonstrate basic routing to a backend service.
|
||||
|
||||
First, update your existing `docker-compose.yml` file if you haven't already:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
whoami:
|
||||
image: traefik/whoami
|
||||
networks:
|
||||
- traefik_proxy
|
||||
deploy:
|
||||
replicas: 3
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.swarm.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=web,websecure"
|
||||
```
|
||||
|
||||
Save this as `docker-compose.yml` and deploy the stack:
|
||||
|
||||
```bash
|
||||
docker stack deploy -c docker-compose.yml traefik
|
||||
```
|
||||
|
||||
### Verify Your Service
|
||||
|
||||
Your service is now available at http://whoami.swarm.localhost/. Test that it works:
|
||||
|
||||
```bash
|
||||
curl -H "Host: whoami.swarm.localhost" http://localhost/
|
||||
```
|
||||
|
||||
You should see output similar to:
|
||||
|
||||
```bash
|
||||
Hostname: whoami.1.7c8f7tr56q3p949rscxrkp80e
|
||||
IP: 127.0.0.1
|
||||
IP: ::1
|
||||
IP: 10.0.1.8
|
||||
IP: fe80::215:5dff:fe00:c9e
|
||||
RemoteAddr: 10.0.1.2:45098
|
||||
GET / HTTP/1.1
|
||||
Host: whoami.swarm.localhost
|
||||
User-Agent: curl/7.68.0
|
||||
Accept: */*
|
||||
Accept-Encoding: gzip
|
||||
X-Forwarded-For: 10.0.1.1
|
||||
X-Forwarded-Host: whoami.swarm.localhost
|
||||
X-Forwarded-Port: 80
|
||||
X-Forwarded-Proto: http
|
||||
X-Forwarded-Server: 5789f594e7d5
|
||||
X-Real-Ip: 10.0.1.1
|
||||
```
|
||||
|
||||
This confirms that Traefik is successfully routing requests to your whoami application.
|
||||
|
||||
## Add Routing Rules
|
||||
|
||||
Now we'll enhance our routing by directing traffic to different services based on [URL paths](../../reference/routing-configuration/http/routing/rules-and-priority.md#path-pathprefix-and-pathregexp). This is useful for API versioning, frontend/backend separation, or organizing microservices.
|
||||
|
||||
Update your `docker-compose.yml` to add another service:
|
||||
|
||||
```yaml
|
||||
# ...
|
||||
|
||||
# New service
|
||||
whoami-api:
|
||||
image: traefik/whoami
|
||||
networks:
|
||||
- traefik_proxy
|
||||
environment:
|
||||
- WHOAMI_NAME=API Service
|
||||
deploy:
|
||||
replicas: 2
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# Path-based routing
|
||||
- "traefik.http.routers.whoami-api.rule=Host(`whoami.swarm.localhost`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.whoami-api.entrypoints=web,websecure"
|
||||
- "traefik.http.routers.whoami-api.service=whoami-api-svc"
|
||||
- "traefik.http.services.whoami-api-svc.loadbalancer.server.port=80"
|
||||
|
||||
# ...
|
||||
```
|
||||
|
||||
Apply the changes:
|
||||
|
||||
```bash
|
||||
docker stack deploy -c docker-compose.yml traefik
|
||||
```
|
||||
|
||||
### Test the Path-Based Routing
|
||||
|
||||
Verify that different paths route to different services:
|
||||
|
||||
```bash
|
||||
# Root path should go to the main whoami service
|
||||
curl -H "Host: whoami.swarm.localhost" http://localhost/
|
||||
|
||||
# /api path should go to the whoami-api service
|
||||
curl -H "Host: whoami.swarm.localhost" http://localhost/api
|
||||
```
|
||||
|
||||
For the `/api` requests, you should see the response showing "API Service" in the environment variables section, confirming that your path-based routing is working correctly.
|
||||
|
||||
## Enable TLS
|
||||
|
||||
Let's secure our service with HTTPS by adding TLS. We'll start with a self-signed certificate for local development.
|
||||
|
||||
### Create a Self-Signed Certificate
|
||||
|
||||
Generate a self-signed certificate and dynamic config file to tell Traefik where the cert lives:
|
||||
|
||||
```bash
|
||||
mkdir -p certs
|
||||
|
||||
# key + cert (valid for one year)
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout certs/local.key -out certs/local.crt \
|
||||
-subj "/CN=*.swarm.localhost"
|
||||
|
||||
# dynamic config that tells Traefik where the cert lives
|
||||
cat > certs/tls.yml <<'EOF'
|
||||
tls:
|
||||
certificates:
|
||||
- certFile: /certificates/local.crt
|
||||
keyFile: /certificates/local.key
|
||||
EOF
|
||||
```
|
||||
|
||||
Create a Docker config for the certificate files:
|
||||
|
||||
```bash
|
||||
docker config create swarm-cert.crt certs/local.crt
|
||||
docker config create swarm-cert.key certs/local.key
|
||||
docker config create swarm-tls.yml certs/tls.yml
|
||||
```
|
||||
|
||||
Update your `docker-compose.yml` file with the following changes:
|
||||
|
||||
```yaml
|
||||
# Add to the Traefik command section:
|
||||
command:
|
||||
# ... existing commands ...
|
||||
- "--entryPoints.websecure.address=:443"
|
||||
- "--entryPoints.websecure.http.tls=true"
|
||||
- "--providers.file.directory=/etc/traefik/dynamic"
|
||||
```
|
||||
|
||||
```yaml
|
||||
# Add to the root of your docker-compose.yml file:
|
||||
configs:
|
||||
swarm-cert.crt:
|
||||
file: ./certs/local.crt
|
||||
swarm-cert.key:
|
||||
file: ./certs/local.key
|
||||
swarm-tls.yml:
|
||||
file: ./certs/tls.yml
|
||||
```
|
||||
|
||||
Deploy the stack:
|
||||
|
||||
```bash
|
||||
docker stack deploy -c docker-compose.yml traefik
|
||||
```
|
||||
|
||||
Your browser can access https://whoami.swarm.localhost/ for the service. You'll need to accept the security warning for the self-signed certificate.
|
||||
|
||||
## Next Steps
|
||||
|
||||
Now that you've mastered the basics of exposing services with Traefik on Docker Swarm, you're ready to explore more advanced features like middlewares, Let's Encrypt certificates, sticky sessions, and multi-layer routing.
|
||||
|
||||
Continue to the [Advanced Guide](advanced.md) to learn about:
|
||||
|
||||
- Adding middlewares for security and access control
|
||||
- Generating certificates with Let's Encrypt
|
||||
- Configuring sticky sessions for stateful applications
|
||||
- Setting up multi-layer routing for authentication-based routing
|
||||
148
docs/content/features/index.md
Normal file
148
docs/content/features/index.md
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
---
|
||||
title: "Traefik Product Features Comparison"
|
||||
description: "Compare features across Traefik Proxy, Traefik Hub API Gateway (including AI Gateway capabilities), and Traefik Hub API Management to choose the right solution for your needs."
|
||||
---
|
||||
|
||||
# Traefik Product Features Comparison
|
||||
|
||||
The Traefik ecosystem offers multiple products designed to meet different requirements, from basic reverse proxy functionality to comprehensive API management and AI gateway capabilities. This comparison matrix helps you understand the features available in each product and choose the right solution for your use case.
|
||||
|
||||
## Product Overview
|
||||
|
||||
- **Traefik Proxy** is the open-source application proxy that serves as the foundation for all Traefik products. It provides essential reverse proxy, load balancing, and service discovery capabilities.
|
||||
|
||||
- **[Traefik Hub API Gateway](https://traefik.io/solutions/api-gateway/)** builds on Traefik Proxy with enterprise-grade security, distributed features, and advanced access control for cloud-native API gateway scenarios. It includes **AI Gateway capabilities** that transform any AI endpoint into a managed API.
|
||||
|
||||
- **[Traefik Hub API Management](https://traefik.io/solutions/api-management/)** adds comprehensive API lifecycle management, developer portals, and organizational features for teams managing multiple APIs across environments.
|
||||
|
||||
- **[Traefik AI Gateway](https://traefik.io/solutions/ai-gateway/)** transforms any AI endpoint into a managed API with unified access to multiple LLMs, centralized credential management, semantic caching, local inferencing, and comprehensive AI governance features.
|
||||
|
||||
- **[Traefik MCP Gateway](https://traefik.io/solutions/mcp-gateway/)** provides secure, governed access to Model Context Protocol (MCP) servers for AI agents with task-based access control (TBAC), session-smart routing, and comprehensive audit capabilities for enterprise AI workflows.
|
||||
|
||||
## Features Matrix
|
||||
|
||||
| Feature | Traefik Proxy | Traefik Hub API Gateway | Traefik Hub API Management |
|
||||
|---------|---------------|------------------------|---------------------------|
|
||||
| **Core Networking** | | | |
|
||||
| Services Auto-Discovery | ✓ | ✓ | ✓ |
|
||||
| Graceful Configuration Reload | ✓ | ✓ | ✓ |
|
||||
| Websockets, HTTP/2, HTTP/3, TCP, UDP, GRPC | ✓ | ✓ | ✓ |
|
||||
| Real-time Logs, Access Logs, Metrics & Distributed Tracing | ✓ | ✓ | ✓ |
|
||||
| Canary Deployments | ✓ | ✓ | ✓ |
|
||||
| Let's Encrypt | ✓ | ✓ | ✓ |
|
||||
| **Plugin Ecosystem** | | | |
|
||||
| [Plugin Support](https://plugins.traefik.io/plugins) ([Go](https://github.com/traefik/yaegi), [WASM](https://webassembly.org/)) | ✓ | ✓ | ✓ |
|
||||
| **Deployment & Operations** | | | |
|
||||
| Hybrid cloud, multi-cloud & on-prem compatible | ✓ | ✓ | ✓ |
|
||||
| Per-cluster dashboard | ✓ | ✓ | ✓ |
|
||||
| GitOps-native declarative configuration | ✓ | ✓ | ✓ |
|
||||
| **Authentication & Authorization** | | | |
|
||||
| JWT Authentication | ✗ | ✓ | ✓ |
|
||||
| OAuth 2.0 Token Introspection Authentication | ✗ | ✓ | ✓ |
|
||||
| OAuth 2.0 Client Credentials Authentication | ✗ | ✓ | ✓ |
|
||||
| OpenID Connect Authentication | ✗ | ✓ | ✓ |
|
||||
| Lightweight Directory Access Protocol (LDAP) | ✗ | ✓ | ✓ |
|
||||
| API Key Authentication | ✗ | ✓ | ✓ |
|
||||
| **Security & Policy** | | | |
|
||||
| Open Policy Agent | ✗ | ✓ | ✓ |
|
||||
| Native Coraza Web Application Firewall (WAF) | ✗ | ✓ | ✓ |
|
||||
| HashiCorp Vault Integration | ✗ | ✓ | ✓ |
|
||||
| **Distributed Features** | | | |
|
||||
| Distributed Let's Encrypt | ✗ | ✓ | ✓ |
|
||||
| Distributed Rate Limit | ✗ | ✓ | ✓ |
|
||||
| HTTP Caching | ✗ | ✓ | ✓ |
|
||||
| **Compliance** | | | |
|
||||
| FIPS 140-2 Compliance (Linux & Windows) | ✗ | ✓ | ✓ |
|
||||
| **AI Gateway Capabilities** | | | |
|
||||
| Unified Multi-LLM API Access | ✗ | ✓ | ✓ |
|
||||
| Centralized AI Credential Management | ✗ | ✓ | ✓ |
|
||||
| AI Provider Flexibility (OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, etc.) | ✗ | ✓ | ✓ |
|
||||
| Semantic Caching for AI Responses | ✗ | ✓ | ✓ |
|
||||
| Content Guard & PII Protection | ✗ | ✓ | ✓ |
|
||||
| AI-specific Observability & OpenTelemetry Integration | ✗ | ✓ | ✓ |
|
||||
| Support for Local/Self-hosted LLMs & Inference (Ollama, Mistral, etc.) | ✗ | ✓ | ✓ |
|
||||
| **MCP Gateway Capabilities** | | | |
|
||||
| Task-Based Access Control (TBAC) for AI Agents | ✗ | ✓ | ✓ |
|
||||
| MCP Servers Governance | ✗ | ✓ | ✓ |
|
||||
| Session-Smart Load Balancing for Agent Workflows | ✗ | ✓ | ✓ |
|
||||
| OAuth 2.1 / 2.0 Resource Server for MCP | ✗ | ✓ | ✓ |
|
||||
| Fine-grained Policy Enforcement for AI Tools | ✗ | ✓ | ✓ |
|
||||
| Audit-ready Observability for Agent Interactions | ✗ | ✓ | ✓ |
|
||||
| **API Management** | | | |
|
||||
| Flexible API grouping and versioning | ✗ | ✗ | ✓ |
|
||||
| API Developer Portal | ✗ | ✗ | ✓ |
|
||||
| OpenAPI Specifications Support | ✗ | ✗ | ✓ |
|
||||
| Multi-cluster dashboard | ✗ | ✗ | ✓ |
|
||||
| Built-in identity provider (or use your own) | ✗ | ✗ | ✓ |
|
||||
| Configuration linter & change impact analysis | ✗ | ✗ | ✓ |
|
||||
| Pre-built Grafana dashboards | ✗ | ✗ | ✓ |
|
||||
| Event correlation for quick incident mitigation | ✗ | ✗ | ✓ |
|
||||
| Traffic debugger | ✗ | ✓ | ✓ |
|
||||
| **Support** | | | |
|
||||
| Built-In Commercial Support | Add-on | ✓ | ✓ |
|
||||
|
||||
## Choosing the Right Product
|
||||
|
||||
### Start with Traefik Proxy
|
||||
|
||||
Traefik Proxy is the ideal starting point for organizations looking for a reliable, open-source application proxy with essential networking capabilities. Deploy it as your default ingress tier if you need:
|
||||
|
||||
- Basic reverse proxy and load balancing
|
||||
- Service discovery for containerized applications
|
||||
- Simple TLS termination and Let's Encrypt integration
|
||||
- Cost-effective solution with community support (can upgrade to Traefik Hub for more features)
|
||||
|
||||
### Upgrade to Traefik Hub API Gateway
|
||||
|
||||
Traefik Hub API Gateway layers enterprise security, distributed coordination, and AI Gateway capabilities on top of Traefik Proxy. Upgrade to it when you need:
|
||||
|
||||
- Enterprise security requirements (JWT, OIDC, LDAP)
|
||||
- Distributed deployments across multiple clusters
|
||||
- Advanced rate limiting and caching
|
||||
- WAF and policy enforcement
|
||||
- AI Gateway capabilities
|
||||
- Commercial support
|
||||
|
||||
### Consider Traefik AI Gateway
|
||||
|
||||
Traefik AI Gateway unifies hosted and self-hosted LLM access under centralized control and observability. Consider it if you have:
|
||||
|
||||
- Multi-LLM applications requiring unified API access
|
||||
- Organizations using multiple AI providers (OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, etc.)
|
||||
- Local/self-hosted LLM deployments (Ollama, Mistral)
|
||||
- Centralized AI credential and security management
|
||||
- Cost optimization through semantic caching
|
||||
- PII protection and content filtering for AI interactions
|
||||
- Comprehensive AI observability and compliance requirements
|
||||
|
||||
### Choose Traefik MCP Gateway
|
||||
|
||||
Traefik MCP Gateway governs how AI agents interact with Model Context Protocol servers through task-aware policies and session-smart routing. Choose it if you need:
|
||||
|
||||
- AI agent deployments requiring secure access to MCP servers
|
||||
- Task-based access control (TBAC) for AI workflows
|
||||
- Governance of Model Context Protocol interactions
|
||||
- Session-smart routing for long-running agent conversations
|
||||
- OAuth 2.1 / 2.0 compliant MCP server protection
|
||||
- Audit-ready observability for AI agent activities
|
||||
- Fine-grained policy enforcement for AI tools and resources
|
||||
|
||||
### Choose Traefik Hub API Management
|
||||
|
||||
Traefik Hub API Management extends the gateway foundation with API lifecycle tooling, developer experience features, and governance workflows. Choose it when you have:
|
||||
|
||||
- Multiple APIs requiring centralized management
|
||||
- Developer teams needing self-service portals
|
||||
- Complex API versioning and lifecycle requirements
|
||||
- Multi-cluster environments requiring unified dashboards
|
||||
- Compliance and governance needs
|
||||
|
||||
## Migration Path
|
||||
|
||||
The Traefik ecosystem is designed for seamless upgrades. You can start with Traefik Proxy and add capabilities as your requirements grow:
|
||||
|
||||
1. **Traefik Proxy** → **Hub API Gateway**: Add enterprise security, distributed features, and AI Gateway capabilities
|
||||
2. **Hub API Gateway** → **Hub API Management**: Add comprehensive API management and governance features
|
||||
3. **MCP Gateway**: Specialized solution for AI agent governance and Model Context Protocol management
|
||||
|
||||
All products share the same core configuration concepts, making migration straightforward while preserving your existing configurations and operational knowledge.
|
||||
|
|
@ -57,4 +57,4 @@ You no longer need to create and synchronize configuration files cluttered with
|
|||
Traefik is able to use your cluster API to discover the services and read the attached information.
|
||||
In Traefik, these connectors are called [providers](../providers/overview.md "Link to overview about Traefik providers") because they *provide* the configuration to Traefik.
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -92,4 +92,4 @@ All the configuration options are documented in their related section.
|
|||
|
||||
You can browse the available features in the menu, the [providers](../providers/overview.md), or the [routing section](../routing/overview.md) to see them in action.
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -159,4 +159,4 @@ That's it! You've successfully deployed Traefik and configured routing in Docker
|
|||
- [Enable Metrics](../reference/install-configuration/observability/metrics.md)
|
||||
- [Learn more about Docker provider](../reference/install-configuration/providers/docker.md)
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -252,4 +252,4 @@ In which case, you should make sure your infrastructure is properly set up for a
|
|||
LEGO_DISABLE_CNAME_SUPPORT=true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -144,4 +144,4 @@ And run it:
|
|||
|
||||
All the details are available in the [Contributing Guide](../contributing/building-testing.md)
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -331,4 +331,4 @@ That's it! You've successfully deployed Traefik and configured routing in a Kube
|
|||
- [Learn more about Kubernetes CRD provider](../reference/install-configuration/providers/kubernetes/kubernetes-crd.md)
|
||||
- [Learn more about Kubernetes Gateway API provider](../reference/install-configuration/providers/kubernetes/kubernetes-gateway.md)
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -847,14 +847,14 @@ _Optional, Default=2160_
|
|||
|
||||
It defaults to `2160` (90 days) to follow Let's Encrypt certificates' duration.
|
||||
|
||||
| Certificate Duration | Renew Period | Renew Interval |
|
||||
|----------------------|-------------------|-------------------------|
|
||||
| >= 1 year | 4 months | 1 week |
|
||||
| >= 90 days | 30 days | 1 day |
|
||||
| >= 30 days | 10 days | 12 hours |
|
||||
| >= 7 days | 1 day | 1 hour |
|
||||
| >= 24 hours | 6 hours | 10 min |
|
||||
| < 24 hours | 20 min | 1 min |
|
||||
| Certificate Duration | Renew Period | Renew Interval |
|
||||
|----------------------|--------------|----------------|
|
||||
| >= 1 year | 4 months | 1 week |
|
||||
| >= 90 days | 30 days | 1 day |
|
||||
| >= 30 days | 10 days | 12 hours |
|
||||
| >= 6 days | 2 days | 2 hours |
|
||||
| >= 24 hours | 6 hours | 10 min |
|
||||
| < 24 hours | 20 min | 1 min |
|
||||
|
||||
!!! warning "Traefik cannot manage certificates with a duration lower than 1 hour."
|
||||
|
||||
|
|
@ -1211,4 +1211,4 @@ If Let's Encrypt is not reachable, the following certificates will apply:
|
|||
!!! important
|
||||
For new (sub)domains which need Let's Encrypt authentication, the default Traefik certificate will be used until Traefik is restarted.
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@ That is to say, how to obtain [TLS certificates](./tls.md#certificates-definitio
|
|||
either through a definition in the dynamic configuration, or through [Let's Encrypt](./acme.md) (ACME).
|
||||
And how to configure [TLS options](./tls.md#tls-options), and [certificates stores](./tls.md#certificates-stores).
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -587,4 +587,4 @@ spec:
|
|||
disableSessionTickets: true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ Traefik is an [open-source](https://github.com/traefik/traefik) Application Prox
|
|||
|
||||
If you start with Traefik for service discovery and routing, you can seamlessly add [API management](https://traefik.io/solutions/api-management/), [API gateway](https://traefik.io/solutions/api-gateway/), [AI gateway](https://traefik.io/solutions/ai-gateway/), and [API mocking](https://traefik.io/solutions/api-mocking/) capabilities as needed.
|
||||
|
||||
For a detailed comparison of all Traefik products and their capabilities, see our [Product Features Comparison](./features/).
|
||||
|
||||
With 3.3 billion downloads and over 55k stars on GitHub, Traefik is used globally across hybrid cloud, multi-cloud, on prem, and bare metal environments running Kubernetes, Docker Swarm, AWS, [the list goes on](https://doc.traefik.io/traefik/reference/install-configuration/providers/overview/).
|
||||
|
||||
Here’s how it works—Traefik receives requests on behalf of your system, identifies which components are responsible for handling them, and routes them securely. It automatically discovers the right configuration for your services by inspecting your infrastructure to identify relevant information and which service serves which request.
|
||||
|
|
|
|||
|
|
@ -340,4 +340,4 @@ http:
|
|||
removeHeader = true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -785,4 +785,4 @@ http:
|
|||
preserveRequestMethod = true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ The GrpcWeb middleware converts gRPC Web requests to HTTP/2 gRPC requests before
|
|||
!!! 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.
|
||||
Check out [Exposing gRPC Services](../../expose/overview.md#exposing-grpc-services) for more details.
|
||||
|
||||
## Configuration Examples
|
||||
|
||||
|
|
|
|||
|
|
@ -422,4 +422,4 @@ Set `isDevelopment` to `true` when developing to mitigate the unwanted effects o
|
|||
Usually testing takes place using HTTP, not HTTPS, and on `localhost`, not your production domain.
|
||||
If you would like your development environment to mimic production with complete Host blocking, SSL redirects, and STS headers, leave this as `false`.
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -127,4 +127,4 @@ http:
|
|||
|
||||
Please take a look at the community-contributed plugins in the [plugin catalog](https://plugins.traefik.io/plugins).
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -85,4 +85,4 @@ The `replacement` option defines how to modify the URL to have the new target UR
|
|||
|
||||
Care should be taken when defining replacement expand variables: `$1x` is equivalent to `${1x}`, not `${1}x` (see [Regexp.Expand](https://golang.org/pkg/regexp/#Regexp.Expand)), so use `${1}` syntax.
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -146,4 +146,4 @@ http:
|
|||
forceSlash = false
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -112,4 +112,4 @@ A list of HTTP middlewares can be found [here](http/overview.md).
|
|||
|
||||
A list of TCP middlewares can be found [here](tcp/overview.md).
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -636,6 +636,10 @@ The `Headers` and `HeadersRegexp` matchers have been renamed to `Header` and `He
|
|||
|
||||
`PathPrefix` no longer uses regular expressions to match path prefixes.
|
||||
|
||||
`Path` and `PathPrefix` no longer support path parameter placeholders (e.g., `{id}`, `{name}`).
|
||||
Routes using placeholders like ``Path(`/route/{id}`)`` will not match in v3 syntax.
|
||||
Use `PathRegexp` instead for dynamic path segments.
|
||||
|
||||
`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/).
|
||||
|
|
@ -716,6 +720,40 @@ http:
|
|||
ruleSyntax = "v2"
|
||||
```
|
||||
|
||||
##### Migrate Path Placeholders to PathRegexp
|
||||
|
||||
In v2, `Path` and `PathPrefix` supported path parameter placeholders like `{id}` for matching dynamic path segments.
|
||||
In v3, this is no longer supported and `PathRegexp` should be used instead.
|
||||
|
||||
??? example "Migrating a route with path placeholders"
|
||||
|
||||
v2 syntax (no longer works in v3):
|
||||
|
||||
```yaml
|
||||
match: Host(`example.com`) && Path(`/products/{id}`)
|
||||
```
|
||||
|
||||
v3 syntax using `PathRegexp`:
|
||||
|
||||
```yaml
|
||||
match: Host(`example.com`) && PathRegexp(`^/products/[^/]+$`)
|
||||
```
|
||||
|
||||
For more complex patterns with multiple placeholders:
|
||||
|
||||
v2 syntax:
|
||||
|
||||
```yaml
|
||||
match: Host(`example.com`) && Path(`/users/{userId}/orders/{orderId}`)
|
||||
```
|
||||
|
||||
v3 syntax:
|
||||
|
||||
```yaml
|
||||
match: Host(`example.com`) && PathRegexp(`^/users/[^/]+/orders/[^/]+$`) ## matches any non-slash characters
|
||||
match: Host(`example.com`) && PathRegexp(`^/users/[a-zA-Z0-9_-]+/orders/[a-zA-Z0-9_-]+$`) ## restricts to alphanumeric, hyphens, and underscores
|
||||
```
|
||||
|
||||
### IPWhiteList
|
||||
|
||||
In v3, we renamed the `IPWhiteList` middleware to `IPAllowList` without changing anything to the configuration.
|
||||
|
|
|
|||
|
|
@ -158,4 +158,4 @@ core:
|
|||
- ✅ All applications functioning correctly
|
||||
- ✅ Performance metrics stable
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -555,11 +555,11 @@ The KubernetesIngressNGINX Provider is no longer experimental in v3.6.2 and can
|
|||
1. Remove the `kubernetesIngressNGINX` option from the experimental section
|
||||
2. Configure the provider using the [kubernetesIngressNGINX Provider documentation](../reference/install-configuration/providers/kubernetes/kubernetes-ingress-nginx.md)
|
||||
|
||||
## v3.6.3
|
||||
## v3.6.4
|
||||
|
||||
### Encoded Characters in Request Path
|
||||
|
||||
Starting with `v3.6.3`, for security reasons, Traefik now rejects requests with a path containing a specific set of encoded characters by default.
|
||||
Starting with `v3.6.4`, for security reasons, Traefik now rejects requests with a path containing a specific set of encoded characters by default.
|
||||
|
||||
When such a request is received, Traefik responds with a `400 Bad Request` status code.
|
||||
|
||||
|
|
@ -568,11 +568,60 @@ Here is the list of the encoded characters that are rejected by default, along w
|
|||
| Encoded Character | Character | Config option to allow the encoded character |
|
||||
|-------------------|-------------------------|--------------------------------------------------------------------------------------|
|
||||
| `%2f` or `%2F` | `/` (slash) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedSlash` |
|
||||
| `%5c` or `%5C` | `\` (backslash) | `entryPoints.<name>.`<br/>`.http.encodedCharacters`<br/>`.allowEncodedBackSlash` |
|
||||
| `%00` | `NULL` (null character) | `entryPoints.<name>.`<br/>`.http.encodedCharacters`<br/>`.allowEncodedNullCharacter` |
|
||||
| `%3b` or `%3B` | `;` (semicolon) | `entryPoints.<name>.`<br/>`.http.encodedCharacters`<br/>`.allowEncodedSemicolon` |
|
||||
| `%25` | `%` (percent) | `entryPoints.<name>.`<br/>`.http.encodedCharacters`<br/>`.allowEncodedPercent` |
|
||||
| `%3f` or `%3F` | `?` (question mark) | `entryPoints.<name>.`<br/>`.http.encodedCharacters`<br/>`.allowEncodedQuestionMark` |
|
||||
| `%23` | `#` (hash) | `entryPoints.<name>.`<br/>`.http.encodedCharacters`<br/>`.allowEncodedHash` |
|
||||
| `%5c` or `%5C` | `\` (backslash) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedBackSlash` |
|
||||
| `%00` | `NULL` (null character) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedNullCharacter` |
|
||||
| `%3b` or `%3B` | `;` (semicolon) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedSemicolon` |
|
||||
| `%25` | `%` (percent) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedPercent` |
|
||||
| `%3f` or `%3F` | `?` (question mark) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedQuestionMark` |
|
||||
| `%23` | `#` (hash) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedHash` |
|
||||
|
||||
Please check out the entrypoint [encodedCharacters option](../reference/install-configuration/entrypoints.md#opt-http-encodedCharacters) documentation for more details.
|
||||
|
||||
## v3.6.7
|
||||
|
||||
### Encoded Characters Configuration Default Values
|
||||
|
||||
Since `v3.6.7`, the options for encoded characters now have a `true` default value.
|
||||
This means that Traefik will not reject requests with a path containing a specific set of encoded characters by default.
|
||||
It is now up to the users to configure the security hardening of encoded characters.
|
||||
|
||||
Here is the list of the encoded characters that can be configured to `false` to disallow them:
|
||||
|
||||
| Encoded Character | Character | Config options | Default value |
|
||||
|-------------------|-------------------------|--------------------------------------------------------------------------------------|---------------|
|
||||
| `%2f` or `%2F` | `/` (slash) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedSlash` | `true` |
|
||||
| `%5c` or `%5C` | `\` (backslash) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedBackSlash` | `true` |
|
||||
| `%00` | `NULL` (null character) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedNullCharacter` | `true` |
|
||||
| `%3b` or `%3B` | `;` (semicolon) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedSemicolon` | `true` |
|
||||
| `%25` | `%` (percent) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedPercent` | `true` |
|
||||
| `%3f` or `%3F` | `?` (question mark) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedQuestionMark` | `true` |
|
||||
| `%23` | `#` (hash) | `entryPoints.<name>`<br/>`.http.encodedCharacters`<br/>`.allowEncodedHash` | `true` |
|
||||
|
||||
Note: This check is not done against query parameters,
|
||||
but only against the request path as defined
|
||||
in [RFC3986 section-3](https://datatracker.ietf.org/doc/html/rfc3986#section-3).
|
||||
|
||||
Please check out the entrypoint [encodedCharacters option](../routing/entrypoints.md#encoded-characters) documentation
|
||||
for more details.
|
||||
|
||||
## v3.7.0
|
||||
|
||||
### Ingress NGINX Provider
|
||||
|
||||
Starting with `v3.7.0`, the Ingress NGINX provider now supports the `nginx.ingress.kubernetes.io/custom-headers` annotation to add custom headers to the response forwarded to the client.
|
||||
|
||||
Therefore, in the corresponding RBACs (see [KubernetesIngressNGINX](../reference/dynamic-configuration/kubernetes-ingress-nginx-rbac.yml) provider RBACs) the `configmaps` right has been added.
|
||||
|
||||
**Required RBAC Updates:**
|
||||
|
||||
```yaml
|
||||
...
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
...
|
||||
```
|
||||
|
|
|
|||
|
|
@ -780,4 +780,4 @@ accesslog:
|
|||
--accesslog.otlp.grpc.tls.insecureSkipVerify=true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -644,4 +644,4 @@ log:
|
|||
--log.otlp.grpc.tls.insecureSkipVerify=true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ metrics:
|
|||
|
||||
_Required, Default=""_
|
||||
|
||||
Token with which to connect to InfluxDB v2.
|
||||
Token with which to connect to InfluxDB v2. It accepts either a token value or a file path to the token.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
metrics:
|
||||
|
|
|
|||
|
|
@ -77,4 +77,4 @@ additionalArguments:
|
|||
!!! note
|
||||
A router with its own observability configuration will override the global default.
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -176,4 +176,4 @@ All the following endpoints must be accessed with a `GET` HTTP request.
|
|||
| `/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!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -168,4 +168,4 @@ api:
|
|||
--api.dashboard=false
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -31,4 +31,4 @@ The experience of implementing a Traefik plugin is comparable to writing a web b
|
|||
|
||||
To learn more about Traefik plugin creation, please refer to the [developer documentation](https://plugins.traefik.io/create).
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -702,4 +702,4 @@ providers:
|
|||
--providers.docker.allowEmptyServices=true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -292,4 +292,4 @@ To illustrate, it is possible to easily define multiple routers, services, and T
|
|||
{{ end }}
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ the Traefik engineering team developed a [Custom Resource Definition](https://ku
|
|||
|
||||
## Requirements
|
||||
|
||||
{!kubernetes-requirements.md!}
|
||||
{% include-markdown "includes/kubernetes-requirements.md" %}
|
||||
|
||||
!!! tip "All Steps for a Successful Deployment"
|
||||
|
||||
|
|
@ -363,6 +363,6 @@ providers:
|
|||
|
||||
## Full Example
|
||||
|
||||
For additional information, refer to the [full example](../user-guides/crd-acme/index.md) with Let's Encrypt.
|
||||
For additional information on exposing services with Kubernetes, refer to the [Kubernetes guide](../expose/kubernetes/basic.md).
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ For more details, check out the conformance [report](https://github.com/kubernet
|
|||
|
||||
## Requirements
|
||||
|
||||
{!kubernetes-requirements.md!}
|
||||
{% include-markdown "includes/kubernetes-requirements.md" %}
|
||||
|
||||
!!! info "Helm Chart"
|
||||
|
||||
|
|
@ -357,4 +357,4 @@ providers:
|
|||
--providers.kubernetesgateway.throttleDuration=10s
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ it manages access to cluster services by supporting the [Ingress](https://kubern
|
|||
|
||||
## Requirements
|
||||
|
||||
{!kubernetes-requirements.md!}
|
||||
{% include-markdown "includes/kubernetes-requirements.md" %}
|
||||
|
||||
## Routing Configuration
|
||||
|
||||
|
|
@ -557,4 +557,4 @@ providers:
|
|||
To learn more about the various aspects of the Ingress specification that Traefik supports,
|
||||
many examples of Ingresses definitions are located in the test [examples](https://github.com/traefik/traefik/tree/v3.6/pkg/provider/kubernetes/ingress/fixtures) of the Traefik repository.
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -227,4 +227,4 @@ List of providers that support constraints:
|
|||
- [Kubernetes Ingress](./kubernetes-ingress.md#labelselector)
|
||||
- [Kubernetes Gateway](./kubernetes-gateway.md#labelselector)
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -769,4 +769,4 @@ providers:
|
|||
--providers.swarm.allowEmptyServices=true
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -378,6 +378,9 @@
|
|||
serverName = "foobar"
|
||||
insecureSkipVerify = true
|
||||
rootCAs = ["foobar", "foobar"]
|
||||
cipherSuites = ["foobar", "foobar"]
|
||||
minVersion = "foobar"
|
||||
maxVersion = "foobar"
|
||||
maxIdleConnsPerHost = 42
|
||||
disableHTTP2 = true
|
||||
peerCertURI = "foobar"
|
||||
|
|
@ -402,6 +405,9 @@
|
|||
serverName = "foobar"
|
||||
insecureSkipVerify = true
|
||||
rootCAs = ["foobar", "foobar"]
|
||||
cipherSuites = ["foobar", "foobar"]
|
||||
minVersion = "foobar"
|
||||
maxVersion = "foobar"
|
||||
maxIdleConnsPerHost = 42
|
||||
disableHTTP2 = true
|
||||
peerCertURI = "foobar"
|
||||
|
|
|
|||
|
|
@ -437,6 +437,11 @@ http:
|
|||
keyFile: foobar
|
||||
- certFile: foobar
|
||||
keyFile: foobar
|
||||
cipherSuites:
|
||||
- foobar
|
||||
- foobar
|
||||
minVersion: foobar
|
||||
maxVersion: foobar
|
||||
maxIdleConnsPerHost: 42
|
||||
forwardingTimeouts:
|
||||
dialTimeout: 42s
|
||||
|
|
@ -462,6 +467,11 @@ http:
|
|||
keyFile: foobar
|
||||
- certFile: foobar
|
||||
keyFile: foobar
|
||||
cipherSuites:
|
||||
- foobar
|
||||
- foobar
|
||||
minVersion: foobar
|
||||
maxVersion: foobar
|
||||
maxIdleConnsPerHost: 42
|
||||
forwardingTimeouts:
|
||||
dialTimeout: 42s
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: ingressroutes.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -48,6 +47,10 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
ingressClassName:
|
||||
description: IngressClassName defines the name of the IngressClass
|
||||
cluster resource.
|
||||
type: string
|
||||
parentRefs:
|
||||
description: |-
|
||||
ParentRefs defines references to parent IngressRoute resources for multi-layer routing.
|
||||
|
|
@ -219,6 +222,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of
|
||||
the referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -374,6 +396,7 @@ spec:
|
|||
description: |-
|
||||
Syntax defines the router's rule syntax.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/routing/rules-and-priority/#rulesyntax
|
||||
|
||||
Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax.
|
||||
type: string
|
||||
required:
|
||||
|
|
@ -465,7 +488,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: ingressroutetcps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -510,6 +533,10 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
ingressClassName:
|
||||
description: IngressClassName defines the name of the IngressClass
|
||||
cluster resource.
|
||||
type: string
|
||||
routes:
|
||||
description: Routes defines the list of routes.
|
||||
items:
|
||||
|
|
@ -585,6 +612,7 @@ spec:
|
|||
description: |-
|
||||
ProxyProtocol defines the PROXY protocol configuration.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/tcp/service/#proxy-protocol
|
||||
|
||||
Deprecated: ProxyProtocol will not be supported in future APIVersions, please use ServersTransport to configure ProxyProtocol instead.
|
||||
properties:
|
||||
version:
|
||||
|
|
@ -607,6 +635,7 @@ spec:
|
|||
hence fully terminating the connection.
|
||||
It is a duration in milliseconds, defaulting to 100.
|
||||
A negative value means an infinite deadline (i.e. the reading capability is never closed).
|
||||
|
||||
Deprecated: TerminationDelay will not be supported in future APIVersions, please use ServersTransport to configure the TerminationDelay instead.
|
||||
type: integer
|
||||
tls:
|
||||
|
|
@ -627,6 +656,7 @@ spec:
|
|||
description: |-
|
||||
Syntax defines the router's rule syntax.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/tcp/routing/rules-and-priority/#rulesyntax
|
||||
|
||||
Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax.
|
||||
enum:
|
||||
- v3
|
||||
|
|
@ -721,7 +751,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: ingressrouteudps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -766,6 +796,10 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
ingressClassName:
|
||||
description: IngressClassName defines the name of the IngressClass
|
||||
cluster resource.
|
||||
type: string
|
||||
routes:
|
||||
description: Routes defines the list of routes.
|
||||
items:
|
||||
|
|
@ -833,7 +867,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: middlewares.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -1061,6 +1095,7 @@ spec:
|
|||
description: |-
|
||||
AutoDetect specifies whether to let the `Content-Type` header, if it has not been set by the backend,
|
||||
be automatically set to a value derived from the contents of the response.
|
||||
|
||||
Deprecated: AutoDetect option is deprecated, Content-Type middleware is only meant to be used to enable the content-type detection, please remove any usage of this option.
|
||||
type: boolean
|
||||
type: object
|
||||
|
|
@ -1089,6 +1124,39 @@ spec:
|
|||
containing user credentials.
|
||||
type: string
|
||||
type: object
|
||||
encodedCharacters:
|
||||
description: EncodedCharacters configures which encoded characters
|
||||
are allowed in the request path.
|
||||
properties:
|
||||
allowEncodedBackSlash:
|
||||
description: AllowEncodedBackSlash defines whether requests with
|
||||
encoded back slash characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedHash:
|
||||
description: AllowEncodedHash defines whether requests with encoded
|
||||
hash characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedNullCharacter:
|
||||
description: AllowEncodedNullCharacter defines whether requests
|
||||
with encoded null characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedPercent:
|
||||
description: AllowEncodedPercent defines whether requests with
|
||||
encoded percent characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedQuestionMark:
|
||||
description: AllowEncodedQuestionMark defines whether requests
|
||||
with encoded question mark characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedSemicolon:
|
||||
description: AllowEncodedSemicolon defines whether requests with
|
||||
encoded semicolon characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedSlash:
|
||||
description: AllowEncodedSlash defines whether requests with encoded
|
||||
slash characters in the path are allowed.
|
||||
type: boolean
|
||||
type: object
|
||||
errors:
|
||||
description: |-
|
||||
ErrorPage holds the custom error middleware configuration.
|
||||
|
|
@ -1183,6 +1251,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references to
|
||||
Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -1385,6 +1472,10 @@ spec:
|
|||
AuthResponseHeadersRegex defines the regex to match headers to copy from the authentication server response and set on forwarded request, after stripping all headers that match the regex.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/middlewares/forwardauth/#authresponseheadersregex
|
||||
type: string
|
||||
authSigninURL:
|
||||
description: AuthSigninURL specifies the URL to redirect to when
|
||||
the authentication server returns 401 Unauthorized.
|
||||
type: string
|
||||
forwardBody:
|
||||
description: ForwardBody defines whether to send the request body
|
||||
to the authentication server.
|
||||
|
|
@ -2147,7 +2238,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: middlewaretcps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -2213,8 +2304,9 @@ spec:
|
|||
description: |-
|
||||
IPWhiteList defines the IPWhiteList middleware configuration.
|
||||
This middleware accepts/refuses connections based on the client IP.
|
||||
Deprecated: please use IPAllowList instead.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/tcp/middlewares/ipwhitelist/
|
||||
|
||||
Deprecated: please use IPAllowList instead.
|
||||
properties:
|
||||
sourceRange:
|
||||
description: SourceRange defines the allowed IPs (or ranges of
|
||||
|
|
@ -2235,7 +2327,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: serverstransports.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -2281,6 +2373,12 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
cipherSuites:
|
||||
description: CipherSuites defines the cipher suites to use when contacting
|
||||
backend servers.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
disableHTTP2:
|
||||
description: DisableHTTP2 disables HTTP/2 for connections with backend
|
||||
servers.
|
||||
|
|
@ -2341,6 +2439,14 @@ spec:
|
|||
to keep per-host.
|
||||
minimum: -1
|
||||
type: integer
|
||||
maxVersion:
|
||||
description: MaxVersion defines the maximum TLS version to use when
|
||||
contacting backend servers.
|
||||
type: string
|
||||
minVersion:
|
||||
description: MinVersion defines the minimum TLS version to use when
|
||||
contacting backend servers.
|
||||
type: string
|
||||
peerCertURI:
|
||||
description: PeerCertURI defines the peer cert URI used to match against
|
||||
SAN URI during the peer certificate verification.
|
||||
|
|
@ -2371,6 +2477,7 @@ spec:
|
|||
rootCAsSecrets:
|
||||
description: |-
|
||||
RootCAsSecrets defines a list of CA secret used to validate self-signed certificate.
|
||||
|
||||
Deprecated: RootCAsSecrets is deprecated, please use the RootCAs option instead.
|
||||
items:
|
||||
type: string
|
||||
|
|
@ -2404,7 +2511,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: serverstransporttcps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -2525,6 +2632,7 @@ spec:
|
|||
rootCAsSecrets:
|
||||
description: |-
|
||||
RootCAsSecrets defines a list of CA secret used to validate self-signed certificate.
|
||||
|
||||
Deprecated: RootCAsSecrets is deprecated, please use the RootCAs option instead.
|
||||
items:
|
||||
type: string
|
||||
|
|
@ -2560,7 +2668,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: tlsoptions.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -2660,6 +2768,7 @@ spec:
|
|||
description: |-
|
||||
PreferServerCipherSuites defines whether the server chooses a cipher suite among his own instead of among the client's.
|
||||
It is enabled automatically when minVersion or maxVersion is set.
|
||||
|
||||
Deprecated: https://github.com/golang/go/issues/45430
|
||||
type: boolean
|
||||
sniStrict:
|
||||
|
|
@ -2678,7 +2787,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: tlsstores.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -2775,7 +2884,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: traefikservices.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -2903,6 +3012,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -3140,6 +3268,24 @@ spec:
|
|||
Default value is -1, which means unlimited size.
|
||||
format: int64
|
||||
type: integer
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references to Middleware
|
||||
resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced Middleware
|
||||
resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
mirrorBody:
|
||||
description: |-
|
||||
MirrorBody defines whether the body of the request should be mirrored.
|
||||
|
|
@ -3227,6 +3373,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -3615,6 +3780,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
|
|||
|
|
@ -26,4 +26,4 @@ Dynamic configuration with Kubernetes Custom Resource
|
|||
--8<-- "content/reference/dynamic-configuration/kubernetes-crd-rbac.yml"
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: GatewayClass
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: GatewayClass
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: traefik-ingress-nginx-controller
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- services
|
||||
- secrets
|
||||
- configmaps
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
# When using the watchNamespaceSelector option,
|
||||
# Traefik requires permissions to list and watch namespaces.
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- namespaces
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
# The pods right is needed to inject k8s.pod.uid and k8s.pod.name OTel attributes.
|
||||
# When OTel tracing/logs/metrics are not enabled, this rule is not needed.
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- apiGroups:
|
||||
- discovery.k8s.io
|
||||
resources:
|
||||
- endpointslices
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses
|
||||
- ingressclasses
|
||||
verbs:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses/status
|
||||
verbs:
|
||||
- update
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: traefik-ingress-nginx-controller
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: traefik-ingress-nginx-controller
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: traefik-ingress-nginx-controller
|
||||
namespace: default
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -237,6 +237,8 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-traefikhttpserversTransportsServersTransport0certificates0keyFile" href="#opt-traefikhttpserversTransportsServersTransport0certificates0keyFile" title="#opt-traefikhttpserversTransportsServersTransport0certificates0keyFile">`traefik/http/serversTransports/ServersTransport0/certificates/0/keyFile`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0certificates1certFile" href="#opt-traefikhttpserversTransportsServersTransport0certificates1certFile" title="#opt-traefikhttpserversTransportsServersTransport0certificates1certFile">`traefik/http/serversTransports/ServersTransport0/certificates/1/certFile`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0certificates1keyFile" href="#opt-traefikhttpserversTransportsServersTransport0certificates1keyFile" title="#opt-traefikhttpserversTransportsServersTransport0certificates1keyFile">`traefik/http/serversTransports/ServersTransport0/certificates/1/keyFile`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0cipherSuites0" href="#opt-traefikhttpserversTransportsServersTransport0cipherSuites0" title="#opt-traefikhttpserversTransportsServersTransport0cipherSuites0">`traefik/http/serversTransports/ServersTransport0/cipherSuites/0`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0cipherSuites1" href="#opt-traefikhttpserversTransportsServersTransport0cipherSuites1" title="#opt-traefikhttpserversTransportsServersTransport0cipherSuites1">`traefik/http/serversTransports/ServersTransport0/cipherSuites/1`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0disableHTTP2" href="#opt-traefikhttpserversTransportsServersTransport0disableHTTP2" title="#opt-traefikhttpserversTransportsServersTransport0disableHTTP2">`traefik/http/serversTransports/ServersTransport0/disableHTTP2`</a> | `true` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsdialTimeout" href="#opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsdialTimeout" title="#opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsdialTimeout">`traefik/http/serversTransports/ServersTransport0/forwardingTimeouts/dialTimeout`</a> | `42s` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsidleConnTimeout" href="#opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsidleConnTimeout" title="#opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsidleConnTimeout">`traefik/http/serversTransports/ServersTransport0/forwardingTimeouts/idleConnTimeout`</a> | `42s` |
|
||||
|
|
@ -245,6 +247,8 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsresponseHeaderTimeout" href="#opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsresponseHeaderTimeout" title="#opt-traefikhttpserversTransportsServersTransport0forwardingTimeoutsresponseHeaderTimeout">`traefik/http/serversTransports/ServersTransport0/forwardingTimeouts/responseHeaderTimeout`</a> | `42s` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0insecureSkipVerify" href="#opt-traefikhttpserversTransportsServersTransport0insecureSkipVerify" title="#opt-traefikhttpserversTransportsServersTransport0insecureSkipVerify">`traefik/http/serversTransports/ServersTransport0/insecureSkipVerify`</a> | `true` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0maxIdleConnsPerHost" href="#opt-traefikhttpserversTransportsServersTransport0maxIdleConnsPerHost" title="#opt-traefikhttpserversTransportsServersTransport0maxIdleConnsPerHost">`traefik/http/serversTransports/ServersTransport0/maxIdleConnsPerHost`</a> | `42` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0maxVersion" href="#opt-traefikhttpserversTransportsServersTransport0maxVersion" title="#opt-traefikhttpserversTransportsServersTransport0maxVersion">`traefik/http/serversTransports/ServersTransport0/maxVersion`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0minVersion" href="#opt-traefikhttpserversTransportsServersTransport0minVersion" title="#opt-traefikhttpserversTransportsServersTransport0minVersion">`traefik/http/serversTransports/ServersTransport0/minVersion`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0peerCertURI" href="#opt-traefikhttpserversTransportsServersTransport0peerCertURI" title="#opt-traefikhttpserversTransportsServersTransport0peerCertURI">`traefik/http/serversTransports/ServersTransport0/peerCertURI`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0rootCAs0" href="#opt-traefikhttpserversTransportsServersTransport0rootCAs0" title="#opt-traefikhttpserversTransportsServersTransport0rootCAs0">`traefik/http/serversTransports/ServersTransport0/rootCAs/0`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport0rootCAs1" href="#opt-traefikhttpserversTransportsServersTransport0rootCAs1" title="#opt-traefikhttpserversTransportsServersTransport0rootCAs1">`traefik/http/serversTransports/ServersTransport0/rootCAs/1`</a> | `foobar` |
|
||||
|
|
@ -256,6 +260,8 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-traefikhttpserversTransportsServersTransport1certificates0keyFile" href="#opt-traefikhttpserversTransportsServersTransport1certificates0keyFile" title="#opt-traefikhttpserversTransportsServersTransport1certificates0keyFile">`traefik/http/serversTransports/ServersTransport1/certificates/0/keyFile`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1certificates1certFile" href="#opt-traefikhttpserversTransportsServersTransport1certificates1certFile" title="#opt-traefikhttpserversTransportsServersTransport1certificates1certFile">`traefik/http/serversTransports/ServersTransport1/certificates/1/certFile`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1certificates1keyFile" href="#opt-traefikhttpserversTransportsServersTransport1certificates1keyFile" title="#opt-traefikhttpserversTransportsServersTransport1certificates1keyFile">`traefik/http/serversTransports/ServersTransport1/certificates/1/keyFile`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1cipherSuites0" href="#opt-traefikhttpserversTransportsServersTransport1cipherSuites0" title="#opt-traefikhttpserversTransportsServersTransport1cipherSuites0">`traefik/http/serversTransports/ServersTransport1/cipherSuites/0`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1cipherSuites1" href="#opt-traefikhttpserversTransportsServersTransport1cipherSuites1" title="#opt-traefikhttpserversTransportsServersTransport1cipherSuites1">`traefik/http/serversTransports/ServersTransport1/cipherSuites/1`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1disableHTTP2" href="#opt-traefikhttpserversTransportsServersTransport1disableHTTP2" title="#opt-traefikhttpserversTransportsServersTransport1disableHTTP2">`traefik/http/serversTransports/ServersTransport1/disableHTTP2`</a> | `true` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsdialTimeout" href="#opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsdialTimeout" title="#opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsdialTimeout">`traefik/http/serversTransports/ServersTransport1/forwardingTimeouts/dialTimeout`</a> | `42s` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsidleConnTimeout" href="#opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsidleConnTimeout" title="#opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsidleConnTimeout">`traefik/http/serversTransports/ServersTransport1/forwardingTimeouts/idleConnTimeout`</a> | `42s` |
|
||||
|
|
@ -264,6 +270,8 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsresponseHeaderTimeout" href="#opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsresponseHeaderTimeout" title="#opt-traefikhttpserversTransportsServersTransport1forwardingTimeoutsresponseHeaderTimeout">`traefik/http/serversTransports/ServersTransport1/forwardingTimeouts/responseHeaderTimeout`</a> | `42s` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1insecureSkipVerify" href="#opt-traefikhttpserversTransportsServersTransport1insecureSkipVerify" title="#opt-traefikhttpserversTransportsServersTransport1insecureSkipVerify">`traefik/http/serversTransports/ServersTransport1/insecureSkipVerify`</a> | `true` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1maxIdleConnsPerHost" href="#opt-traefikhttpserversTransportsServersTransport1maxIdleConnsPerHost" title="#opt-traefikhttpserversTransportsServersTransport1maxIdleConnsPerHost">`traefik/http/serversTransports/ServersTransport1/maxIdleConnsPerHost`</a> | `42` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1maxVersion" href="#opt-traefikhttpserversTransportsServersTransport1maxVersion" title="#opt-traefikhttpserversTransportsServersTransport1maxVersion">`traefik/http/serversTransports/ServersTransport1/maxVersion`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1minVersion" href="#opt-traefikhttpserversTransportsServersTransport1minVersion" title="#opt-traefikhttpserversTransportsServersTransport1minVersion">`traefik/http/serversTransports/ServersTransport1/minVersion`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1peerCertURI" href="#opt-traefikhttpserversTransportsServersTransport1peerCertURI" title="#opt-traefikhttpserversTransportsServersTransport1peerCertURI">`traefik/http/serversTransports/ServersTransport1/peerCertURI`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1rootCAs0" href="#opt-traefikhttpserversTransportsServersTransport1rootCAs0" title="#opt-traefikhttpserversTransportsServersTransport1rootCAs0">`traefik/http/serversTransports/ServersTransport1/rootCAs/0`</a> | `foobar` |
|
||||
| <a id="opt-traefikhttpserversTransportsServersTransport1rootCAs1" href="#opt-traefikhttpserversTransportsServersTransport1rootCAs1" title="#opt-traefikhttpserversTransportsServersTransport1rootCAs1">`traefik/http/serversTransports/ServersTransport1/rootCAs/1`</a> | `foobar` |
|
||||
|
|
|
|||
|
|
@ -1,114 +0,0 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
name: tlsoptions.traefik.containo.us
|
||||
spec:
|
||||
group: traefik.containo.us
|
||||
names:
|
||||
kind: TLSOption
|
||||
listKind: TLSOptionList
|
||||
plural: tlsoptions
|
||||
singular: tlsoption
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: |-
|
||||
TLSOption is the CRD implementation of a Traefik TLS Option, allowing to configure some parameters of the TLS connection.
|
||||
More info: https://doc.traefik.io/traefik/v2.11/https/tls/#tls-options
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: TLSOptionSpec defines the desired state of a TLSOption.
|
||||
properties:
|
||||
alpnProtocols:
|
||||
description: |-
|
||||
ALPNProtocols defines the list of supported application level protocols for the TLS handshake, in order of preference.
|
||||
More info: https://doc.traefik.io/traefik/v2.11/https/tls/#alpn-protocols
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
cipherSuites:
|
||||
description: |-
|
||||
CipherSuites defines the list of supported cipher suites for TLS versions up to TLS 1.2.
|
||||
More info: https://doc.traefik.io/traefik/v2.11/https/tls/#cipher-suites
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
clientAuth:
|
||||
description: ClientAuth defines the server's policy for TLS Client
|
||||
Authentication.
|
||||
properties:
|
||||
clientAuthType:
|
||||
description: ClientAuthType defines the client authentication
|
||||
type to apply.
|
||||
enum:
|
||||
- NoClientCert
|
||||
- RequestClientCert
|
||||
- RequireAnyClientCert
|
||||
- VerifyClientCertIfGiven
|
||||
- RequireAndVerifyClientCert
|
||||
type: string
|
||||
secretNames:
|
||||
description: SecretNames defines the names of the referenced Kubernetes
|
||||
Secret storing certificate details.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
curvePreferences:
|
||||
description: |-
|
||||
CurvePreferences defines the preferred elliptic curves.
|
||||
More info: https://doc.traefik.io/traefik/v2.11/https/tls/#curve-preferences
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
maxVersion:
|
||||
description: |-
|
||||
MaxVersion defines the maximum TLS version that Traefik will accept.
|
||||
Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
|
||||
Default: None.
|
||||
type: string
|
||||
minVersion:
|
||||
description: |-
|
||||
MinVersion defines the minimum TLS version that Traefik will accept.
|
||||
Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
|
||||
Default: VersionTLS10.
|
||||
type: string
|
||||
preferServerCipherSuites:
|
||||
description: |-
|
||||
PreferServerCipherSuites defines whether the server chooses a cipher suite among his own instead of among the client's.
|
||||
It is enabled automatically when minVersion or maxVersion is set.
|
||||
Deprecated: https://github.com/golang/go/issues/45430
|
||||
type: boolean
|
||||
sniStrict:
|
||||
description: SniStrict defines whether Traefik allows connections
|
||||
from clients connections that do not specify a server_name extension.
|
||||
type: boolean
|
||||
type: object
|
||||
required:
|
||||
- metadata
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: ingressroutes.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -48,6 +48,10 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
ingressClassName:
|
||||
description: IngressClassName defines the name of the IngressClass
|
||||
cluster resource.
|
||||
type: string
|
||||
parentRefs:
|
||||
description: |-
|
||||
ParentRefs defines references to parent IngressRoute resources for multi-layer routing.
|
||||
|
|
@ -219,6 +223,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of
|
||||
the referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -374,6 +397,7 @@ spec:
|
|||
description: |-
|
||||
Syntax defines the router's rule syntax.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/routing/rules-and-priority/#rulesyntax
|
||||
|
||||
Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax.
|
||||
type: string
|
||||
required:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: ingressroutetcps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -48,6 +48,10 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
ingressClassName:
|
||||
description: IngressClassName defines the name of the IngressClass
|
||||
cluster resource.
|
||||
type: string
|
||||
routes:
|
||||
description: Routes defines the list of routes.
|
||||
items:
|
||||
|
|
@ -123,6 +127,7 @@ spec:
|
|||
description: |-
|
||||
ProxyProtocol defines the PROXY protocol configuration.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/tcp/service/#proxy-protocol
|
||||
|
||||
Deprecated: ProxyProtocol will not be supported in future APIVersions, please use ServersTransport to configure ProxyProtocol instead.
|
||||
properties:
|
||||
version:
|
||||
|
|
@ -145,6 +150,7 @@ spec:
|
|||
hence fully terminating the connection.
|
||||
It is a duration in milliseconds, defaulting to 100.
|
||||
A negative value means an infinite deadline (i.e. the reading capability is never closed).
|
||||
|
||||
Deprecated: TerminationDelay will not be supported in future APIVersions, please use ServersTransport to configure the TerminationDelay instead.
|
||||
type: integer
|
||||
tls:
|
||||
|
|
@ -165,6 +171,7 @@ spec:
|
|||
description: |-
|
||||
Syntax defines the router's rule syntax.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/tcp/routing/rules-and-priority/#rulesyntax
|
||||
|
||||
Deprecated: Please do not use this field and rewrite the router rules to use the v3 syntax.
|
||||
enum:
|
||||
- v3
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: ingressrouteudps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -48,6 +48,10 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
ingressClassName:
|
||||
description: IngressClassName defines the name of the IngressClass
|
||||
cluster resource.
|
||||
type: string
|
||||
routes:
|
||||
description: Routes defines the list of routes.
|
||||
items:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: middlewares.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -231,6 +231,7 @@ spec:
|
|||
description: |-
|
||||
AutoDetect specifies whether to let the `Content-Type` header, if it has not been set by the backend,
|
||||
be automatically set to a value derived from the contents of the response.
|
||||
|
||||
Deprecated: AutoDetect option is deprecated, Content-Type middleware is only meant to be used to enable the content-type detection, please remove any usage of this option.
|
||||
type: boolean
|
||||
type: object
|
||||
|
|
@ -259,6 +260,39 @@ spec:
|
|||
containing user credentials.
|
||||
type: string
|
||||
type: object
|
||||
encodedCharacters:
|
||||
description: EncodedCharacters configures which encoded characters
|
||||
are allowed in the request path.
|
||||
properties:
|
||||
allowEncodedBackSlash:
|
||||
description: AllowEncodedBackSlash defines whether requests with
|
||||
encoded back slash characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedHash:
|
||||
description: AllowEncodedHash defines whether requests with encoded
|
||||
hash characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedNullCharacter:
|
||||
description: AllowEncodedNullCharacter defines whether requests
|
||||
with encoded null characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedPercent:
|
||||
description: AllowEncodedPercent defines whether requests with
|
||||
encoded percent characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedQuestionMark:
|
||||
description: AllowEncodedQuestionMark defines whether requests
|
||||
with encoded question mark characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedSemicolon:
|
||||
description: AllowEncodedSemicolon defines whether requests with
|
||||
encoded semicolon characters in the path are allowed.
|
||||
type: boolean
|
||||
allowEncodedSlash:
|
||||
description: AllowEncodedSlash defines whether requests with encoded
|
||||
slash characters in the path are allowed.
|
||||
type: boolean
|
||||
type: object
|
||||
errors:
|
||||
description: |-
|
||||
ErrorPage holds the custom error middleware configuration.
|
||||
|
|
@ -353,6 +387,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references to
|
||||
Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -555,6 +608,10 @@ spec:
|
|||
AuthResponseHeadersRegex defines the regex to match headers to copy from the authentication server response and set on forwarded request, after stripping all headers that match the regex.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/middlewares/forwardauth/#authresponseheadersregex
|
||||
type: string
|
||||
authSigninURL:
|
||||
description: AuthSigninURL specifies the URL to redirect to when
|
||||
the authentication server returns 401 Unauthorized.
|
||||
type: string
|
||||
forwardBody:
|
||||
description: ForwardBody defines whether to send the request body
|
||||
to the authentication server.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: middlewaretcps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -69,8 +69,9 @@ spec:
|
|||
description: |-
|
||||
IPWhiteList defines the IPWhiteList middleware configuration.
|
||||
This middleware accepts/refuses connections based on the client IP.
|
||||
Deprecated: please use IPAllowList instead.
|
||||
More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/tcp/middlewares/ipwhitelist/
|
||||
|
||||
Deprecated: please use IPAllowList instead.
|
||||
properties:
|
||||
sourceRange:
|
||||
description: SourceRange defines the allowed IPs (or ranges of
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: serverstransports.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -49,6 +49,12 @@ spec:
|
|||
items:
|
||||
type: string
|
||||
type: array
|
||||
cipherSuites:
|
||||
description: CipherSuites defines the cipher suites to use when contacting
|
||||
backend servers.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
disableHTTP2:
|
||||
description: DisableHTTP2 disables HTTP/2 for connections with backend
|
||||
servers.
|
||||
|
|
@ -109,6 +115,14 @@ spec:
|
|||
to keep per-host.
|
||||
minimum: -1
|
||||
type: integer
|
||||
maxVersion:
|
||||
description: MaxVersion defines the maximum TLS version to use when
|
||||
contacting backend servers.
|
||||
type: string
|
||||
minVersion:
|
||||
description: MinVersion defines the minimum TLS version to use when
|
||||
contacting backend servers.
|
||||
type: string
|
||||
peerCertURI:
|
||||
description: PeerCertURI defines the peer cert URI used to match against
|
||||
SAN URI during the peer certificate verification.
|
||||
|
|
@ -139,6 +153,7 @@ spec:
|
|||
rootCAsSecrets:
|
||||
description: |-
|
||||
RootCAsSecrets defines a list of CA secret used to validate self-signed certificate.
|
||||
|
||||
Deprecated: RootCAsSecrets is deprecated, please use the RootCAs option instead.
|
||||
items:
|
||||
type: string
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: serverstransporttcps.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -124,6 +124,7 @@ spec:
|
|||
rootCAsSecrets:
|
||||
description: |-
|
||||
RootCAsSecrets defines a list of CA secret used to validate self-signed certificate.
|
||||
|
||||
Deprecated: RootCAsSecrets is deprecated, please use the RootCAs option instead.
|
||||
items:
|
||||
type: string
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: tlsoptions.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -103,6 +103,7 @@ spec:
|
|||
description: |-
|
||||
PreferServerCipherSuites defines whether the server chooses a cipher suite among his own instead of among the client's.
|
||||
It is enabled automatically when minVersion or maxVersion is set.
|
||||
|
||||
Deprecated: https://github.com/golang/go/issues/45430
|
||||
type: boolean
|
||||
sniStrict:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: tlsstores.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
|||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.16.1
|
||||
controller-gen.kubebuilder.io/version: v0.19.0
|
||||
name: traefikservices.traefik.io
|
||||
spec:
|
||||
group: traefik.io
|
||||
|
|
@ -131,6 +131,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -368,6 +387,24 @@ spec:
|
|||
Default value is -1, which means unlimited size.
|
||||
format: int64
|
||||
type: integer
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references to Middleware
|
||||
resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced Middleware
|
||||
resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
mirrorBody:
|
||||
description: |-
|
||||
MirrorBody defines whether the body of the request should be mirrored.
|
||||
|
|
@ -455,6 +492,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
@ -843,6 +899,25 @@ spec:
|
|||
- Service
|
||||
- TraefikService
|
||||
type: string
|
||||
middlewares:
|
||||
description: Middlewares defines the list of references
|
||||
to Middleware resources to apply to the service.
|
||||
items:
|
||||
description: MiddlewareRef is a reference to a Middleware
|
||||
resource.
|
||||
properties:
|
||||
name:
|
||||
description: Name defines the name of the referenced
|
||||
Middleware resource.
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace defines the namespace of the
|
||||
referenced Middleware resource.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
name:
|
||||
description: |-
|
||||
Name defines the name of the referenced Kubernetes Service or TraefikService.
|
||||
|
|
|
|||
|
|
@ -3,13 +3,27 @@ title: "Traefik API & Dashboard Documentation"
|
|||
description: "Traefik Proxy exposes information through API handlers and showcase them on the Dashboard. Learn about the security, configuration, and endpoints of the APIs and Dashboard. Read the technical documentation."
|
||||
---
|
||||
|
||||
The dashboard is the central place that shows you the current active routes handled by Traefik.
|
||||
Traefik exposes a number of information through API endpoints, such as the configuration of your routers, services, middlewares, etc.
|
||||
|
||||
The dashboard, which is the central place that displays the current active routes handled by Traefik, fetches the data from this API.
|
||||
|
||||
<figure>
|
||||
<img src="../../../assets/img/webui-dashboard.png" alt="Dashboard - Providers" />
|
||||
<figcaption>The dashboard in action</figcaption>
|
||||
</figure>
|
||||
|
||||
## Security
|
||||
|
||||
Enabling the API and the dashboard in production is not recommended, because it will expose all configuration elements,
|
||||
including sensitive data, for which access should be reserved to administrators.
|
||||
|
||||
In production, it should be at least secured by authentication and authorizations.
|
||||
|
||||
!!! info
|
||||
|
||||
It's recommended to NOT publicly exposing the API's port, keeping it restricted to internal networks
|
||||
(as in the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege), applied to networks).
|
||||
|
||||
## Configuration Example
|
||||
|
||||
Enable the dashboard:
|
||||
|
|
@ -187,6 +201,7 @@ All the following endpoints must be accessed with a `GET` HTTP request.
|
|||
| <a id="opt-apientrypoints" href="#opt-apientrypoints" title="#opt-apientrypoints">`/api/entrypoints`</a> | Lists all the entry points information. |
|
||||
| <a id="opt-apientrypointsname" href="#opt-apientrypointsname" title="#opt-apientrypointsname">`/api/entrypoints/{name}`</a> | Returns the information of the entry point specified by `name`. |
|
||||
| <a id="opt-apioverview" href="#opt-apioverview" title="#opt-apioverview">`/api/overview`</a> | Returns statistic information about HTTP, TCP and about enabled features and providers. |
|
||||
| <a id="opt-apisupport-dump" href="#opt-apisupport-dump" title="#opt-apisupport-dump">`/api/support-dump`</a> | Returns an archive that contains the anonymized static configuration and the runtime configuration. |
|
||||
| <a id="opt-apirawdata" href="#opt-apirawdata" title="#opt-apirawdata">`/api/rawdata`</a> | Returns information about dynamic configurations, errors, status and dependency relations. |
|
||||
| <a id="opt-apiversion" href="#opt-apiversion" title="#opt-apiversion">`/api/version`</a> | Returns information about Traefik version. |
|
||||
| <a id="opt-debugvars" href="#opt-debugvars" title="#opt-debugvars">`/debug/vars`</a> | See the [expvar](https://golang.org/pkg/expvar/) Go documentation. |
|
||||
|
|
@ -203,14 +218,16 @@ All the following endpoints must be accessed with a `GET` HTTP request.
|
|||
|
||||
## Dashboard
|
||||
|
||||
The dashboard is available at the same location as the API, but by default on the path `/dashboard/`.
|
||||
The dashboard is available by default on the path `/dashboard/`.
|
||||
|
||||
!!! note
|
||||
|
||||
- The trailing slash `/` in `/dashboard/` is mandatory. This limitation can be mitigated using the the [RedirectRegex Middleware](../../middlewares/http/redirectregex.md).
|
||||
- There is also a redirect from the path `/` to `/dashboard/`, but you should not rely on this behavior, as it is subject to change and may complicate routing rules.
|
||||
- There is also a redirect from the path `/` to `/dashboard/`.
|
||||
|
||||
To securely access the dashboard, you need to define a routing configuration within Traefik. This involves setting up a router attached to the service `api@internal`, which allows you to:
|
||||
As mentioned above in the [Security](#security) section, it is important to secure access to both the dashboard and the API.
|
||||
You need to define a routing configuration within Traefik.
|
||||
This involves setting up a router attached to the service `api@internal`, which allows you to:
|
||||
|
||||
- Implement security features using [middlewares](../../middlewares/overview.md), such as authentication ([basicAuth](../../middlewares/http/basicauth.md), [digestAuth](../../middlewares/http/digestauth.md),
|
||||
[forwardAuth](../../middlewares/http/forwardauth.md)) or [allowlisting](../../middlewares/http/ipallowlist.md).
|
||||
|
|
@ -238,4 +255,4 @@ rule = "PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
|
|||
rule = "Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
||||
```
|
||||
|
||||
{!traefik-for-business-applications.md!}
|
||||
{% include-markdown "includes/traefik-for-business-applications.md" %}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-accesslog" href="#opt-accesslog" title="#opt-accesslog">accesslog</a> | Access log settings. | false |
|
||||
| <a id="opt-accesslog-addinternals" href="#opt-accesslog-addinternals" title="#opt-accesslog-addinternals">accesslog.addinternals</a> | Enables access log for internal services (ping, dashboard, etc...). | false |
|
||||
| <a id="opt-accesslog-bufferingsize" href="#opt-accesslog-bufferingsize" title="#opt-accesslog-bufferingsize">accesslog.bufferingsize</a> | Number of access log lines to process in a buffered way. | 0 |
|
||||
| <a id="opt-accesslog-dualoutput" href="#opt-accesslog-dualoutput" title="#opt-accesslog-dualoutput">accesslog.dualoutput</a> | Enables access log output alongside OTLP. By default, this output is disabled when OTLP is configured. | false |
|
||||
| <a id="opt-accesslog-fields-defaultmode" href="#opt-accesslog-fields-defaultmode" title="#opt-accesslog-fields-defaultmode">accesslog.fields.defaultmode</a> | Default mode for fields: keep | drop | keep |
|
||||
| <a id="opt-accesslog-fields-headers-defaultmode" href="#opt-accesslog-fields-headers-defaultmode" title="#opt-accesslog-fields-headers-defaultmode">accesslog.fields.headers.defaultmode</a> | Default mode for fields: keep | drop | redact | drop |
|
||||
| <a id="opt-accesslog-fields-headers-names-name" href="#opt-accesslog-fields-headers-names-name" title="#opt-accesslog-fields-headers-names-name">accesslog.fields.headers.names._name_</a> | Override mode for headers | |
|
||||
|
|
@ -40,6 +41,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-api" href="#opt-api" title="#opt-api">api</a> | Enable api/dashboard. | false |
|
||||
| <a id="opt-api-basepath" href="#opt-api-basepath" title="#opt-api-basepath">api.basepath</a> | Defines the base path where the API and Dashboard will be exposed. | / |
|
||||
| <a id="opt-api-dashboard" href="#opt-api-dashboard" title="#opt-api-dashboard">api.dashboard</a> | Activate dashboard. | true |
|
||||
| <a id="opt-api-dashboardname" href="#opt-api-dashboardname" title="#opt-api-dashboardname">api.dashboardname</a> | Custom name for the dashboard. | |
|
||||
| <a id="opt-api-debug" href="#opt-api-debug" title="#opt-api-debug">api.debug</a> | Enable additional endpoints for debugging and profiling. | false |
|
||||
| <a id="opt-api-disabledashboardad" href="#opt-api-disabledashboardad" title="#opt-api-disabledashboardad">api.disabledashboardad</a> | Disable ad in the dashboard. | false |
|
||||
| <a id="opt-api-insecure" href="#opt-api-insecure" title="#opt-api-insecure">api.insecure</a> | Activate API directly on the entryPoint named traefik. | false |
|
||||
|
|
@ -49,6 +51,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-certificatesresolvers-name-acme-caservername" href="#opt-certificatesresolvers-name-acme-caservername" title="#opt-certificatesresolvers-name-acme-caservername">certificatesresolvers._name_.acme.caservername</a> | Specify 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. | |
|
||||
| <a id="opt-certificatesresolvers-name-acme-casystemcertpool" href="#opt-certificatesresolvers-name-acme-casystemcertpool" title="#opt-certificatesresolvers-name-acme-casystemcertpool">certificatesresolvers._name_.acme.casystemcertpool</a> | Define if the certificates pool must use a copy of the system cert pool. | false |
|
||||
| <a id="opt-certificatesresolvers-name-acme-certificatesduration" href="#opt-certificatesresolvers-name-acme-certificatesduration" title="#opt-certificatesresolvers-name-acme-certificatesduration">certificatesresolvers._name_.acme.certificatesduration</a> | Certificates' duration in hours. | 2160 |
|
||||
| <a id="opt-certificatesresolvers-name-acme-certificatetimeout" href="#opt-certificatesresolvers-name-acme-certificatetimeout" title="#opt-certificatesresolvers-name-acme-certificatetimeout">certificatesresolvers._name_.acme.certificatetimeout</a> | Timeout for obtaining the certificate during the finalization request. | 30 |
|
||||
| <a id="opt-certificatesresolvers-name-acme-clientresponseheadertimeout" href="#opt-certificatesresolvers-name-acme-clientresponseheadertimeout" title="#opt-certificatesresolvers-name-acme-clientresponseheadertimeout">certificatesresolvers._name_.acme.clientresponseheadertimeout</a> | Timeout for receiving the response headers when communicating with the ACME server. | 30 |
|
||||
| <a id="opt-certificatesresolvers-name-acme-clienttimeout" href="#opt-certificatesresolvers-name-acme-clienttimeout" title="#opt-certificatesresolvers-name-acme-clienttimeout">certificatesresolvers._name_.acme.clienttimeout</a> | Timeout for a complete HTTP transaction with the ACME server. | 120 |
|
||||
| <a id="opt-certificatesresolvers-name-acme-disablecommonname" href="#opt-certificatesresolvers-name-acme-disablecommonname" title="#opt-certificatesresolvers-name-acme-disablecommonname">certificatesresolvers._name_.acme.disablecommonname</a> | Disable the common name in the CSR. | false |
|
||||
|
|
@ -83,16 +86,16 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-entrypoints-name-asdefault" href="#opt-entrypoints-name-asdefault" title="#opt-entrypoints-name-asdefault">entrypoints._name_.asdefault</a> | Adds this EntryPoint to the list of default EntryPoints to be used on routers that don't have any Entrypoint defined. | false |
|
||||
| <a id="opt-entrypoints-name-forwardedheaders-connection" href="#opt-entrypoints-name-forwardedheaders-connection" title="#opt-entrypoints-name-forwardedheaders-connection">entrypoints._name_.forwardedheaders.connection</a> | List of Connection headers that are allowed to pass through the middleware chain before being removed. | |
|
||||
| <a id="opt-entrypoints-name-forwardedheaders-insecure" href="#opt-entrypoints-name-forwardedheaders-insecure" title="#opt-entrypoints-name-forwardedheaders-insecure">entrypoints._name_.forwardedheaders.insecure</a> | Trust all forwarded headers. | false |
|
||||
| <a id="opt-entrypoints-name-forwardedheaders-notappendxforwardedfor" href="#opt-entrypoints-name-forwardedheaders-notappendxforwardedfor" title="#opt-entrypoints-name-forwardedheaders-notappendxforwardedfor">entrypoints._name_.forwardedheaders.notappendxforwardedfor</a> | Disable appending RemoteAddr to X-Forwarded-For header. Defaults to false (appending is enabled). | false |
|
||||
| <a id="opt-entrypoints-name-forwardedheaders-trustedips" href="#opt-entrypoints-name-forwardedheaders-trustedips" title="#opt-entrypoints-name-forwardedheaders-trustedips">entrypoints._name_.forwardedheaders.trustedips</a> | Trust only forwarded headers from selected IPs. | |
|
||||
| <a id="opt-entrypoints-name-http" href="#opt-entrypoints-name-http" title="#opt-entrypoints-name-http">entrypoints._name_.http</a> | HTTP configuration. | |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters" href="#opt-entrypoints-name-http-encodedcharacters" title="#opt-entrypoints-name-http-encodedcharacters">entrypoints._name_.http.encodedcharacters</a> | Defines which encoded characters are allowed in the request path. | |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedbackslash" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedbackslash" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedbackslash">entrypoints._name_.http.encodedcharacters.allowencodedbackslash</a> | Defines whether requests with encoded back slash characters in the path are allowed. | false |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedhash" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedhash" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedhash">entrypoints._name_.http.encodedcharacters.allowencodedhash</a> | Defines whether requests with encoded hash characters in the path are allowed. | false |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodednullcharacter" href="#opt-entrypoints-name-http-encodedcharacters-allowencodednullcharacter" title="#opt-entrypoints-name-http-encodedcharacters-allowencodednullcharacter">entrypoints._name_.http.encodedcharacters.allowencodednullcharacter</a> | Defines whether requests with encoded null characters in the path are allowed. | false |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedpercent" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedpercent" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedpercent">entrypoints._name_.http.encodedcharacters.allowencodedpercent</a> | Defines whether requests with encoded percent characters in the path are allowed. | false |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedquestionmark" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedquestionmark" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedquestionmark">entrypoints._name_.http.encodedcharacters.allowencodedquestionmark</a> | Defines whether requests with encoded question mark characters in the path are allowed. | false |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedsemicolon" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedsemicolon" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedsemicolon">entrypoints._name_.http.encodedcharacters.allowencodedsemicolon</a> | Defines whether requests with encoded semicolon characters in the path are allowed. | false |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedslash" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedslash" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedslash">entrypoints._name_.http.encodedcharacters.allowencodedslash</a> | Defines whether requests with encoded slash characters in the path are allowed. | false |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedbackslash" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedbackslash" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedbackslash">entrypoints._name_.http.encodedcharacters.allowencodedbackslash</a> | Defines whether requests with encoded back slash characters in the path are allowed. | true |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedhash" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedhash" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedhash">entrypoints._name_.http.encodedcharacters.allowencodedhash</a> | Defines whether requests with encoded hash characters in the path are allowed. | true |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodednullcharacter" href="#opt-entrypoints-name-http-encodedcharacters-allowencodednullcharacter" title="#opt-entrypoints-name-http-encodedcharacters-allowencodednullcharacter">entrypoints._name_.http.encodedcharacters.allowencodednullcharacter</a> | Defines whether requests with encoded null characters in the path are allowed. | true |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedpercent" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedpercent" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedpercent">entrypoints._name_.http.encodedcharacters.allowencodedpercent</a> | Defines whether requests with encoded percent characters in the path are allowed. | true |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedquestionmark" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedquestionmark" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedquestionmark">entrypoints._name_.http.encodedcharacters.allowencodedquestionmark</a> | Defines whether requests with encoded question mark characters in the path are allowed. | true |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedsemicolon" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedsemicolon" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedsemicolon">entrypoints._name_.http.encodedcharacters.allowencodedsemicolon</a> | Defines whether requests with encoded semicolon characters in the path are allowed. | true |
|
||||
| <a id="opt-entrypoints-name-http-encodedcharacters-allowencodedslash" href="#opt-entrypoints-name-http-encodedcharacters-allowencodedslash" title="#opt-entrypoints-name-http-encodedcharacters-allowencodedslash">entrypoints._name_.http.encodedcharacters.allowencodedslash</a> | Defines whether requests with encoded slash characters in the path are allowed. | true |
|
||||
| <a id="opt-entrypoints-name-http-encodequerysemicolons" href="#opt-entrypoints-name-http-encodequerysemicolons" title="#opt-entrypoints-name-http-encodequerysemicolons">entrypoints._name_.http.encodequerysemicolons</a> | Defines whether request query semicolons should be URLEncoded. | false |
|
||||
| <a id="opt-entrypoints-name-http-maxheaderbytes" href="#opt-entrypoints-name-http-maxheaderbytes" title="#opt-entrypoints-name-http-maxheaderbytes">entrypoints._name_.http.maxheaderbytes</a> | Maximum size of request headers in bytes. | 1048576 |
|
||||
| <a id="opt-entrypoints-name-http-middlewares" href="#opt-entrypoints-name-http-middlewares" title="#opt-entrypoints-name-http-middlewares">entrypoints._name_.http.middlewares</a> | Default middlewares for the routers linked to the entry point. | |
|
||||
|
|
@ -149,6 +152,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-experimental-plugins-name-settings-useunsafe" href="#opt-experimental-plugins-name-settings-useunsafe" title="#opt-experimental-plugins-name-settings-useunsafe">experimental.plugins._name_.settings.useunsafe</a> | Allow the plugin to use unsafe and syscall packages. | false |
|
||||
| <a id="opt-experimental-plugins-name-version" href="#opt-experimental-plugins-name-version" title="#opt-experimental-plugins-name-version">experimental.plugins._name_.version</a> | plugin's version. | |
|
||||
| <a id="opt-global-checknewversion" href="#opt-global-checknewversion" title="#opt-global-checknewversion">global.checknewversion</a> | Periodically check if a new version has been released. | true |
|
||||
| <a id="opt-global-notappendxforwardedfor" href="#opt-global-notappendxforwardedfor" title="#opt-global-notappendxforwardedfor">global.notappendxforwardedfor</a> | Disable appending RemoteAddr to X-Forwarded-For header. Defaults to false (appending is enabled). | false |
|
||||
| <a id="opt-global-sendanonymoususage" href="#opt-global-sendanonymoususage" title="#opt-global-sendanonymoususage">global.sendanonymoususage</a> | Periodically send anonymous usage statistics. If the option is not specified, it will be disabled by default. | false |
|
||||
| <a id="opt-hostresolver" href="#opt-hostresolver" title="#opt-hostresolver">hostresolver</a> | Enable CNAME Flattening. | false |
|
||||
| <a id="opt-hostresolver-cnameflattening" href="#opt-hostresolver-cnameflattening" title="#opt-hostresolver-cnameflattening">hostresolver.cnameflattening</a> | A flag to enable/disable CNAME flattening | false |
|
||||
|
|
@ -198,7 +202,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-metrics-influxdb2-bucket" href="#opt-metrics-influxdb2-bucket" title="#opt-metrics-influxdb2-bucket">metrics.influxdb2.bucket</a> | InfluxDB v2 bucket ID. | |
|
||||
| <a id="opt-metrics-influxdb2-org" href="#opt-metrics-influxdb2-org" title="#opt-metrics-influxdb2-org">metrics.influxdb2.org</a> | InfluxDB v2 org ID. | |
|
||||
| <a id="opt-metrics-influxdb2-pushinterval" href="#opt-metrics-influxdb2-pushinterval" title="#opt-metrics-influxdb2-pushinterval">metrics.influxdb2.pushinterval</a> | InfluxDB v2 push interval. | 10 |
|
||||
| <a id="opt-metrics-influxdb2-token" href="#opt-metrics-influxdb2-token" title="#opt-metrics-influxdb2-token">metrics.influxdb2.token</a> | InfluxDB v2 access token. | |
|
||||
| <a id="opt-metrics-influxdb2-token" href="#opt-metrics-influxdb2-token" title="#opt-metrics-influxdb2-token">metrics.influxdb2.token</a> | InfluxDB v2 access token. It accepts either a token value or a file path to the token. | |
|
||||
| <a id="opt-metrics-otlp" href="#opt-metrics-otlp" title="#opt-metrics-otlp">metrics.otlp</a> | OpenTelemetry metrics exporter type. | false |
|
||||
| <a id="opt-metrics-otlp-addentrypointslabels" href="#opt-metrics-otlp-addentrypointslabels" title="#opt-metrics-otlp-addentrypointslabels">metrics.otlp.addentrypointslabels</a> | Enable metrics on entry points. | true |
|
||||
| <a id="opt-metrics-otlp-addrouterslabels" href="#opt-metrics-otlp-addrouterslabels" title="#opt-metrics-otlp-addrouterslabels">metrics.otlp.addrouterslabels</a> | Enable metrics on routers. | false |
|
||||
|
|
@ -350,7 +354,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-providers-kubernetescrd-certauthfilepath" href="#opt-providers-kubernetescrd-certauthfilepath" title="#opt-providers-kubernetescrd-certauthfilepath">providers.kubernetescrd.certauthfilepath</a> | Kubernetes certificate authority file path (not needed for in-cluster client). | |
|
||||
| <a id="opt-providers-kubernetescrd-disableclusterscoperesources" href="#opt-providers-kubernetescrd-disableclusterscoperesources" title="#opt-providers-kubernetescrd-disableclusterscoperesources">providers.kubernetescrd.disableclusterscoperesources</a> | Disables the lookup of cluster scope resources (incompatible with IngressClasses and NodePortLB enabled services). | false |
|
||||
| <a id="opt-providers-kubernetescrd-endpoint" href="#opt-providers-kubernetescrd-endpoint" title="#opt-providers-kubernetescrd-endpoint">providers.kubernetescrd.endpoint</a> | Kubernetes server endpoint (required for external cluster client). | |
|
||||
| <a id="opt-providers-kubernetescrd-ingressclass" href="#opt-providers-kubernetescrd-ingressclass" title="#opt-providers-kubernetescrd-ingressclass">providers.kubernetescrd.ingressclass</a> | Value of kubernetes.io/ingress.class annotation to watch for. | |
|
||||
| <a id="opt-providers-kubernetescrd-ingressclass" href="#opt-providers-kubernetescrd-ingressclass" title="#opt-providers-kubernetescrd-ingressclass">providers.kubernetescrd.ingressclass</a> | Value of ingressClassName field or kubernetes.io/ingress.class annotation to watch for. | |
|
||||
| <a id="opt-providers-kubernetescrd-labelselector" href="#opt-providers-kubernetescrd-labelselector" title="#opt-providers-kubernetescrd-labelselector">providers.kubernetescrd.labelselector</a> | Kubernetes label selector to use. | |
|
||||
| <a id="opt-providers-kubernetescrd-namespaces" href="#opt-providers-kubernetescrd-namespaces" title="#opt-providers-kubernetescrd-namespaces">providers.kubernetescrd.namespaces</a> | Kubernetes namespaces. | |
|
||||
| <a id="opt-providers-kubernetescrd-nativelbbydefault" href="#opt-providers-kubernetescrd-nativelbbydefault" title="#opt-providers-kubernetescrd-nativelbbydefault">providers.kubernetescrd.nativelbbydefault</a> | Defines whether to use Native Kubernetes load-balancing mode by default. | false |
|
||||
|
|
@ -395,6 +399,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
|
|||
| <a id="opt-providers-kubernetesingressnginx-endpoint" href="#opt-providers-kubernetesingressnginx-endpoint" title="#opt-providers-kubernetesingressnginx-endpoint">providers.kubernetesingressnginx.endpoint</a> | Kubernetes server endpoint (required for external cluster client). | |
|
||||
| <a id="opt-providers-kubernetesingressnginx-ingressclass" href="#opt-providers-kubernetesingressnginx-ingressclass" title="#opt-providers-kubernetesingressnginx-ingressclass">providers.kubernetesingressnginx.ingressclass</a> | Name of the ingress class this controller satisfies. | nginx |
|
||||
| <a id="opt-providers-kubernetesingressnginx-ingressclassbyname" href="#opt-providers-kubernetesingressnginx-ingressclassbyname" title="#opt-providers-kubernetesingressnginx-ingressclassbyname">providers.kubernetesingressnginx.ingressclassbyname</a> | Define if Ingress Controller should watch for Ingress Class by Name together with Controller Class. | false |
|
||||
| <a id="opt-providers-kubernetesingressnginx-proxyconnecttimeout" href="#opt-providers-kubernetesingressnginx-proxyconnecttimeout" title="#opt-providers-kubernetesingressnginx-proxyconnecttimeout">providers.kubernetesingressnginx.proxyconnecttimeout</a> | Amount of time to wait until a connection to a server can be established. Timeout value is unitless and in seconds. | 60 |
|
||||
| <a id="opt-providers-kubernetesingressnginx-publishservice" href="#opt-providers-kubernetesingressnginx-publishservice" title="#opt-providers-kubernetesingressnginx-publishservice">providers.kubernetesingressnginx.publishservice</a> | Service fronting the Ingress controller. Takes the form 'namespace/name'. | |
|
||||
| <a id="opt-providers-kubernetesingressnginx-publishstatusaddress" href="#opt-providers-kubernetesingressnginx-publishstatusaddress" title="#opt-providers-kubernetesingressnginx-publishstatusaddress">providers.kubernetesingressnginx.publishstatusaddress</a> | Customized address (or addresses, separated by comma) to set as the load-balancer status of Ingress objects this controller satisfies. | |
|
||||
| <a id="opt-providers-kubernetesingressnginx-throttleduration" href="#opt-providers-kubernetesingressnginx-throttleduration" title="#opt-providers-kubernetesingressnginx-throttleduration">providers.kubernetesingressnginx.throttleduration</a> | Ingress refresh throttle duration. | 0 |
|
||||
|
|
|
|||
|
|
@ -84,26 +84,28 @@ additionalArguments:
|
|||
|
||||
## Configuration Options
|
||||
|
||||
| Field | Description | Default | Required |
|
||||
|:----------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------|:---------|
|
||||
| Field | Description | Default | Required |
|
||||
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------|:---------|
|
||||
| <a id="opt-address" href="#opt-address" title="#opt-address">`address`</a> | Define the port, and optionally the hostname, on which to listen for incoming connections and packets.<br /> It also defines the protocol to use (TCP or UDP).<br /> If no protocol is specified, the default is TCP. The format is:`[host]:port[/tcp\|/udp] | - | Yes |
|
||||
| <a id="opt-asDefault" href="#opt-asDefault" title="#opt-asDefault">`asDefault`</a> | Mark the `entryPoint` to be in the list of default `entryPoints`.<br /> `entryPoints`in this list are used (by default) on HTTP and TCP routers that do not define their own `entryPoints` option.<br /> More information [here](#asdefault). | false | No |
|
||||
| <a id="opt-forwardedHeaders-trustedIPs" href="#opt-forwardedHeaders-trustedIPs" title="#opt-forwardedHeaders-trustedIPs">`forwardedHeaders.trustedIPs`</a> | Set the IPs or CIDR from where Traefik trusts the forwarded headers information (`X-Forwarded-*`). | - | No |
|
||||
| <a id="opt-forwardedHeaders-insecure" href="#opt-forwardedHeaders-insecure" title="#opt-forwardedHeaders-insecure">`forwardedHeaders.insecure`</a> | Set the insecure mode to always trust the forwarded headers information (`X-Forwarded-*`).<br />We recommend to use this option only for tests purposes, not in production. | false | No |
|
||||
| <a id="opt-forwardedHeaders-notAppendXForwardedFor" href="#opt-forwardedHeaders-notAppendXForwardedFor" title="#opt-forwardedHeaders-notAppendXForwardedFor">`forwardedHeaders.`<br />`notAppendXForwardedFor`</a> | When set to `true`, Traefik will not append the client's `RemoteAddr` to the `X-Forwarded-For` header. The existing header is preserved as-is. If no `X-Forwarded-For` header exists, none will be added. | false | No |
|
||||
| <a id="opt-http-redirections-entryPoint-to" href="#opt-http-redirections-entryPoint-to" title="#opt-http-redirections-entryPoint-to">`http.redirections.`<br />`entryPoint.to`</a> | The target element to enable (permanent) redirecting of all incoming requests on an entry point to another one. <br /> The target element can be an entry point name (ex: `websecure`), or a port (`:443`). | - | Yes |
|
||||
| <a id="opt-http-redirections-entryPoint-scheme" href="#opt-http-redirections-entryPoint-scheme" title="#opt-http-redirections-entryPoint-scheme">`http.redirections.`<br />`entryPoint.scheme`</a> | The target scheme to use for (permanent) redirection of all incoming requests. | https | No |
|
||||
| <a id="opt-http-redirections-entryPoint-permanent" href="#opt-http-redirections-entryPoint-permanent" title="#opt-http-redirections-entryPoint-permanent">`http.redirections.`<br />`entryPoint.permanent`</a> | Enable permanent redirecting of all incoming requests on an entry point to another one changing the scheme. <br /> The target element, it can be an entry point name (ex: `websecure`), or a port (`:443`). | false | No |
|
||||
| <a id="opt-http-redirections-entryPoint-priority" href="#opt-http-redirections-entryPoint-priority" title="#opt-http-redirections-entryPoint-priority">`http.redirections.`<br />`entryPoint.priority`</a> | Default priority applied to the routers attached to the `entryPoint`. | MaxInt32-1 (2147483646) | No |
|
||||
| <a id="opt-http-encodedCharacters" href="#opt-http-encodedCharacters" title="#opt-http-encodedCharacters">`http.encodedCharacters`</a> | Defines which encoded characters are allowed in the request path. More information [here](#encoded-characters). | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedSlash" href="#opt-http-encodedCharacters-allowEncodedSlash" title="#opt-http-encodedCharacters-allowEncodedSlash">`http.encodedCharacters.`<br />`allowEncodedSlash`</a> | Defines whether requests with encoded slash characters in the path are allowed. | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedBackSlash" href="#opt-http-encodedCharacters-allowEncodedBackSlash" title="#opt-http-encodedCharacters-allowEncodedBackSlash">`http.encodedCharacters.`<br />`allowEncodedBackSlash`</a> | Defines whether requests with encoded back slash characters in the path are allowed. | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedNullCharacter" href="#opt-http-encodedCharacters-allowEncodedNullCharacter" title="#opt-http-encodedCharacters-allowEncodedNullCharacter">`http.encodedCharacters.`<br />`allowEncodedNullCharacter`</a> | Defines whether requests with encoded null characters in the path are allowed. | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedSemicolon" href="#opt-http-encodedCharacters-allowEncodedSemicolon" title="#opt-http-encodedCharacters-allowEncodedSemicolon">`http.encodedCharacters.`<br />`allowEncodedSemicolon`</a> | Defines whether requests with encoded semicolon characters in the path are allowed. | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedPercent" href="#opt-http-encodedCharacters-allowEncodedPercent" title="#opt-http-encodedCharacters-allowEncodedPercent">`http.encodedCharacters.`<br />`allowEncodedPercent`</a> | Defines whether requests with encoded percent characters in the path are allowed. | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedQuestionMark" href="#opt-http-encodedCharacters-allowEncodedQuestionMark" title="#opt-http-encodedCharacters-allowEncodedQuestionMark">`http.encodedCharacters.`<br />`allowEncodedQuestionMark`</a> | Defines whether requests with encoded question mark characters in the path are allowed. | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedHash" href="#opt-http-encodedCharacters-allowEncodedHash" title="#opt-http-encodedCharacters-allowEncodedHash">`http.encodedCharacters.`<br />`allowEncodedHash`</a> | Defines whether requests with encoded hash characters in the path are allowed. | false | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedSlash" href="#opt-http-encodedCharacters-allowEncodedSlash" title="#opt-http-encodedCharacters-allowEncodedSlash">`http.encodedCharacters.`<br />`allowEncodedSlash`</a> | Defines whether requests with encoded slash characters in the path are allowed. | true | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedBackSlash" href="#opt-http-encodedCharacters-allowEncodedBackSlash" title="#opt-http-encodedCharacters-allowEncodedBackSlash">`http.encodedCharacters.`<br />`allowEncodedBackSlash`</a> | Defines whether requests with encoded back slash characters in the path are allowed. | true | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedNullCharacter" href="#opt-http-encodedCharacters-allowEncodedNullCharacter" title="#opt-http-encodedCharacters-allowEncodedNullCharacter">`http.encodedCharacters.`<br />`allowEncodedNullCharacter`</a> | Defines whether requests with encoded null characters in the path are allowed. | true | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedSemicolon" href="#opt-http-encodedCharacters-allowEncodedSemicolon" title="#opt-http-encodedCharacters-allowEncodedSemicolon">`http.encodedCharacters.`<br />`allowEncodedSemicolon`</a> | Defines whether requests with encoded semicolon characters in the path are allowed. | true | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedPercent" href="#opt-http-encodedCharacters-allowEncodedPercent" title="#opt-http-encodedCharacters-allowEncodedPercent">`http.encodedCharacters.`<br />`allowEncodedPercent`</a> | Defines whether requests with encoded percent characters in the path are allowed. | true | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedQuestionMark" href="#opt-http-encodedCharacters-allowEncodedQuestionMark" title="#opt-http-encodedCharacters-allowEncodedQuestionMark">`http.encodedCharacters.`<br />`allowEncodedQuestionMark`</a> | Defines whether requests with encoded question mark characters in the path are allowed. | true | No |
|
||||
| <a id="opt-http-encodedCharacters-allowEncodedHash" href="#opt-http-encodedCharacters-allowEncodedHash" title="#opt-http-encodedCharacters-allowEncodedHash">`http.encodedCharacters.`<br />`allowEncodedHash`</a> | Defines whether requests with encoded hash characters in the path are allowed. | true | No |
|
||||
| <a id="opt-http-encodeQuerySemicolons" href="#opt-http-encodeQuerySemicolons" title="#opt-http-encodeQuerySemicolons">`http.encodeQuerySemicolons`</a> | Enable query semicolons encoding. <br /> Use this option to avoid non-encoded semicolons to be interpreted as query parameter separators by Traefik. <br /> When using this option, the non-encoded semicolons characters in query will be transmitted encoded to the backend.<br /> More information [here](#encodequerysemicolons). | false | No |
|
||||
| <a id="opt-http-sanitizePath" href="#opt-http-sanitizePath" title="#opt-http-sanitizePath">`http.sanitizePath`</a> | Defines whether to enable the request path sanitization.<br /> More information [here](#sanitizepath). | false | No |
|
||||
| <a id="opt-http-maxHeaderBytes" href="#opt-http-maxHeaderBytes" title="#opt-http-maxHeaderBytes">`http.maxHeaderBytes`</a> | Set the maximum size of request headers in bytes. | 1048576 | No |
|
||||
| <a id="opt-http-middlewares" href="#opt-http-middlewares" title="#opt-http-middlewares">`http.middlewares`</a> | Set the list of middlewares that are prepended by default to the list of middlewares of each router associated to the named entry point. <br />More information [here](#httpmiddlewares). | - | No |
|
||||
| <a id="opt-http-tls" href="#opt-http-tls" title="#opt-http-tls">`http.tls`</a> | Enable TLS on every router attached to the `entryPoint`. <br /> If no certificate are set, a default self-signed certificate is generated by Traefik. <br /> We recommend to not use self signed certificates in production. | - | No |
|
||||
| <a id="opt-http-tls-options" href="#opt-http-tls-options" title="#opt-http-tls-options">`http.tls.options`</a> | Apply TLS options on every router attached to the `entryPoint`. <br /> The TLS options can be overidden per router. <br /> More information in the [dedicated section](../../routing/providers/kubernetes-crd.md#kind-tlsoption). | - | No |
|
||||
|
|
@ -219,16 +221,22 @@ it can lead to unsafe routing when the `sanitizePath` option is set to `false`.
|
|||
### Encoded Characters
|
||||
|
||||
You can configure Traefik to control the handling of encoded characters in request paths for security purposes.
|
||||
By default, Traefik rejects requests containing certain encoded characters that could be used in path traversal or other security attacks.
|
||||
By default, Traefik do not reject requests with path containing certain encoded characters that could be used in path traversal or other security attacks.
|
||||
|
||||
!!! warning "Security Considerations"
|
||||
!!! info
|
||||
|
||||
This check is not done against the request query parameters,
|
||||
but only against the request path as defined in [RFC3986 section-3](https://datatracker.ietf.org/doc/html/rfc3986#section-3).
|
||||
|
||||
Allowing certain encoded characters may expose your application to security vulnerabilities.
|
||||
!!! info "Security Considerations"
|
||||
|
||||
When your backend is not fully compliant with [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) and notably decode encoded reserved characters in the requets path,
|
||||
it is recommended to set these options to `false` to avoid split-view situation and helps prevent path traversal attacks or other malicious attempts to bypass security controls.
|
||||
|
||||
Here is the list of the encoded characters that are rejected by default:
|
||||
|
||||
| Encoded Character | Character |
|
||||
|-------------------|-------------------------|
|
||||
| Encoded Character | Character |
|
||||
|------------------------------------------------------------------------------------|-------------------------|
|
||||
| <a id="opt-2f-or-2F" href="#opt-2f-or-2F" title="#opt-2f-or-2F">`%2f` or `%2F`</a> | `/` (slash) |
|
||||
| <a id="opt-5c-or-5C" href="#opt-5c-or-5C" title="#opt-5c-or-5C">`%5c` or `%5C`</a> | `\` (backslash) |
|
||||
| <a id="opt-00" href="#opt-00" title="#opt-00">`%00`</a> | `NULL` (null character) |
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
---
|
||||
title: "Traefik FastProxy Experimental Configuration"
|
||||
description: "This section of the Traefik Proxy documentation explains how to use the new FastProxy option."
|
||||
description: "This section of the Traefik Proxy documentation explains how to use the new FastProxy install configuration option."
|
||||
---
|
||||
|
||||
# Traefik FastProxy Experimental Configuration
|
||||
|
||||
## Overview
|
||||
|
||||
This guide provides instructions on how to configure and use the new experimental `fastProxy` static configuration option in Traefik.
|
||||
The `fastProxy` option introduces a high-performance reverse proxy designed to enhance the performance of routing.
|
||||
This guide provides instructions on how to configure and use the new experimental `fastProxy` install configuration option in Traefik. The `fastProxy` option introduces a high-performance reverse proxy designed to enhance the performance of routing.
|
||||
|
||||
!!! info "Limitations"
|
||||
|
||||
Please note that the new fast proxy implementation does not work with HTTP/2.
|
||||
This means that when a H2C or HTTPS request with [HTTP2 enabled](../routing/services/index.md#disablehttp2) is sent to a backend, the fallback proxy is the regular one.
|
||||
This means that when a H2C or HTTPS request with [HTTP2 enabled](../../routing-configuration/http/load-balancing/service.md#disablehttp2) is sent to a backend, the fallback proxy is the regular one.
|
||||
|
||||
Additionnaly, observability features like tracing and OTEL semconv metrics are not supported for the moment.
|
||||
|
||||
|
|
@ -22,10 +21,10 @@ The `fastProxy` option introduces a high-performance reverse proxy designed to e
|
|||
The `fastProxy` option is currently experimental and subject to change in future releases.
|
||||
Use with caution in production environments.
|
||||
|
||||
### Enabling FastProxy
|
||||
## Enabling FastProxy
|
||||
|
||||
The fastProxy option is a static configuration parameter.
|
||||
To enable it, you need to configure it in your Traefik static configuration
|
||||
The fastProxy option is an install configuration parameter.
|
||||
To enable it, you need to configure it in your Traefik install configuration
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
experimental:
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
title: "Traefik Plugins Experimental Configuration"
|
||||
description: "This section of the Traefik Proxy documentation explains how to use the new Plugins install configuration option."
|
||||
---
|
||||
|
||||
# Traefik Plugins Experimental Configuration
|
||||
|
||||
## Overview
|
||||
|
||||
This guide provides instructions on how to configure and use the new experimental `plugins` install configuration option in Traefik. The `plugins` option introduces a system to extend Traefik capabilities with custom middlewares and providers.
|
||||
|
||||
!!! warning "Experimental"
|
||||
|
||||
The `plugins` option is currently experimental and subject to change in future releases.
|
||||
Use with caution in production environments.
|
||||
|
||||
## Enabling Plugins
|
||||
|
||||
The plugins option is an install configuration parameter.
|
||||
To enable a plugin, you need to define it in your Traefik install configuration
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
experimental:
|
||||
plugins:
|
||||
plugin-name: # The name of the plugin in the routing configuration
|
||||
moduleName: "github.com/github-organization/github-repository" # The plugin module name
|
||||
version: "vX.XX.X" # The version to use
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[experimental.plugins.plugin-name]
|
||||
moduleName = "github.com/github-organization/github-repository" # The plugin module name
|
||||
version = "vX.XX.X" # The version to use
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
# The plugin module name
|
||||
# With plugin-name the name of the plugin in the routing configuration
|
||||
--experimental.plugins.plugin-name.modulename=github.com/github-organization/github-repository
|
||||
--experimental.plugins.plugin-name.version=vX.XX.X # The version to use
|
||||
```
|
||||
|
||||
To learn more about how to add a new plugin to a Traefik instance, please refer to the [developer documentation](https://plugins.traefik.io/install).
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue