Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

[Bug] Kubernetes service discovery does not discover ports #420

Closed
networkop opened this issue Jun 23, 2020 · 3 comments
Closed

[Bug] Kubernetes service discovery does not discover ports #420

networkop opened this issue Jun 23, 2020 · 3 comments
Assignees
Milestone

Comments

@networkop
Copy link
Contributor

What happened: When using k8s service discovery to discover services, ports do not get discovered.

What you expected to happen: pb.Resource for the discovered k8s service to contain svc.Spec.Ports[0].Port

How to reproduce it (as minimally and precisely as possible): create a k8s cluster and use k8s discovery to discover a service. the returned *pb.Resource has an empty Port

Anything else we need to know?: it looks like ports are not set for k8s services at all, not sure if this is intentional or not. There's also an issue with services potentially containing multiple ports and pb.Resource only has a single Port field. Perhaps iterating over ports and creating a new pb.Resource for each unique one could be the right solution?

@manugarg
Copy link
Contributor

@networkop Thanks for reporting this.

Your assessment is right about services discovery not populating the port. This seems like an oversight. For multiple ports case, I think we need to handle multiple ports the same way as endpoints:

resources = append(resources, epi.resources(allFilters.RegexFilters["port"], lister.l)...)

@manugarg manugarg self-assigned this Jun 28, 2020
@manugarg
Copy link
Contributor

I'm working on a change for this.

@manugarg
Copy link
Contributor

manugarg commented Jun 30, 2020

Closing this now. Filed a separate bug for the next release: v0.10.8: #425.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants