Hi everyone.
I’m trying setup Nomad (v1.4.2) with Traefik proxy and I see a strange behaviour. I don’t know if it’s a bug? But first, let me tell about the situation.
I setup 5 nomad clients, 2 of them have node_class attribute “proxy” where I’m planing to run Traefik. The configuration looks like
job "traefik" {
region = "global"
datacenters = ["saigon"]
type = "system"
constraint {
attribute = "${node.class}"
value = "proxy"
}
group "traefik" {
count = 1
network {
port "http" {
static = 80
}
port "api" {
static = 8081
}
}
service {
name = "traefik"
check {
name = "alive"
type = "tcp"
port = "http"
interval = "10s"
timeout = "2s"
}
}
task "traefik" {
driver = "docker"
config {
image = "traefik:v2.2"
network_mode = "host"
volumes = [
"local/traefik.toml:/etc/traefik/traefik.toml",
]
}
template {
data = <<EOF
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.traefik]
address = ":8081"
[api]
dashboard = true
insecure = true
# Enable Consul Catalog configuration backend.
[providers.consulCatalog]
prefix = "traefik"
exposedByDefault = false
[providers.consulCatalog.endpoint]
address = "10.225.194.167:8500"
scheme = "http"
EOF
destination = "local/traefik.toml"
}
resources {
cpu = 100
memory = 128
}
}
}
}
After submit the job, only 2 client with node class proxy start the instance, but the others seems also try to start that is what I saw in the WEB UI. Can some one help me solve this issue? Thanks so much