I'm using rate limiting plugin by Kong, I'm using the declarative mode with a config file like:
_format_version: "3.0"
_transform: true
services:
- name: service1
url: https://example.com/api/endpoint1
routes:
- name: route1
paths:
- /path1
- name: service2
url: https://example.com/api/endpoint2
routes:
- name: route2
paths:
- /path2
plugins:
- name: rate-limiting
service: service1
config:
second: 5
policy: local
limit_by: service
- name: rate-limiting
service: service2
config:
second: 5
policy: local
limit_by: service
for the rate limiting plugin I'm also using the attribute limit_by: service, because I want to rate limit all the requests arriving for that service not just by grouping by IP.
I have more or less 12 endpoints like the above conf. and for every endpoint I want to apply, up to now, the same rate limit, every time there is the need to add a block like that:
- name: rate-limiting
service: serviceN
config:
second: 5
policy: local
limit_by: service
is it possible to specify a rate-limit for every service globally but still groupyng by the service name?
so it seems that every time we need to add the limit_by property otherwise it should group requests by IP.
Is there any way to do it without repeating every tie the plugin block?
Thanks