Files
nomad-nummer5/_sys/traefik.hcl
Udo Waechter d6dac9bd5c
All checks were successful
continuous-integration/drone/push Build is passing
priorities for jobs
2024-03-25 19:48:27 +01:00

100 lines
1.8 KiB
HCL

job "traefik" {
region = "global"
datacenters = ["nummer5"]
type = "system"
node_pool = "all"
priority = 100
group "traefik" {
#count = 5
constraint {
operator = "distinct_hosts"
value = "true"
}
network {
port "http" {
static = 80
}
port "api" {
static = 81
}
}
service {
name = "traefik"
port = "api"
check {
name = "alive"
type = "tcp"
port = "http"
interval = "120s"
timeout = "2s"
}
check {
name = "alive"
type = "tcp"
port = "api"
interval = "120s"
timeout = "2s"
}
tags = [
"traefik.enable=true",
"traefik.http.routers.traefik.rule=Host(`traefik.service.nr5`)",
]
}
task "traefik" {
driver = "podman"
config {
image = "docker.io/library/traefik:latest"
network_mode = "host"
volumes = [
"local/traefik.toml:/etc/traefik/traefik.toml",
]
}
template {
data = <<EOF
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.traefik]
address = ":81"
[api]
dashboard = true
insecure = true
# Enable Consul Catalog configuration backend.
[providers.consulCatalog]
prefix = "traefik"
exposedByDefault = false
[providers.consulCatalog.endpoint]
address = "127.0.0.1:8500"
scheme = "http"
[metrics]
[metrics.prometheus]
buckets = [0.1,0.3,1.2,5.0]
addServicesLabels = true
EOF
destination = "local/traefik.toml"
}
resources {
cpu = 50
memory = 64
}
}
}
}