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

Make it easy to get the URL of a service. #1139

Closed
iocanel opened this issue Jul 13, 2018 · 2 comments
Closed

Make it easy to get the URL of a service. #1139

iocanel opened this issue Jul 13, 2018 · 2 comments
Assignees
Labels

Comments

@iocanel
Copy link
Member

iocanel commented Jul 13, 2018

We need something like:

client.services().inNamespace("ns").withName("myservice").getURL();

The implementation of the getURL() should be similar with what is provided by KubernetesHelper.getServiceURL(), but it should be implemented cleanly.

It might make sense to have different strategies for doing service -> url. For example when using openshift-client it might make sense to take Routes into consideration. So, I would use java.util.ServiceLoader to dynamically load the providers of this functionality. It also might make sense each provider to have a toggle and a priority assigned to it.

DSL wise we just need to introduce ServiceResource that will work in the same spririt as PodResource etc.

@iocanel
Copy link
Member Author

iocanel commented Jul 16, 2018

@rohanKanojia: following up your question on irc. I think that should have different implementations for each strategy.

  • From Environment Variables
  • From Service NodePort.
  • From Ingress
  • From Route

Then the actual implementation can use the java.util.ServiceLoader to load these implementations.

Each impl can also have a priority and maybe a method to return if the address is public or private.

rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Jul 26, 2018
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Jul 30, 2018
@lordofthejars
Copy link
Contributor

@iocanel yes there should be anorder method to not load them randomly.

rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Jul 31, 2018
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 2, 2018
+ Implemented getUrl() method for service
+ Fixed an arquillian dependency error that comes up while
  running tests in IntelliJ
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 7, 2018
+ Implemented getUrl() method for service
+ Fixed an arquillian dependency error that comes up while
  running tests in IntelliJ
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 20, 2018
+ Implemented getUrl() method for service
+ Fixed an arquillian dependency error that comes up while
  running tests in IntelliJ
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 20, 2018
+ Implemented getUrl() method for service
+ Fixed an arquillian dependency error that comes up while
  running tests in IntelliJ
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 20, 2018
+ Implemented getUrl() method for service
+ Fixed an arquillian dependency error that comes up while
  running tests in IntelliJ
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 20, 2018
+ Implemented getUrl() method for service
+ Fixed an arquillian dependency error that comes up while
  running tests in IntelliJ
rohanKanojia added a commit to rohanKanojia/kubernetes-client that referenced this issue Aug 20, 2018
+ Implemented getUrl() method for service
+ Fixed an arquillian dependency error that comes up while
  running tests in IntelliJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants