Skip to content
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

DiscoveryClient returns only the first ServiceInstance #54

Closed
jfgosselin opened this issue Aug 26, 2016 · 3 comments
Closed

DiscoveryClient returns only the first ServiceInstance #54

jfgosselin opened this issue Aug 26, 2016 · 3 comments
Assignees

Comments

@jfgosselin
Copy link

Tried the (version 0.0.16) on K8S v1.2.2 . When try to get the list of ServiceInstance it returns only the first one. I was expected to get all the endpoints for my service.

final List<ServiceInstance> services = discoveryClient.getInstances("myservice");

After some debugging in KubernetesDiscoveryClient it seems that .getSubsets() in List getInstances(String serviceId) returns a list with a single item :

The output looked like this, all the EndpointAddress are under a single EndpointSubset. Is it expected to work like this ?

[EndpointSubset (addresses=[ EndpointAddress(ip=172.17.19.25, targetRef=ObjectReference(apiVersion=null, fieldPath=null, kind=Pod, name=lcds-9a0c92bfe2c7fe9d584ed3d0a503808c-wi0qw, namespace=jfgosselin, resourceVersion=8523390, uid=ffb2f196-63df-11e6-8645-0050568e1a8a, additionalProperties={}), additionalProperties={}), EndpointAddress(ip=172.17.2.16, targetRef=ObjectReference(apiVersion=null, fieldPath=null, kind=Pod, name=lcds-9a0c92bfe2c7fe9d584ed3d0a503808c-i17dj, namespace=jfgosselin, resourceVersion=8069340, uid=ffb33b5e-63df-11e6-8645-0050568e1a8a, additionalProperties={}), additionalProperties={}), EndpointAddress(ip=172.17.28.7, targetRef=ObjectReference(apiVersion=null, fieldPath=null, kind=Pod, name=lcds-9a0c92bfe2c7fe9d584ed3d0a503808c-s01si, namespace=jfgosselin, resourceVersion=8071454, uid=ffb273f0-63df-11e6-bb9c-0050568e4d39, additionalProperties={}), additionalProperties={})], notReadyAddresses=[], ports=[EndpointPort(name=null, port=8888, protocol=TCP, additionalProperties={})], additionalProperties={})]

@iocanel
Copy link
Member

iocanel commented Aug 29, 2016

@jfgosselin: I'll have a look and I'll get back to you shortly.

@iocanel
Copy link
Member

iocanel commented Sep 9, 2016

@jfgosselin: You are right! It doesn't handle correctly subsets with multiple addresses, which is a perfectly valid scenario.

@iocanel iocanel self-assigned this Sep 9, 2016
@iocanel
Copy link
Member

iocanel commented Sep 9, 2016

@jfgosselin: thanks for spotting and debugging :-)

@iocanel iocanel closed this as completed Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants