kubernetes-ingress icon indicating copy to clipboard operation
kubernetes-ingress copied to clipboard

Scale ratelimit with ingress pods

Open dbaumgarten opened this issue 1 year ago • 3 comments

Proposed changes

Implements #4894

Add a flag (in VS-Policy and in Ingress-Annotations) to enable ratelimit-scaling. If enabled, the configured ratelimit is divided by the number of currently active ingress-pods. This way the total sum of the ratelimit stays constant, even when autoscaling changes the number of nginx-ingress pods.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • [x] I have read the CONTRIBUTING doc
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] I have checked that all unit tests pass after adding my changes
  • [x] I have updated necessary documentation
  • [x] I have rebased my branch onto main
  • [x] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

dbaumgarten avatar Feb 16 '24 12:02 dbaumgarten

Deploy request for nginx-kubernetes-ingress pending review.

Visit the deploys page to approve it

Name Link
Latest commit 5323b23e285842c2ee75e9d9ace40aa23eb97d95

netlify[bot] avatar Feb 16 '24 12:02 netlify[bot]

@shaun-nx What do you think? Does this look fine or are any changes required?

dbaumgarten avatar Mar 11 '24 11:03 dbaumgarten

Just an FYI as this has been lingering for review. The NGINX Plus version of the implementation should get accurate rate limiting across all pods with state sync. That comes with the shared memory zone being configured for the rate limit and then state sharing being enabled.

brianehlert avatar Apr 08 '24 22:04 brianehlert

Rebased on current master and added a commit clarifying the docs about the limitations of this feature.

dbaumgarten avatar May 21 '24 15:05 dbaumgarten

Hi @dbaumgarten, thanks for following through, just an FYI that github actions are not working properly at the moment, that is why the tests are not running. https://www.githubstatus.com/

j1m-ryan avatar May 21 '24 15:05 j1m-ryan