1
1
%%LOGO%%
2
2
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.
4
4
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.
6
6
7
7
Pointing Traefik at your orchestrator should be the * only* configuration step you need.
8
8
9
- # Traefik v2 - Example usage
9
+ ## Traefik v3 - Example usage
10
10
11
- Enable ` docker ` provider and web UI:
11
+ Enable ` docker ` provider and dashboard UI:
12
12
13
13
``` yml
14
14
# # traefik.yml
@@ -23,108 +23,112 @@ api:
23
23
insecure : true
24
24
` ` `
25
25
26
- Start Traefik:
26
+ Start Traefik v3 :
27
27
28
- ` ` ` bash
28
+ ` ` ` sh
29
29
docker 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
33
33
```
34
34
35
- Start a backend server, named ` test ` :
35
+ Start a backend server using the ` traefik/whoami ` image :
36
36
37
- ``` bash
37
+ ``` sh
38
38
docker run -d --name test traefik/whoami
39
39
```
40
40
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 ` :
42
42
43
43
``` console
44
- # $ curl --header ' Host:test.docker.localhost' ' http://localhost:80/'
45
44
$ curl test.docker.localhost
46
- Hostname: 390a880bdfab
45
+ Hostname: 0693100b16de
47
46
IP: 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
49
50
GET / HTTP/1.1
50
51
Host: test.docker.localhost
51
- User-Agent: curl/7.65.3
52
+ User-Agent: curl/8.7.1
52
53
Accept: */*
53
54
Accept-Encoding: gzip
54
- X-Forwarded-For: 172.17.0 .1
55
+ X-Forwarded-For: 192.168.215 .1
55
56
X-Forwarded-Host: test.docker.localhost
56
57
X-Forwarded-Port: 80
57
58
X-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
60
61
```
61
62
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:
63
64
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.
65
66
66
- # Traefik v1 - Example usage
67
+ ![ Dashboard UI ] ( https://raw.githubusercontent.com/traefik/traefik/v3.2/docs/content/assets/img/webui-dashboard.png )
67
68
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
69
70
70
- ``` toml
71
- # # traefik.toml
71
+ Enable ` docker ` provider and dashboard UI:
72
72
73
- # API and dashboard configuration
74
- [ api ]
73
+ ``` yml
74
+ # # traefik.yml
75
75
76
76
# 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
79
84
` ` `
80
85
81
- Start Traefik:
86
+ Start Traefik v2 :
82
87
83
- ``` bash
88
+ ` ` ` sh
84
89
docker 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 \
86
91
-v /var/run/docker.sock:/var/run/docker.sock \
87
- traefik:v1.7
92
+ traefik:v2.11
88
93
```
89
94
90
- Start a backend server, named ` test ` :
95
+ Start a backend server using the ` traefik/whoami ` image :
91
96
92
- ``` bash
97
+ ``` sh
93
98
docker run -d --name test traefik/whoami
94
99
```
95
100
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 ` :
97
102
98
103
``` 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
102
106
IP: 127.0.0.1
103
- IP: ::1
104
107
IP: 172.17.0.3
105
- IP: fe80::42:acff:fe11:3
106
108
GET / HTTP/1.1
107
109
Host: test.docker.localhost
108
- User-Agent: curl/7.35.0
110
+ User-Agent: curl/7.65.3
109
111
Accept: */*
110
112
Accept-Encoding: gzip
111
113
X-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
113
116
X-Forwarded-Proto: http
114
- X-Forwarded-Server: f2e05c433120
117
+ X-Forwarded-Server: 7e073cb54211
118
+ X-Real-Ip: 172.17.0.1
115
119
```
116
120
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.
118
124
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 )
120
126
121
- # Documentation
127
+ ## Documentation
122
128
123
129
You can find the complete documentation:
124
130
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 )
127
133
128
134
A 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