Giter Club home page Giter Club logo

Comments (8)

pgressa avatar pgressa commented on June 12, 2024

Yeah, seems like the manual configuration wasn't loaded at all otherwise the manual flag would be true. Please try to not use the list like:

kubernetes:
  client:
    discovery:
      includes:
        - foo-service
      services:
        foo-service:
            port: grpc
            mode: endpoint

from micronaut-kubernetes.

bjor-joh avatar bjor-joh commented on June 12, 2024

Yeah now it's working and it's loading both endpoints. Thanks

However it only seems to send requests to one of them. I was under the impression the default behaviour should be to do round-robin load-balancing between the endpoints. Is there additional config needed for that?

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024

yeah it should do round robin if there are more endpoints. try to configure logging to trace for micronaut-kubernetes.

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024

and thanks I have to fix the documentation

from micronaut-kubernetes.

bjor-joh avatar bjor-joh commented on June 12, 2024

Sorry for a slow reply.
So I tried to enable trace logging for Kubernetes and I can see this.

Building ServiceInstance for serviceId [foo-service] and URI [http://10.0.0.1:50051]
Building ServiceInstance for serviceId [foo-service] and URI [http://10.0.0.2:50051]

So it's discovering all instances. But I enabled debug logging for grpc as well and I can see logs like these

"[id: 0x39d05f67, L:/{ip-and-port-of-calling-service} - R:/10.0.0.1:50051] OUTBOUND DATA: streamId=9 padding=0 endStream=true length=21 bytes=00000000100a0532333934301207535448502d5345"

All the calls I do go towards the IP of a single instance, there are never any calls made towards the other.
So it doesn't seem like there is any load-balancing being performed. 🤔

I can also see this in the logs

"Registering singleton bean io.micronaut.http.client.DefaultLoadBalancerResolver@38f57b3d for type [io.micronaut.http.client.LoadBalancerResolver] using bean key io.micronaut.http.client.DefaultLoadBalancerResolver" 
"Finding candidate beans for type: class io.micronaut.http.client.loadbalance.ServiceInstanceListLoadBalancerFactory"
"Finalized bean definitions candidates: [Definition: io.micronaut.http.client.loadbalance.ServiceInstanceListLoadBalancerFactory]"
"Found concrete candidate [Definition: io.micronaut.http.client.loadbalance.ServiceInstanceListLoadBalancerFactory] for type: io.micronaut.http.client.loadbalance.ServiceInstanceListLoadBalancerFactory "

Shouldn't it pick the DiscoverClientLoadBalancer here?

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024

By default all loadbalancers are RoundRobin kind. However based on the context of execution it may always start with fresh list of service instances. I'll try to look at this. Anyway, if you don't want to use client side loadbalancing, use the discovery mode Service -> https://micronaut-projects.github.io/micronaut-kubernetes/latest/guide/#service-discovery

from micronaut-kubernetes.

pgressa avatar pgressa commented on June 12, 2024

Also if you could please open new issue regarding the load balancing. I'll close this one so as resolved. Just copy your comment into new issue I'll handle rest. Thanks!

from micronaut-kubernetes.

bjor-joh avatar bjor-joh commented on June 12, 2024

Thanks, yes we can close this.

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.