-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Address instead of ServiceAddress? #88
Comments
This vaguely rings a bell but I need to dig through the consul documentation again why that is. For now, I suggest to provide the service address. |
Thanks for your replay. I also try to find the document describe about this behavior but in vain. I would like to help on this topic, please let me know if any clue we can dig into or do any experiment. |
* Use the consul node address if the service did not register an address
The consul documentation for services https://www.consul.io/docs/agent/services.html says that the service address is optional.
I've added a change to use the address field if the ServiceAddress is empty. Could you test whether that works for you? |
I use ServiceAddress for health check and expose an old IIS web application on windows server 12, consul agent host and windows host are different, so if you change ServiceAddress to Address my prod environment will be break. So, is good for me that fabio uses Address only if ServiceAddress is empty. |
@mazhack |
Hi @magiconair, |
I could definitely use the option to select Anyway, for my use case, Here's an example of what I'm seeing in consul's service catalog: [
{
"ID": "11b53a97-489e-1d5f-8af3-91ffc29d903e",
"Node": "node-01.domain.com",
"Address": "192.168.0.1",
"Datacenter": "us-west",
"TaggedAddresses": {
"lan": "192.168.0.1",
"wan": "192.168.0.1"
},
"NodeMeta": {},
"ServiceID": "_nomad-executor-e0a22377-8362-83d8-40e5-ca12c9103150-server-something-urlprefix-something.domain.com/",
"ServiceName": "nomad-ui",
"ServiceTags": [
"prom",
"urlprefix-something.domain.com/"
],
"ServiceAddress": "172.104.a.b",
"ServicePort": 3000,
"ServiceEnableTagOverride": false,
"CreateIndex": 19297,
"ModifyIndex": 19297
},
{
"ID": "b6aece04-f1d0-3811-63d3-2392102b3905",
"Node": "node-02.domain.com",
"Address": "192.168.0.2",
"Datacenter": "us-west",
"TaggedAddresses": {
"lan": "192.168.0.2",
"wan": "192.168.0.2"
},
"NodeMeta": {},
"ServiceID": "_nomad-executor-1ddb350c-7656-e502-50b8-b48f455b645a-server-something-urlprefix-something.domain.com/",
"ServiceName": "nomad-ui",
"ServiceTags": [
"prom",
"urlprefix-something.domain.com/"
],
"ServiceAddress": "172.104.y.z",
"ServicePort": 3000,
"ServiceEnableTagOverride": false,
"CreateIndex": 19296,
"ModifyIndex": 19296
}
] |
Hello,
I'm trying to integrate fabio with my own service with Consul.
I found Consul might not return "ServiceAddress" when we don't set service.address in Consul definition.
It might cause proxy error, because fabio now depends on "ServiceAddress" as the dest of traffic.
For example:
Consul definition WITH "address" attribute:
consul return:
Consul definition WITHOUT "address" attribute:
consul return:
For non-fixed consul definition file in Docker image, could we just leverage Address instead of ServiceAddress? is that possible?
Please advice! thank you! :)
The text was updated successfully, but these errors were encountered: