-
Notifications
You must be signed in to change notification settings - Fork 353
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
Custom route-level clusterClientRatelimit in Ingress #1831
Comments
Hello. To add ratelimit to the specific path/route you would either need two ingress definitions for the same backend and host, something like apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: app-login
annotations:
zalando.org/skipper-predicate: Path("/login")
zalando.org/skipper-filter: clusterClientRatelimit("login-ratelimit", 1, "1m")
spec:
rules:
- host: app.example.org
http:
paths:
- backend:
serviceName: app-svc
servicePort: 80
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: app
spec:
rules:
- host: app.example.org
http:
paths:
- backend:
serviceName: app-svc
servicePort: 80 or use Routegroups to define routes explicitly which might be more user-friendly than several ingresses
This is something to improve for us in the docs, the closest thing is https://github.com/zalando/skipper/blob/master/docs/kubernetes/ingress-usage.md#ab-test |
The problem with The general hurdle with path-specific ratelimits and a single ingress is that I think with enough creativity it could be possible to make it work with |
Fixes #1831 Signed-off-by: Alexander Yastrebov <[email protected]>
@AlexanderYastrebov Thanks a bunch. That did the trick. Have a nice day ☀️ |
Fixes #1831 Signed-off-by: Alexander Yastrebov <[email protected]>
Fixes #1831 Signed-off-by: Alexander Yastrebov <[email protected]>
Is there a way in the ingress file to define custom clusterClientRatelimit for specific routes? This is where I'm at atm:
The issue here seems to be that the rate limiter is always on for those two routes. It never relays the requests to our backend when not having made more than 10 reqs within 10 minutes.
I've tried
<loopback>
,<dynamic>
,http://127.0.0.1:4000
, and more. Either I'm just doing it plain wrong (it's been hard for me figuring this out via the docs or open-source code in GH) or ingress is not even made for this case.I hope some can shed some light on this. Thank you!
The text was updated successfully, but these errors were encountered: