Skip to content

Commit 757d147

Browse files
authored
feat: support retries in ext proc (#7169)
* feat: support retries in ext proc Signed-off-by: Shreemaan Abhishek <[email protected]>
1 parent 7c4bf61 commit 757d147

9 files changed

+1303
-3
lines changed
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
gateways:
2+
- apiVersion: gateway.networking.k8s.io/v1
3+
kind: Gateway
4+
metadata:
5+
namespace: default
6+
name: gateway-1
7+
spec:
8+
gatewayClassName: envoy-gateway-class
9+
listeners:
10+
- name: http
11+
protocol: HTTP
12+
port: 80
13+
allowedRoutes:
14+
namespaces:
15+
from: All
16+
httpRoutes:
17+
- apiVersion: gateway.networking.k8s.io/v1
18+
kind: HTTPRoute
19+
metadata:
20+
namespace: default
21+
name: httproute-1
22+
spec:
23+
hostnames:
24+
- www.foo.com
25+
parentRefs:
26+
- namespace: default
27+
name: gateway-1
28+
sectionName: http
29+
rules:
30+
- matches:
31+
- path:
32+
value: /foo
33+
backendRefs:
34+
- name: service-1
35+
port: 8080
36+
- apiVersion: gateway.networking.k8s.io/v1
37+
kind: HTTPRoute
38+
metadata:
39+
namespace: default
40+
name: httproute-2
41+
spec:
42+
hostnames:
43+
- www.bar.com
44+
parentRefs:
45+
- namespace: default
46+
name: gateway-1
47+
sectionName: http
48+
rules:
49+
- matches:
50+
- path:
51+
value: /bar
52+
backendRefs:
53+
- name: service-1
54+
port: 8080
55+
services:
56+
- apiVersion: v1
57+
kind: Service
58+
metadata:
59+
namespace: envoy-gateway
60+
name: grpc-backend
61+
spec:
62+
ports:
63+
- port: 8000
64+
name: grpc
65+
protocol: TCP
66+
- apiVersion: v1
67+
kind: Service
68+
metadata:
69+
namespace: default
70+
name: grpc-backend-2
71+
spec:
72+
ports:
73+
- port: 9000
74+
name: grpc
75+
protocol: TCP
76+
endpointSlices:
77+
- apiVersion: discovery.k8s.io/v1
78+
kind: EndpointSlice
79+
metadata:
80+
name: endpointslice-grpc-backend
81+
namespace: envoy-gateway
82+
labels:
83+
kubernetes.io/service-name: grpc-backend
84+
addressType: IPv4
85+
ports:
86+
- name: grpc
87+
protocol: TCP
88+
port: 8000
89+
endpoints:
90+
- addresses:
91+
- 7.7.7.7
92+
conditions:
93+
ready: true
94+
- apiVersion: discovery.k8s.io/v1
95+
kind: EndpointSlice
96+
metadata:
97+
name: endpointslice-grpc-backend-2
98+
namespace: default
99+
labels:
100+
kubernetes.io/service-name: grpc-backend-2
101+
addressType: IPv4
102+
ports:
103+
- name: grpc
104+
protocol: TCP
105+
port: 9000
106+
endpoints:
107+
- addresses:
108+
- 8.8.8.8
109+
conditions:
110+
ready: true
111+
referenceGrants:
112+
- apiVersion: gateway.networking.k8s.io/v1alpha2
113+
kind: ReferenceGrant
114+
metadata:
115+
namespace: envoy-gateway
116+
name: referencegrant-1
117+
spec:
118+
from:
119+
- group: gateway.envoyproxy.io
120+
kind: EnvoyExtensionPolicy
121+
namespace: default
122+
to:
123+
- group: ''
124+
kind: Service
125+
- group: gateway.envoyproxy.io
126+
kind: Backend
127+
configMaps:
128+
- apiVersion: v1
129+
kind: ConfigMap
130+
metadata:
131+
name: ca-cmap
132+
namespace: envoy-gateway
133+
data:
134+
ca.crt: |
135+
-----BEGIN CERTIFICATE-----
136+
MIIDJzCCAg+gAwIBAgIUAl6UKIuKmzte81cllz5PfdN2IlIwDQYJKoZIhvcNAQEL
137+
BQAwIzEQMA4GA1UEAwwHbXljaWVudDEPMA0GA1UECgwGa3ViZWRiMB4XDTIzMTAw
138+
MjA1NDE1N1oXDTI0MTAwMTA1NDE1N1owIzEQMA4GA1UEAwwHbXljaWVudDEPMA0G
139+
A1UECgwGa3ViZWRiMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwSTc
140+
1yj8HW62nynkFbXo4VXKv2jC0PM7dPVky87FweZcTKLoWQVPQE2p2kLDK6OEszmM
141+
yyr+xxWtyiveremrWqnKkNTYhLfYPhgQkczib7eUalmFjUbhWdLvHakbEgCodn3b
142+
kz57mInX2VpiDOKg4kyHfiuXWpiBqrCx0KNLpxo3DEQcFcsQTeTHzh4752GV04RU
143+
Ti/GEWyzIsl4Rg7tGtAwmcIPgUNUfY2Q390FGqdH4ahn+mw/6aFbW31W63d9YJVq
144+
ioyOVcaMIpM5B/c7Qc8SuhCI1YGhUyg4cRHLEw5VtikioyE3X04kna3jQAj54YbR
145+
bpEhc35apKLB21HOUQIDAQABo1MwUTAdBgNVHQ4EFgQUyvl0VI5vJVSuYFXu7B48
146+
6PbMEAowHwYDVR0jBBgwFoAUyvl0VI5vJVSuYFXu7B486PbMEAowDwYDVR0TAQH/
147+
BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAMLxrgFVMuNRq2wAwcBt7SnNR5Cfz
148+
2MvXq5EUmuawIUi9kaYjwdViDREGSjk7JW17vl576HjDkdfRwi4E28SydRInZf6J
149+
i8HZcZ7caH6DxR335fgHVzLi5NiTce/OjNBQzQ2MJXVDd8DBmG5fyatJiOJQ4bWE
150+
A7FlP0RdP3CO3GWE0M5iXOB2m1qWkE2eyO4UHvwTqNQLdrdAXgDQlbam9e4BG3Gg
151+
d/6thAkWDbt/QNT+EJHDCvhDRKh1RuGHyg+Y+/nebTWWrFWsktRrbOoHCZiCpXI1
152+
3eXE6nt0YkgtDxG22KqnhpAg9gUSs2hlhoxyvkzyF0mu6NhPlwAgnq7+/Q==
153+
-----END CERTIFICATE-----
154+
backendTLSPolicies:
155+
- apiVersion: gateway.networking.k8s.io/v1alpha2
156+
kind: BackendTLSPolicy
157+
metadata:
158+
name: policy-btls-grpc
159+
namespace: envoy-gateway
160+
spec:
161+
targetRefs:
162+
- group: ''
163+
kind: Service
164+
name: grpc-backend
165+
sectionName: grpc
166+
validation:
167+
caCertificateRefs:
168+
- name: ca-cmap
169+
group: ''
170+
kind: ConfigMap
171+
hostname: grpc-backend
172+
- apiVersion: gateway.networking.k8s.io/v1alpha2
173+
kind: BackendTLSPolicy
174+
metadata:
175+
name: policy-btls-backend-ip
176+
namespace: envoy-gateway
177+
spec:
178+
targetRefs:
179+
- group: gateway.envoyproxy.io
180+
kind: Backend
181+
name: backend-ip-tls
182+
validation:
183+
caCertificateRefs:
184+
- name: ca-cmap
185+
group: ''
186+
kind: ConfigMap
187+
hostname: ip-backend
188+
envoyExtensionPolicies:
189+
- apiVersion: gateway.envoyproxy.io/v1alpha1
190+
kind: EnvoyExtensionPolicy
191+
metadata:
192+
namespace: default
193+
name: policy-for-http-route
194+
spec:
195+
targetRef:
196+
group: gateway.networking.k8s.io
197+
kind: HTTPRoute
198+
name: httproute-1
199+
extProc:
200+
- backendRefs:
201+
- Name: grpc-backend
202+
Namespace: envoy-gateway
203+
Port: 8000
204+
- Name: grpc-backend-2
205+
Port: 9000
206+
- Name: backend-ip
207+
Kind: Backend
208+
Group: gateway.envoyproxy.io
209+
- Name: backend-ip-tls
210+
Namespace: envoy-gateway
211+
Kind: Backend
212+
Group: gateway.envoyproxy.io
213+
backendSettings:
214+
# START: Test data for retry policy
215+
retry:
216+
numRetries: 2
217+
retryOn:
218+
triggers:
219+
- 5xx
220+
- unavailable
221+
- internal
222+
- deadline-exceeded
223+
perRetry:
224+
timeout: "3s"
225+
backOff:
226+
baseInterval: "0.2s"
227+
maxInterval: "3s"
228+
# END: Test data for retry policy
229+
dns:
230+
respectDnsTtl: true
231+
http2:
232+
initialStreamWindowSize: 128Ki
233+
initialConnectionWindowSize: 2Mi
234+
maxConcurrentStreams: 200
235+
onInvalidMessage: TerminateStream
236+
loadBalancer:
237+
type: ConsistentHash
238+
consistentHash:
239+
type: Header
240+
header:
241+
name: X-some-header
242+
proxyProtocol:
243+
version: V2
244+
tcpKeepalive:
245+
probes: 7
246+
healthCheck:
247+
passive:
248+
consecutiveGatewayErrors: 4
249+
interval: 5s
250+
circuitBreaker:
251+
maxConnections: 2048
252+
timeout:
253+
tcp:
254+
connectTimeout: 15s
255+
connection:
256+
bufferLimit: 20Mi
257+
backends:
258+
- apiVersion: gateway.envoyproxy.io/v1alpha1
259+
kind: Backend
260+
metadata:
261+
name: backend-ip
262+
namespace: default
263+
spec:
264+
endpoints:
265+
- ip:
266+
address: 1.1.1.1
267+
port: 3001
268+
- apiVersion: gateway.envoyproxy.io/v1alpha1
269+
kind: Backend
270+
metadata:
271+
name: backend-ip-tls
272+
namespace: envoy-gateway
273+
spec:
274+
endpoints:
275+
- ip:
276+
address: 2.2.2.2
277+
port: 3443

0 commit comments

Comments
 (0)