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

Discover Kube targets by Endpoints, not Services #304

Merged

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Oct 22, 2020

Fixes #282

This basically duplicates the existing OpenShiftPlatformClient implementation for reuse as the KubeApiPlatformClient. These use two different client libraries for the internal API clients, which also means different library implementations for the various Kubernetes types (Endpoints, Subsets, Ports, etc.). So although these types model the same Kubernetes datatypes, the types themselves are distinct hierarchies, and so the final concrete PlatformClient implementations are also distinct and do not inherit from each other (unfortunately).

This can be tested by setting the CONTAINER_JFR_PLATFORM env var to force the KubeApiPlatformClient into use and then running as usual in CRC. This should result in essentially no noticeable difference from running with the standard OpenShiftPlatformClient. Compared to the previous KubeApiPlatformClient implementation, only ports named jfr-jmx or numbered 9091 should cause ServiceRefs to be listed in the targets list. If a single Service has more than one such port, or if there are multiple Pods (each distinguished by cluster-internal IP address) behind the Service, then there should be near-duplicate ServiceRefs for each of these, differentiated by port number or by IP address.

@andrewazores andrewazores force-pushed the kubernetes-endpoints-discovery branch 3 times, most recently from 2f38ddf to b51e44e Compare October 23, 2020 14:48
@andrewazores andrewazores marked this pull request as ready for review October 23, 2020 15:15
@andrewazores andrewazores requested a review from ebaron October 23, 2020 15:19
@andrewazores andrewazores force-pushed the kubernetes-endpoints-discovery branch from b51e44e to 9dac9b6 Compare October 26, 2020 17:33
Copy link
Member

@ebaron ebaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works as advertised!

@andrewazores andrewazores merged commit 555d097 into cryostatio:main Oct 26, 2020
@andrewazores andrewazores deleted the kubernetes-endpoints-discovery branch October 26, 2020 22:03
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

Successfully merging this pull request may close these issues.

KubeApiPlatformClient should discover via Endpoints, not Services
2 participants