-
Notifications
You must be signed in to change notification settings - Fork 0
/
traefik.nomad
108 lines (86 loc) · 1.85 KB
/
traefik.nomad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
job "traefik" {
region = "global"
datacenters = ["dc1"]
type = "service"
group "svc" {
count = 1
network {
mode = "host"
port "http" {
static = 80
}
port "api" {
static = 8080
}
port "metrics" {
static = 8082
}
port "grpc" {
static = 7233
}
}
service {
name = "traefik-entrypoint-grpc"
port = "grpc"
check {
type = "tcp"
interval = "10s"
timeout = "5s"
}
}
service {
name = "traefik-dashboard"
tags = [
"traefik.enable=true",
"traefik.http.routers.dashboard.rule=Host(`traefik.localhost`)",
"traefik.http.routers.dashboard.service=api@internal",
"traefik.http.routers.dashboard.entrypoints=web",
]
port = "http"
check {
type = "tcp"
interval = "10s"
timeout = "5s"
}
}
task "loadbalancer" {
driver = "docker"
config {
network_mode = "host"
image = "traefik:v2.6.1"
ports = ["http", "api", "metrics", "grpc"]
volumes = [
"local/traefik.toml:/etc/traefik/traefik.toml",
]
}
template {
data = <<EOF
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.metrics]
address = ":8082"
[entryPoints.grpc]
address = ":7233"
[api]
dashboard = true
insecure = true
[log]
level = "DEBUG"
# Enable Consul Catalog configuration backend.
[providers.consulCatalog]
prefix = "traefik"
exposedByDefault = false
[providers.consulCatalog.endpoint]
address = "http://localhost:8500"
scheme = "http"
EOF
destination = "local/traefik.toml"
}
resources {
cpu = 100
memory = 128
}
}
}
}