Traefik rate limiting por URL/host with custom value

Hi All,

We are using Traefik on Kubernetes as ingress controller
We would like to uptake Rate limiting capability

But not sure how to implement below scenario

We have wild card routing URLs like

ingress:
hosts:

  • " .identity.env12.ociqa1.c9dev1.oc9qadev.com"
  • " .identity.uscom-central-1.env12.ociqa1.c9dev1.oc9qadev.com"

We are applying rate limiting in annotation like

traefik.ingress.kubernetes.io/rate-limit: |
extractorfunc: request.host
rateset:
tenant:
period: 1s
average: 100
burst: 20

This gets applied on all the host as single value

we want to introduce custom rate limiting per host for example

I heard something rate limit per frontend

can someone provide guidance how to achieve custom rate limit wild card or 2 different rate limit are not supported

Hello @lokesh12002,

You can configure two separate ingress objects with the hosts separated, and configure the annotations separately. That will create two frontends with separate rate limiting configurations.

This will allow you more fine-grained control.

You cannot configure separate hosts separately in the same ingress object.

Thanks for the response

Does it means if i need to provide custom rate limiting per host then i need to create those many ingress objects ?
Is it a scalable model ?
For ex - baseline host is wildcard
*.identity.env12.ociqa1.c9dev1.oc9qadev.com

Then i can override default to priviledged one like
test1.identity.env12.ociqa1.c9dev1.oc9qadev.com
test2.identity.env12.ociqa1.c9dev1.oc9qadev.com

I tried this and it worked where i need to define 1 ingress object per host for custom or varying limit for these hosts

Not sure if there is some negative impact due to these many ingress objects