Giter Club home page Giter Club logo

Comments (9)

pgressa avatar pgressa commented on June 12, 2024 1

sure sure, that was my idea, I meant mandatory in case you want to discovery service from other then app configured namespace.

from micronaut-kubernetes.

jaksah avatar jaksah commented on June 12, 2024 1

How would using # as separator propagate to the client configuration? Lets say you would like to set the read timeout for the client

micronaut.http.services.my-ns#my-service.read-timeout=PT5S

Thinking that # is considered a comment in .yaml and .properties files.

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024 1

@jaksah we spoke about this with @alvarosanchez and at this moment we agreed that the namespace will be part of configuration like:

kubernetes:
  client:
    discovery:
      services:
        my-service:
          namespace: my-ns

from micronaut-kubernetes.

alvarosanchez avatar alvarosanchez commented on June 12, 2024

It shouldn't be too difficult to change https://github.com/micronaut-projects/micronaut-kubernetes/blob/master/kubernetes-discovery-client/src/main/java/io/micronaut/kubernetes/discovery/KubernetesDiscoveryClient.java#L84 to search in all namespaces. PRs welcomed

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024

@alvarosanchez imho this could potentially end up in lot of 403s if micronaut service account is not authorised to get Services. But by default it could do the job, but I would extend it with namespace filtering, similarly like it's for service filtering. Anyway, in my opinion we should also distinguish service namespaces in the annotation liek @Client('<namespace>.<service-name>').

from micronaut-kubernetes.

alvarosanchez avatar alvarosanchez commented on June 12, 2024

The 403s can also happen even for the default namespace. I expect someone wanting to call services across namespaces to understand it needs permissions. Hence, I wrote https://micronaut-projects.github.io/micronaut-kubernetes/latest/guide/#_kubernetes_api_authentication. It should be a matter of explaining it there.

Regarding namespace filtering, I see it problematic. The Kubernetes API lets you search either within a concrete namespace, or all. If you were to have includes/excludes, you would need to make several API calls to retrieve the list of namespaces first, then for each retrieve the list of services. And the service discovery is refreshed every 30 seconds.

A better option would be specifying the namespace in the annotation as you suggested (I'd rather avoid using a dot as separator, so maybe @Client("<namespace>#<service-name>")). That way you only search on that namespace.

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024

Yeah, if we would make it like mandatory to define the namespace in the annotation to distinguish the target namespace, then the filtering is useless. 👍

from micronaut-kubernetes.

alvarosanchez avatar alvarosanchez commented on June 12, 2024

It doesn't need to be mandatory though. One could have @Client("my-service") (which would target the default namespace) and @Client("my-ns#my-service")

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024

Closing addressed in #191

from micronaut-kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.