I’am learning the site-mesh-capabilities of Nomad and followed the tutorial on Consul Service Mesh | Nomad | HashiCorp Developer.
I adapted my job-description slightly having two dashboard-tasks connecting to the counter-api. I’ve done this to try out the intentions-feature of consul later on.
However I am surprised, that only one of the dashboard-tasks can make a connection to the backend. The other one says that the “counting service” is unreachable. What I am doing wrong? Here’s my job description, I am using Nomad 1.3.5
job "counter7" {
group "backend" {
network {
mode = "bridge"
}
service {
port = "9001"
connect {
sidecar_service {}
}
}
task "api" {
driver = "docker"
config {
image = "hashicorpdev/counter-api:v3"
}
}
}
group "frontend" {
network {
mode = "bridge"
port "http" {
static = 9002
to = 9002
}
}
service {
port = "http"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "counter7-backend"
local_bind_port = 8080
}
}
}
}
}
task "dashboard" {
driver = "docker"
env {
COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_counter7-backend}"
}
config {
image = "hashicorpdev/counter-dashboard:v3"
}
}
}
group "frontend2" {
network {
mode = "bridge"
port "http" {
static = 9002
to = 9002
}
}
service {
port = "http"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "counter7-backend"
local_bind_port = 8080
}
}
}
}
}
task "dashboard2" {
driver = "docker"
env {
COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_counter7-backend}"
}
config {
image = "hashicorpdev/counter-dashboard:v3"
}
}
}
}