[ConsulResolver] For service location, use Node.Address if Service.Address is empy
See original GitHub issueDescribe the bug
When using the ConsulResolver, if a service is registered with Consul which doesn’t have a manually specified location Address
(via the related consul.d
service config file) then Ambassador will not be able to route to this service.
The Consul docs state that any app (Ambassador in this case) consuming the Consul API service endpoint should use the Node.Address
field location details if the Service.Address
field is empty. At the moment Ambassador doesn’t do this
Example of empty Service.Address field from Consul API call:
[{"ID":"bdc9c542-5101-dfdf-8dbc-524591e8e2d0","Node":"shopfront-instance-0","Address":"10.128.0.9","Datacenter":"dc1","TaggedAddresses":{"lan":"10.128.0.9","wan":"10.128.0.9"},"NodeMeta":{"consul-network-segment":""},"ServiceKind":"","ServiceID":"shopfront","ServiceName":"shopfront","ServiceTags":["springboot"],"ServiceAddress":"","ServiceWeights":{"Passing":1,"Warning":1},"ServiceMeta":{},"ServicePort":80,"ServiceEnableTagOverride":false,"ServiceProxyDestination":"","ServiceProxy":{},"ServiceConnect":{},"CreateIndex":8409,"ModifyIndex":8409}]
To Reproduce Enable ConsulResolver within Ambassador and configure a Mapping to a Consul service that does not have the Address configuration specified.
Expected behavior
If Ambassador retrieves an empty Service.Address
when querying the Consul API for the service location, then Ambassador should use the location details from Node.Address
.
Versions (please complete the following information):
- Ambassador: 0.73.0 (but presumedly earlier versions, too)
- Kubernetes environment: GKE
- Version: 1.13.7-gke.8
Additional context Chatted about this on Datawire Internal Slack 9am EDT 24 July 2019
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (2 by maintainers)
Top GitHub Comments
I believe this is still not fixed but this is quite annoying for anyone using the ConsulResolver. I will have some holidays soon, I may try to look about a fix for this issue
Not stale.