Refactor ADC config to use AI rate limiting for /api route
This commit is contained in:
50
adc.yaml
Normal file
50
adc.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
services:
|
||||
- name: apache-service
|
||||
hosts:
|
||||
- commandware.it
|
||||
upstream:
|
||||
name: apache-upstream
|
||||
scheme: http
|
||||
type: roundrobin
|
||||
nodes:
|
||||
- host: apache-service.api7ee.svc.cluster.local
|
||||
port: 80
|
||||
weight: 100
|
||||
routes:
|
||||
- name: apache-route
|
||||
uris:
|
||||
- /*
|
||||
vars:
|
||||
- - uri
|
||||
- "~~"
|
||||
- "^(?!/api)"
|
||||
priority: 1
|
||||
plugins:
|
||||
redirect:
|
||||
http_to_https: true
|
||||
|
||||
- name: nginx-api-service
|
||||
hosts:
|
||||
- commandware.it
|
||||
upstream:
|
||||
name: nginx-upstream
|
||||
scheme: http
|
||||
type: roundrobin
|
||||
nodes:
|
||||
- host: nginx-service.api7ee.svc.cluster.local
|
||||
port: 80
|
||||
weight: 100
|
||||
routes:
|
||||
- name: nginx-api-route
|
||||
uris:
|
||||
- /api
|
||||
- /api/*
|
||||
priority: 10
|
||||
plugins:
|
||||
redirect:
|
||||
http_to_https: true
|
||||
ai-rate-limiting:
|
||||
limit: 100
|
||||
time_window: 60
|
||||
rejected_code: 429
|
||||
limit_strategy: "total_tokens"
|
||||
Reference in New Issue
Block a user