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

Limit active application sessions to a pod/container #1395

Closed
deepakkhetwal opened this issue Feb 18, 2021 · 9 comments
Closed

Limit active application sessions to a pod/container #1395

deepakkhetwal opened this issue Feb 18, 2021 · 9 comments
Labels
proposal An issue that proposes a feature request stale Pull requests/issues with no activity

Comments

@deepakkhetwal
Copy link

Is your feature request related to a problem? Please describe.
We are deploying an asp.net application that makes heavy use of in-process IIS sessions in on-premise Kubernetes environment. We would like to limit the number of active asp.net application sessions, residing in a container/pod at a given point of time based on some configuration. So let’s say, If I have configured 5 active sessions to be allowed to be in a kubernetes container/pod at a given point of time, then for the 6th session, nginx ingress controller should be able to route the request to new available pod/container(also taking into consideration the new pods limit on active number of sessions). Please advise, how it can be achieved using nginx ingress controller or some other means. Active/established sessions would continue to route to their "assigned" pod (session affinity).

Describe the solution you'd like
may be through ingress annotations

Describe alternatives you've considered
Don't have any alternative at the moment

@pleshakov
Copy link
Contributor

Hi @deepakkhetwal

What is an established session? Is it a connection?

@deepakkhetwal
Copy link
Author

deepakkhetwal commented Feb 19, 2021 via email

@pleshakov
Copy link
Contributor

Hi @deepakkhetwal

apologies for the delay

it is not possible to support that use case: NGINX can't determine which pods has fewer sessions and it cannot limit sessions per pod.

however, it is possible to achieve persistence - each session will be tight to one pod. That is possible via nginx.org/lb-method annotation with iphash load balancing method - in this case requests from the same IP will be proxied to the same backend pod. See https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-annotations/ Or, using session persistence with NGINX Plus -- https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/session-persistence -- which is based on a session cookie which NGINX Plus can issue.

@deepakkhetwal
Copy link
Author

deepakkhetwal commented Mar 4, 2021 via email

@pleshakov
Copy link
Contributor

Hi @deepakkhetwal

I don't think it would be possible to customize NGINX to support your use case.

@deepakkhetwal
Copy link
Author

@pleshakov I was looking at #267 . HA proxy has drain support. do you have something like that?

@pleshakov
Copy link
Contributor

pleshakov commented Mar 6, 2021

@deepakkhetwal unfortunately, we don't support that

@ogarrett ogarrett added the proposal An issue that proposes a feature request label Mar 11, 2021
@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label May 11, 2021
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal An issue that proposes a feature request stale Pull requests/issues with no activity
Projects
None yet
Development

No branches or pull requests

3 participants