Giter Club home page Giter Club logo

Comments (6)

pleshakov avatar pleshakov commented on August 28, 2024 1

We can solve it by solving a general problem of specifying a load balancing method: least_conn, ip_hash, general hash (https://www.nginx.com/resources/admin-guide/load-balancer/#method)

We can have an annotation and a Config map key for that:
nginx.org/default-lb-method / default-lb-method
If it's not set, the default round-robin method will be used.

Additionally, it makes sense to add an annotation that allows specifying a method per service, similar to https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/rewrites.
`nginx.org/lb-method: "serviceName=service1 method=method1[;serviceName=service2 method=method2;...]"

Let me know what you think.

from kubernetes-ingress.

sajal avatar sajal commented on August 28, 2024 1

Will get my hands dirty and attempt to implement annotation and config map setting this week or weekend. For my PoC I simply hardcoded ip_hash; into the template.

from kubernetes-ingress.

sajal avatar sajal commented on August 28, 2024

+1 for nginx.org/default-lb-method . Shall I attempt to implement it? Or wait for design to be settled?

Alternatively, you could look at the service's sessionAffinity to configure per-service lb-method.

"By default, the choice of backend is round robin. Client-IP based session affinity can be selected by setting service.spec.sessionAffinity to "ClientIP" (the default is "None")."

But this only gives you the option between ip_hash and the default round-robin.

from kubernetes-ingress.

pleshakov avatar pleshakov commented on August 28, 2024

@sajal

+1 for nginx.org/default-lb-method . Shall I attempt to implement it? Or wait for design to be settled?

That'd be great if you could add it.

Alternatively, you could look at the service's sessionAffinity to configure per-service lb-method... But this only gives you the option between ip_hash and the default round-robin.

I think it's better to add more options then the two options available with the service session Affinity property.

from kubernetes-ingress.

quasiben avatar quasiben commented on August 28, 2024

Is this still something being developed ?

from kubernetes-ingress.

sajal avatar sajal commented on August 28, 2024

I still need this for a service I need to migrate inside my Kubernetes cluster. However I currently do not have time to work on it for next few weeks.

I will post here when I do begin working on it. In case someone else is working on it in the meantime, please update this thread so we don't duplicate effort.

from kubernetes-ingress.

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.