Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 76ff532

Browse files
authored
rate-limiting: add spec to UpstreamTrafficSetting CRD (#4803)
Adds the local rate limiting spec to the UpstreamTrafficSetting CRD. Part of #2018 Signed-off-by: Shashank Ram <[email protected]>
1 parent 47c06ab commit 76ff532

File tree

1 file changed

+139
-0
lines changed

1 file changed

+139
-0
lines changed

cmd/osm-bootstrap/crds/policy_upstream_traffic_setting.yaml

+139
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,145 @@ spec:
8686
description: Maximum number of parallel retries allowed.
8787
type: integer
8888
minimum: 0
89+
rateLimit:
90+
description: Rate limiting policy.
91+
type: object
92+
properties:
93+
local:
94+
description: Policy responsible for rate limiting traffic at the upstream service.
95+
type: object
96+
properties:
97+
tcp:
98+
description: TCP level local rate limiting to limit the number of connections per unit of time.
99+
type: object
100+
properties:
101+
connections:
102+
description: Connections defines the number of connections allowed per unit of time before
103+
rate limiting occurs.
104+
type: integer
105+
minimum: 1
106+
unit:
107+
description: Unit defines the period of time within which connections over the limit will be
108+
rate limited. Valid values are "second", "minute" and "hour".
109+
type: string
110+
enum:
111+
- second
112+
- minute
113+
- hour
114+
burst:
115+
description: Burst (optional) defines the number of connections above the baseline rate that are allowed
116+
in a short period of time.
117+
type: integer
118+
http:
119+
description: HTTP level local rate limiting to limit the number of requests per unit of time.
120+
type: object
121+
properties:
122+
requests:
123+
description: Requests defines the number of requests allowed per unit of time before rate
124+
limiting occurs.
125+
type: integer
126+
minimum: 1
127+
unit:
128+
description: Unit defines the period of time within which requests over the limit will be
129+
rate limited. Valid values are "second", "minute" and "hour".
130+
type: string
131+
enum:
132+
- second
133+
- minute
134+
- hour
135+
burst:
136+
description: Burst (optional) defines the number of requests above the baseline rate that are allowed
137+
in a short period of time.
138+
type: integer
139+
responseStatusCode:
140+
description: ResponseStatusCode (optional) defines the HTTP status code to use for responses to rate
141+
limited requests. Code must be in the 400-599 (inclusive) error range. If not specified,
142+
a default of 429 (Too Many Requests) is used.
143+
type: integer
144+
minimum: 400
145+
maximum: 599
146+
responseHeadersToAdd:
147+
description: ResponseHeadersToAdd (optional) defines the list of HTTP headers that should be added
148+
to each response for requests that have been rate limited.
149+
type: array
150+
items:
151+
description: Defines an HTTP header name/value pair.
152+
type: object
153+
required:
154+
- name
155+
- value
156+
properties:
157+
name:
158+
description: Name defines the HTTP header name.
159+
type: string
160+
minLength: 1
161+
value:
162+
description: Value defines the HTTP header value.
163+
type: string
164+
minLength: 1
165+
httpRoutes:
166+
description: HTTPRoutes defines the list of HTTP routes settings for the upstream host.
167+
Settings are applied at a per route level.
168+
type: array
169+
items:
170+
description: HTTP route settings for the given path.
171+
type: object
172+
properties:
173+
path:
174+
description: Path defines the HTTP path. This can be an RE2 regex value.
175+
type: string
176+
minLength: 1
177+
rateLimit:
178+
description: Rate limiting policy applied per route.
179+
type: object
180+
properties:
181+
local:
182+
description: Local rate limiting policy applied per route.
183+
type: object
184+
properties:
185+
requests:
186+
description: Requests defines the number of requests allowed per unit of time before rate
187+
limiting occurs.
188+
type: integer
189+
minimum: 1
190+
unit:
191+
description: Unit defines the period of time within which requests over the limit will be
192+
rate limited. Valid values are "second", "minute" and "hour".
193+
type: string
194+
enum:
195+
- second
196+
- minute
197+
- hour
198+
burst:
199+
description: Burst (optional) defines the number of requests above the baseline rate that are allowed
200+
in a short period of time.
201+
type: integer
202+
responseStatusCode:
203+
description: ResponseStatusCode (optional) defines the HTTP status code to use for responses to rate
204+
limited requests. Code must be in the 400-599 (inclusive) error range. If not specified,
205+
a default of 429 (Too Many Requests) is used.
206+
type: integer
207+
minimum: 400
208+
maximum: 599
209+
responseHeadersToAdd:
210+
description: ResponseHeadersToAdd (optional) defines the list of HTTP headers that should be added
211+
to each response for requests that have been rate limited.
212+
type: array
213+
items:
214+
description: Defines an HTTP header name/value pair.
215+
type: object
216+
required:
217+
- name
218+
- value
219+
properties:
220+
name:
221+
description: Name defines the HTTP header name.
222+
type: string
223+
minLength: 1
224+
value:
225+
description: Value defines the HTTP header value.
226+
type: string
227+
minLength: 1
89228
status:
90229
type: object
91230
x-kubernetes-preserve-unknown-fields: true

0 commit comments

Comments
 (0)