Nomad: Consul service health check defaults to advertise address

Created on 12 Aug 2016  路  2Comments  路  Source: hashicorp/nomad

Nomad version

Nomad v0.4.0

Operating system and Environment details

Ubuntu Xenial

Issue

The consul services published by nomad set the service address to the advertise address. This is expected behavior, however the health check which is registered against that service is also registered against the service address.

This is unexpected because often times the service address is unreachable from the localhost. Since the Consul agent is expected to run locally, and the default address is on the loopback adapter, it makes sense for the default endpoint of all associated ServiceChecks to be configured against the bind address as opposed to the advertise address. Additionally, the address for the ServiceCheck is not configurable.

Reproduction steps

  1. Install Nomad
  2. Configure Addresses with the interface address
  3. Configure Advertise with unreachable IP
  4. Start Nomad

Registered consul checks will fail against unreachable service address, even though Nomad is healthy.

Suggested Solution

Configure all ServiceChecks with endpoint address and port equal to the bind address (config.Addresses.HTTP and so on)

themdiscovery typbug

Most helpful comment

@diptanu @dadgar do you have any plan to address this, if its not soon enough (we need this before september end), will you be open to a patch from our side?

All 2 comments

@diptanu @dadgar do you have any plan to address this, if its not soon enough (we need this before september end), will you be open to a patch from our side?

Thanks for the PR

Was this page helpful?
0 / 5 - 0 ratings