I have service and I need to limit the API based on users and organization.
Example : User A and User B belongs same OrgA. Any user can access the API 5 times a day and Organization can access the API 8 times a day.
Service
apiVersion: v1
kind: Service
metadata:
name: kong-my-app
annotations:
kubernetes.io/ingress.class: kong
konghq.com/plugins: rate-limiting-myapp-1, rate-limiting-myapp
labels:
run: kong-my-app
spec:
type: NodePort
ports:
- nodePort: 31687
port: 8200
protocol: TCP
selector:
run: kong-my-app
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: rate-limiting-myapp-1
config:
hour: 8
limit_by: header
header_name: ‘x-org-id’
policy: local
plugin: rate-limiting
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: rate-limiting-myapp
config:
hour: 5
limit_by: header
header_name: ‘x-user-id’
policy: local
plugin: rate-limiting
Service is picking the last plugin provided in the annotation. is it possible to apply same plugin of two variant ? In above example, its picking only rate-limiting-myapp which is the last one in the plugin list. Please help me if we have any other way to do.
is it a limitation in kong rate limit plugin ?. Do we need advanced rate limiter(Enterprise) to get this done ?