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

Kubernetes Namespace Service Discovery #311

Closed
shakeeb-upstart opened this issue Sep 24, 2024 · 10 comments · Fixed by #313
Closed

Kubernetes Namespace Service Discovery #311

shakeeb-upstart opened this issue Sep 24, 2024 · 10 comments · Fixed by #313

Comments

@shakeeb-upstart
Copy link
Contributor

Hi, can we add a new helper method in the "KubernetesApiServiceDiscovery" class, to lookup services in a different namespace than the default provided in the configurations. I am trying to lookup a service that's in a different Kubernetes namespace.

@raboof
Copy link
Member

raboof commented Sep 24, 2024

That makes sense to me. Perhaps we could add a constructor to KubernetesApiServiceDiscovery that you can provide your own org.apache.pekko.discovery.kubernetes.Settings-like object to instead of relying on the one from the system - would that work in your case?

@shakeeb-upstart
Copy link
Contributor Author

Yeah that would work, I was only thinking of podNamespace and overloading it to a separate method, but having Settings will give us ability to configure the other options as well

@raboof
Copy link
Member

raboof commented Sep 24, 2024

Nice! Would you be up for the challenge of contributing this improvement?

@shakeeb-upstart
Copy link
Contributor Author

Yes sure

@shakeeb-upstart
Copy link
Contributor Author

I cannot make changes to the constructor, It has to abide by the ServiceDiscovery constructor for 'DynamicAccess'.

@raboof
Copy link
Member

raboof commented Sep 24, 2024

would it be possible to have two constructors, one like the original for 'DynamicAccess' and one that takes a custom Settings?

@shakeeb-upstart
Copy link
Contributor Author

I tried with defining 'apply' method in the companion object but it doesn't work.

@shakeeb-upstart
Copy link
Contributor Author

I think this will do, given the lookup is in the same Kubernetes cluster

@raboof
Copy link
Member

raboof commented Sep 24, 2024

I tried with defining 'apply' method in the companion object but it doesn't work.

Perhaps if you add this to the class instead of creating an apply method?

  def this(system: ActorSystem) = {
    this(Settings(system))(system)
  }

@shakeeb-upstart
Copy link
Contributor Author

Yup that worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants