Skip to content

Commit 42bddf7

Browse files
committed
Re-adds RPS test integration case for agtw
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent 001e7f8 commit 42bddf7

2 files changed

Lines changed: 62 additions & 11 deletions

File tree

pkg/i2gw/emitters/agentgateway/testing/testdata/input/rate_limit.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
44
annotations:
5-
nginx.ingress.kubernetes.io/limit-rpm: "600"
6-
name: ingress-ratelimit-rpm
5+
nginx.ingress.kubernetes.io/limit-rps: "10"
6+
name: ingress-ratelimit-rps
77
namespace: default
88
spec:
99
ingressClassName: nginx
1010
rules:
11-
- host: ratelimit.example.org
11+
- host: ratelimit-rps.example.org
1212
http:
1313
paths:
1414
- backend:
@@ -18,6 +18,20 @@ spec:
1818
number: 80
1919
path: /
2020
pathType: Prefix
21+
---
22+
apiVersion: networking.k8s.io/v1
23+
kind: Ingress
24+
metadata:
25+
annotations:
26+
nginx.ingress.kubernetes.io/limit-rpm: "600"
27+
name: ingress-ratelimit-rpm
28+
namespace: default
29+
spec:
30+
ingressClassName: nginx
31+
rules:
32+
- host: ratelimit-rpm.example.org
33+
http:
34+
paths:
2135
- backend:
2236
service:
2337
name: myservice
@@ -47,4 +61,3 @@ spec:
4761
number: 80
4862
path: /
4963
pathType: Prefix
50-

pkg/i2gw/emitters/agentgateway/testing/testdata/output/rate_limit.yaml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ spec:
1212
name: ratelimit-burst-example-org-http
1313
port: 80
1414
protocol: HTTP
15-
- hostname: ratelimit.example.org
16-
name: ratelimit-example-org-http
15+
- hostname: ratelimit-rpm.example.org
16+
name: ratelimit-rpm-example-org-http
17+
port: 80
18+
protocol: HTTP
19+
- hostname: ratelimit-rps.example.org
20+
name: ratelimit-rps-example-org-http
1721
port: 80
1822
protocol: HTTP
1923
status: {}
@@ -23,11 +27,11 @@ kind: HTTPRoute
2327
metadata:
2428
annotations:
2529
gateway.networking.k8s.io/generator: ingress2gateway-dev
26-
name: ingress-ratelimit-burst-ratelimit-burst-example-org
30+
name: ingress-ratelimit-rps-ratelimit-rps-example-org
2731
namespace: default
2832
spec:
2933
hostnames:
30-
- ratelimit-burst.example.org
34+
- ratelimit-rps.example.org
3135
parentRefs:
3236
- name: nginx
3337
rules:
@@ -46,11 +50,11 @@ kind: HTTPRoute
4650
metadata:
4751
annotations:
4852
gateway.networking.k8s.io/generator: ingress2gateway-dev
49-
name: ingress-ratelimit-rpm-ratelimit-example-org
53+
name: ingress-ratelimit-burst-ratelimit-burst-example-org
5054
namespace: default
5155
spec:
5256
hostnames:
53-
- ratelimit.example.org
57+
- ratelimit-burst.example.org
5458
parentRefs:
5559
- name: nginx
5660
rules:
@@ -61,6 +65,22 @@ spec:
6165
- path:
6266
type: PathPrefix
6367
value: /
68+
status:
69+
parents: []
70+
---
71+
apiVersion: gateway.networking.k8s.io/v1
72+
kind: HTTPRoute
73+
metadata:
74+
annotations:
75+
gateway.networking.k8s.io/generator: ingress2gateway-dev
76+
name: ingress-ratelimit-rpm-ratelimit-rpm-example-org
77+
namespace: default
78+
spec:
79+
hostnames:
80+
- ratelimit-rpm.example.org
81+
parentRefs:
82+
- name: nginx
83+
rules:
6484
- backendRefs:
6585
- name: myservice
6686
port: 80
@@ -99,11 +119,29 @@ spec:
99119
targetRefs:
100120
- group: gateway.networking.k8s.io
101121
kind: HTTPRoute
102-
name: ingress-ratelimit-rpm-ratelimit-example-org
122+
name: ingress-ratelimit-rpm-ratelimit-rpm-example-org
103123
traffic:
104124
rateLimit:
105125
local:
106126
- requests: 600
107127
unit: Minutes
108128
status:
109129
ancestors: null
130+
---
131+
apiVersion: agentgateway.dev/v1alpha1
132+
kind: AgentgatewayPolicy
133+
metadata:
134+
name: ingress-ratelimit-rps
135+
namespace: default
136+
spec:
137+
targetRefs:
138+
- group: gateway.networking.k8s.io
139+
kind: HTTPRoute
140+
name: ingress-ratelimit-rps-ratelimit-rps-example-org
141+
traffic:
142+
rateLimit:
143+
local:
144+
- requests: 10
145+
unit: Seconds
146+
status:
147+
ancestors: null

0 commit comments

Comments
 (0)