11%%LOGO%%
22
3- [ Traefik] ( https://traefik.io ) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy.
3+ [ Traefik] ( https://traefik.io ) is a modern HTTP reverse proxy and ingress controller that makes deploying microservices easy.
44
5- Traefik integrates with your existing infrastructure components ([ Docker] ( https://www.docker.com/ ) , [ Swarm mode ] ( https://docs.docker.com/engine/swarm/ ) , [ Kubernetes ] ( https://kubernetes.io ) , [ Marathon ] ( https://mesosphere.github. io/marathon/ ) , [ Consul ] ( https://www.consul .io/ ) , [ Etcd ] ( https://coreos.com/etcd/ ) , [ Rancher ] ( https://rancher.com ) , [ Amazon ECS] ( https://aws.amazon.com/ecs ) , ...) and configures itself automatically and dynamically.
5+ Traefik integrates with your existing infrastructure components ([ Kubernetes ] ( https://kubernetes.io ) , [ Docker] ( https://www.docker.com/ ) , [ Swarm] ( https://docs.docker.com/engine/swarm/ ) , [ Consul ] ( https://www.consul. io/ ) , [ Nomad ] ( https://www.nomadproject .io/ ) , [ etcd ] ( https://coreos.com/etcd/ ) , [ Amazon ECS] ( https://aws.amazon.com/ecs ) , ...) and configures itself automatically and dynamically.
66
77Pointing Traefik at your orchestrator should be the * only* configuration step you need.
88
9- # Traefik v2 - Example usage
9+ ## Traefik v3 - Example usage
1010
11- Enable ` docker ` provider and web UI:
11+ Enable ` docker ` provider and dashboard UI:
1212
1313``` yml
1414# # traefik.yml
@@ -23,108 +23,112 @@ api:
2323 insecure : true
2424` ` `
2525
26- Start Traefik:
26+ Start Traefik v3 :
2727
28- ` ` ` bash
28+ ` ` ` sh
2929docker run -d -p 8080:8080 -p 80:80 \
30- -v $PWD/traefik.yml:/etc/traefik/traefik.yml \
31- -v /var/run/docker.sock:/var/run/docker.sock \
32- traefik:v2.5
30+ -v $PWD/traefik.yml:/etc/traefik/traefik.yml \
31+ -v /var/run/docker.sock:/var/run/docker.sock \
32+ traefik:v3
3333```
3434
35- Start a backend server, named ` test ` :
35+ Start a backend server using the ` traefik/whoami ` image :
3636
37- ``` bash
37+ ``` sh
3838docker run -d --name test traefik/whoami
3939```
4040
41- And finally, you can access to your ` whoami ` server throught Traefik, on the domain name ` test.docker.localhost ` :
41+ Access the whoami service through Traefik via the defined rule ` test.docker.localhost ` :
4242
4343``` console
44- # $ curl --header ' Host:test.docker.localhost' ' http://localhost:80/'
4544$ curl test.docker.localhost
46- Hostname: 390a880bdfab
45+ Hostname: 0693100b16de
4746IP: 127.0.0.1
48- IP: 172.17.0.3
47+ IP: ::1
48+ IP: 192.168.215.4
49+ RemoteAddr: 192.168.215.3:57618
4950GET / HTTP/1.1
5051Host: test.docker.localhost
51- User-Agent: curl/7.65.3
52+ User-Agent: curl/8.7.1
5253Accept: */*
5354Accept-Encoding: gzip
54- X-Forwarded-For: 172.17.0 .1
55+ X-Forwarded-For: 192.168.215 .1
5556X-Forwarded-Host: test.docker.localhost
5657X-Forwarded-Port: 80
5758X-Forwarded-Proto: http
58- X-Forwarded-Server: 7e073cb54211
59- X-Real-Ip: 172.17.0 .1
59+ X-Forwarded-Server: 8a37fd4f35fb
60+ X-Real-Ip: 192.168.215 .1
6061```
6162
62- The web UI [ http://localhost:8080 ] ( http://localhost:8080 ) will give you an overview of the routers, services, and middlewares.
63+ Access the Traefik Dashboard:
6364
64- ![ Web UI ] ( https ://raw.githubusercontent.com/traefik/traefik/v2.5/docs/content/assets/img/webui- dashboard.png )
65+ Open your web browser and navigate to ` http ://localhost:8080 ` to access the Traefik dashboard. This will provide an overview of routers, services, and middlewares.
6566
66- # Traefik v1 - Example usage
67+ ![ Dashboard UI ] ( https://raw.githubusercontent.com/traefik/traefik/v3.2/docs/content/assets/img/webui-dashboard.png )
6768
68- Grab a [ sample configuration file ] ( https://raw.githubusercontent.com/traefik/traefik/v1.7/traefik.sample.toml ) and rename it to ` traefik.toml ` . Enable ` docker ` provider and web UI:
69+ ## Traefik v2 - Example usage
6970
70- ``` toml
71- # # traefik.toml
71+ Enable ` docker ` provider and dashboard UI:
7272
73- # API and dashboard configuration
74- [ api ]
73+ ``` yml
74+ # # traefik.yml
7575
7676# Docker configuration backend
77- [docker ]
78- domain = " docker.localhost"
77+ providers :
78+ docker :
79+ defaultRule : " Host(`{{ trimPrefix `/` .Name }}.docker.localhost`)"
80+
81+ # API and dashboard configuration
82+ api :
83+ insecure : true
7984` ` `
8085
81- Start Traefik:
86+ Start Traefik v2 :
8287
83- ``` bash
88+ ` ` ` sh
8489docker run -d -p 8080:8080 -p 80:80 \
85- -v $PWD /traefik.toml :/etc/traefik/traefik.toml \
90+ -v $PWD/traefik.yml :/etc/traefik/traefik.yml \
8691-v /var/run/docker.sock:/var/run/docker.sock \
87- traefik:v1.7
92+ traefik:v2.11
8893```
8994
90- Start a backend server, named ` test ` :
95+ Start a backend server using the ` traefik/whoami ` image :
9196
92- ``` bash
97+ ``` sh
9398docker run -d --name test traefik/whoami
9499```
95100
96- And finally, you can access to your ` whoami ` server throught Traefik, on the domain name ` {containerName}.{configuredDomain} ` ( ` test.docker.localhost ` ) :
101+ Access the whoami service through Traefik via the defined rule ` test.docker.localhost ` :
97102
98103``` console
99- # $ curl --header ' Host:test.docker.localhost' ' http://localhost:80/'
100- $ curl ' http://test.docker.localhost'
101- Hostname: 117c5530934d
104+ $ curl test.docker.localhost
105+ Hostname: 390a880bdfab
102106IP: 127.0.0.1
103- IP: ::1
104107IP: 172.17.0.3
105- IP: fe80::42:acff:fe11:3
106108GET / HTTP/1.1
107109Host: test.docker.localhost
108- User-Agent: curl/7.35.0
110+ User-Agent: curl/7.65.3
109111Accept: */*
110112Accept-Encoding: gzip
111113X-Forwarded-For: 172.17.0.1
112- X-Forwarded-Host: 172.17.0.3:80
114+ X-Forwarded-Host: test.docker.localhost
115+ X-Forwarded-Port: 80
113116X-Forwarded-Proto: http
114- X-Forwarded-Server: f2e05c433120
117+ X-Forwarded-Server: 7e073cb54211
118+ X-Real-Ip: 172.17.0.1
115119```
116120
117- The web UI [ http://localhost:8080 ] ( http://localhost:8080 ) will give you an overview of the frontends/backends and also a health dashboard.
121+ Access the Traefik Dashboard:
122+
123+ Open your web browser and navigate to ` http://localhost:8080 ` to access the Traefik dashboard. This will provide an overview of routers, services, and middlewares.
118124
119- ![ Web UI Providers ] ( https://raw.githubusercontent.com/traefik/traefik/v1.7 /docs/img/web.frontend .png )
125+ ![ Dashboard UI] ( https://raw.githubusercontent.com/traefik/traefik/v2.0 /docs/content/assets/ img/webui-dashboard .png )
120126
121- # Documentation
127+ ## Documentation
122128
123129You can find the complete documentation:
124130
125- - for [ v2 .x] ( https://doc.traefik.io/traefik/ )
126- - for [ v1.7 ] ( https://doc.traefik.io/traefik/v1.7 )
131+ - for [ v3 .x] ( https://doc.traefik.io/traefik/ )
132+ - for [ v2.11 ] ( https://doc.traefik.io/traefik/v2.11 )
127133
128134A community support is available at [ https://community.traefik.io ] ( https://community.traefik.io )
129-
130- A collection of contributions around Traefik can be found at [ https://awesome.traefik.io ] ( https://awesome.traefik.io ) .
0 commit comments