homelab/traefik-ingress.nomad

112 lines
2.5 KiB
Plaintext
Raw Normal View History

2022-04-24 10:47:41 +00:00
job "traefik-ingress" {
datacenters = ["hetzner"]
type = "service"
group "traefik-ingress" {
network {
mode = "host"
port "http" {
static = 80
host_network = "public"
}
port "https" {
static = 443
host_network = "public"
}
port "admin" {
static = 9080
host_network = "private"
}
}
2022-04-24 20:19:18 +00:00
vault{
policies=["access-tables"]
}
2022-05-12 09:36:04 +00:00
task "traefik-ingress" {
2022-04-24 10:47:41 +00:00
driver = "docker"
service {
name = "traefik"
tags = ["traefik"]
port = "https"
}
service {
name = "traefik-admin"
port = "admin"
tags = [
]
}
config {
image = "traefik"
ports = [
"http",
"https",
"admin"
]
volumes =[
2022-04-24 20:19:18 +00:00
"local/traefik.toml:/etc/traefik/traefik.toml",
"/mnt/diskstation/nomad/traefik/acme.json:/acme.json"
2022-04-24 10:47:41 +00:00
]
}
# vault{
#}
env {
}
2022-04-24 20:19:18 +00:00
template{
data=<<EOH
GANDIV5_API_KEY = "{{with secret "secrets/data/gandi"}}{{.Data.data.API_KEY}}{{end}}"
EOH
destination= "secrets/gandi.env"
env = true
}
2022-04-24 10:47:41 +00:00
template{
data= <<EOH
[entryPoints]
[entryPoints.web]
address = ":80"
2022-05-23 17:48:35 +00:00
[entryPoints.web.http]
[entryPoints.web.http.redirections]
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
2022-04-24 10:47:41 +00:00
[entryPoints.websecure]
address = ":443"
[entryPoints.traefik]
address = ":9080"
[http.middlewares]
[http.middlewares.https-redirect.redirectscheme]
scheme = "https"
[providers.consulCatalog]
exposedByDefault = false
[providers.consulCatalog.endpoint]
address = "10.0.0.1:8500"
[log]
[api]
dashboard = true
insecure = true
[ping]
2022-04-24 20:19:18 +00:00
[certificatesResolvers.myresolver.acme]
email = "vincent@ducamps.win"
storage = "acme.json"
[certificatesResolvers.myresolver.acme.httpChallenge]
entryPoint= "web"
2022-05-13 09:43:07 +00:00
[metrics]
[metrics.prometheus]
2022-04-24 10:47:41 +00:00
EOH
destination = "local/traefik.toml"
env = false
change_mode = "noop"
left_delimiter = "{{{"
right_delimiter = "}}}"
}
2022-05-12 09:36:04 +00:00
resources {
memory = 200
}
2022-04-24 10:47:41 +00:00
}
}
}