Comments (6)
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.
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.
+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.
+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.
Is this still something being developed ?
from kubernetes-ingress.
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)
- Re-add FIPS related images to tests, image patching & release process HOT 1
- Release NGINX Ingress Controller 3.6.1
- Report NGINX Ingress Controller Configmap Keys HOT 1
- Report BUILD_OS of NGINX Ingress Controller HOT 1
- 3.6.0/3.6.1 nginx ingress controller not working || dial unix /var/lib/nginx/nginx-config-version.sock: connect: no such file or directory HOT 16
- Supported Kubernetes versions table is confusing HOT 2
- AWS EKS Add-on support HOT 1
- POC - Add `ip` as an option to listeners HOT 2
- Add `ipFamily` as an option to listeners HOT 1
- Allow NIC to be presented as an Add-on for AWS EKS clusters HOT 1
- Pin NAP WAF module HOT 2
- POC - Create specific Helm chart for AWS EKS Add-on support
- WAF v5 + NIC Blog post HOT 1
- Move DoS related images from UBI8 to UBI9 HOT 1
- Ingress Controller Path and Rewrites HOT 3
- State explicitly that WAF v5 is currently supported by VS/VSR HOT 1
- Templating nginx.ingress.tmpl proxy_pass not set when backend-protocol annotation is set HOT 5
- Update nginx go client and prometheus common libs HOT 2
- nginx.org/rewrites regular $1 rewrite is not supported HOT 7
- dlopen() "/etc/nginx/modules/ngx_http_js_module.so" failed (/etc/nginx/modules/ngx_http_js_module.so: cannot open shared object file: No such file or directory HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubernetes-ingress.