Nomad should not set Consul ServiceAddress / setting ServiceAddress should be configurable #4815
Labels
stage/needs-verification
Issue needs verifying it still exists
theme/consul
theme/discovery
theme/service-discovery/consul
theme/service-discovery
type/enhancement
Projects
Nomad version
Nomad v0.8.4 (dbee1d7d051619e90a809c23cf7e55750900742a)
Operating system and Environment details
Ubuntu 16.04
Issue
When Nomad registers a service in Consul, it always sets the ServiceAddress for that service. This means that the address translation that works with the node address for WAN/LAN addresses will not work for these registered services. There are workarounds when using Consul Template (just use the
.NodeAddress
), but when the services are accessed through DNS, Consul will only provide the ServiceAddress (which is the LAN address), even when the service is being queried from another datacenter.We have consul clusters in multiple regions, and nodes have different WAN and LAN addresses, and sometimes need to be addressed cross-region through DNS. It would be ideal if we could ask Nomad to not set the service address (perhaps in the job file or in the server or client config), so that the node address will be used and translated between WAN/LAN properly.
Reproduction steps
Create two Consul clusters in separate regions (region1 and region2), create a Nomad cluster in one of those regions (region1).
If you query a service in region1 from region2, via DNS, you will get the LAN IP of that service, rather than the translated WAN node address.
Possibly Related Issues
#3629
#2770
The text was updated successfully, but these errors were encountered: