Use bind address for consul healtchecks in nomad client too

This commit is contained in:
Evan Gilman 2016-08-16 12:32:53 -07:00 committed by Alex Dadgar
parent c0ff732513
commit 06909d2465
1 changed files with 3 additions and 0 deletions

View File

@ -521,6 +521,9 @@ func (a *Agent) setupClient() error {
},
},
}
if a.config.Addresses.HTTP != "" && a.config.Addresses.HTTP != "0.0.0.0" {
httpServ.Checks[0].PortLabel = net.JoinHostPort(a.config.Addresses.HTTP, strconv.Itoa(a.config.Ports.HTTP))
}
a.consulSyncer.SetServices(consul.ClientDomain, map[consul.ServiceKey]*structs.Service{
consul.GenerateServiceKey(httpServ): httpServ,
})