Hi,
I am very new to Nomad and trying to spun off my very first job. My integration with Consul and Treafik works fine except for all my jobs seems to be running on just one node. I want to distribute it among all clients.
Here is my sample job definition.
job "demo-webapp" {
datacenters = ["dc1"]
group "demo" {
scaling {
min = 3
max = 10
enabled = true
}
network {
port "http"{
to = -1
}
}
service {
name = "demo-webapp"
port = "http"
tags = [
"traefik.enable=true",
#"traefik.http.routers.http.rule=Host(`demo1.traefik.local`)",
"traefik.http.routers.http.rule=Path(`/hello`)",
]
check {
type = "http"
path = "/"
interval = "2s"
timeout = "2s"
}
}
task "server" {
env {
PORT = "${NOMAD_PORT_http}"
NODE_IP = "${NOMAD_IP_http}"
}
driver = "docker"
config {
image = "hashicorp/demo-webapp-lb-guide"
ports = ["http"]
}
}
}
}
Here is what m job assignments look like when I run it
Also is there anyway, I can run Traefik on all client nodes? As a laod-balancer, I would like to run it on all clients and new clients as they are being added in future.