I have a setup with nomad and consul on my machine.
I start a service with a nomad job and have it registered successfully.
My issue is on IP resolutions:
- in Nomad UI, I can see the IP 10.0.75.1
- in Consul UI, in service discovery, I can see the IP 10.0.75.1
- in consul healthcheck, the IP used is a different one 172.31.194.209
Both IP are good host IPs, but my problem is the service only answer on 10.0.75.1.
My point is not really trying to have that service working as I could workaround the issue by putting a different configuration for it to answer on 171.31.194.209 too.
What I'd like is to understand is how the consul healthcheck resolves its host IP and in my case to a different one than the Nomad/Consul-UIs. Also a way to force that resolution would be great.
Note that the Healthcheck is setup by Nomad with network_mode = host
Some configurations:
CONSUL
{
"ui": true,
"data_dir": "C:\\Users\\foo\\consul\\data",
"client_addr": "10.0.75.1",
"node_name": "foonode",
"server": true,
"bind_addr": "10.0.75.1",
"ports": {
"http": 8500
},
"bootstrap": true,
"bootstrap_expect": 1,
"datacenter": "local",
"node_meta": {
"user": "foo"
}
}
NOMAD
name = "foonode"
bind_addr = "10.0.75.1"
datacenter = "local"
data_dir = "C:\\Users\\foo\\nomad\\data"
server {
enabled = true
bootstrap_expect = 1
}
client {
enabled = true
options {
"driver.raw_exec.enable" = "1"
}
meta {
user = "foo"
}
}
consul {
address = "http://10.0.75.1:8500"
}