istio
1apiVersion: gateway.networking.k8s.io/v1beta1
2kind: GatewayClass
3metadata:
4name: istio
5spec:
6controllerName: istio.io/gateway-controller
7---
8apiVersion: gateway.networking.k8s.io/v1beta1
9kind: Gateway
10metadata:
11name: gateway
12namespace: istio-system
13spec:
14addresses:
15- value: istio-ingressgateway
16type: Hostname
17gatewayClassName: istio
18listeners:
19- name: default
20hostname: "*.domain.example"
21port: 80
22protocol: HTTP
23allowedRoutes:
24namespaces:
25from: All
26- name: foobar
27hostname: "*.foobar.example"
28port: 80
29protocol: HTTP
30allowedRoutes:
31namespaces:
32from: All
33kinds:
34- kind: HTTPRoute
35- name: same-namespace
36hostname: "*.same-namespace.example"
37port: 80
38protocol: HTTP
39- name: scope-route
40hostname: "*.scope-route.example"
41port: 80
42protocol: HTTP
43allowedRoutes:
44namespaces:
45from: All
46kinds:
47- kind: TCPRoute
48- name: slctr-labels
49hostname: "*.slctr-labels.example"
50port: 80
51protocol: HTTP
52allowedRoutes:
53namespaces:
54from: Selector
55selector:
56matchLabels:
57istio.io/test-name-part: group
58- name: slctr-expr-in-yes
59hostname: "*.slctr-expr-in-yes.example"
60port: 80
61protocol: HTTP
62allowedRoutes:
63namespaces:
64from: Selector
65selector:
66matchExpressions:
67- key: istio.io/test-name-part
68operator: In
69values:
70- group
71- name: slctr-expr-in-no
72hostname: "*.slctr-expr-in-no.example"
73port: 80
74protocol: HTTP
75allowedRoutes:
76namespaces:
77from: Selector
78selector:
79matchExpressions:
80- key: istio.io/test-name-part
81operator: In
82values:
83- public
84- name: slctr-expr-notin-yes
85hostname: "*.slctr-expr-notin-yes.example"
86port: 80
87protocol: HTTP
88allowedRoutes:
89namespaces:
90from: Selector
91selector:
92matchExpressions:
93- key: istio.io/test-name-part
94operator: NotIn
95values:
96- private
97- key: istio.io/test-label-not-found
98operator: NotIn
99values:
100- irrelevant
101- name: slctr-expr-notin-no
102hostname: "*.slctr-expr-notin-no.example"
103port: 80
104protocol: HTTP
105allowedRoutes:
106namespaces:
107from: Selector
108selector:
109matchExpressions:
110- key: istio.io/test-name-part
111operator: NotIn
112values:
113- group
114- key: istio.io/test-label-not-found
115operator: NotIn
116values:
117- irrelevant
118- name: slctr-expr-exists-yes
119hostname: "*.slctr-expr-exists-yes.example"
120port: 80
121protocol: HTTP
122allowedRoutes:
123namespaces:
124from: Selector
125selector:
126matchExpressions:
127- key: istio.io/test-name-part
128operator: Exists
129- name: slctr-expr-exists-no
130hostname: "*.slctr-expr-exists-no.example"
131port: 80
132protocol: HTTP
133allowedRoutes:
134namespaces:
135from: Selector
136selector:
137matchExpressions:
138- key: istio.io/test-name-public
139operator: Exists
140- name: slctr-expr-dne-yes
141hostname: "*.slctr-expr-dne-yes.example"
142port: 80
143protocol: HTTP
144allowedRoutes:
145namespaces:
146from: Selector
147selector:
148matchExpressions:
149- key: istio.io/test-label-not-found
150operator: DoesNotExist
151- name: slctr-expr-dne-no
152hostname: "*.slctr-expr-dne-no.example"
153port: 80
154protocol: HTTP
155allowedRoutes:
156namespaces:
157from: Selector
158selector:
159matchExpressions:
160- key: istio.io/test-name-part
161operator: DoesNotExist
162- name: slctr-combined-yes
163hostname: "*.slctr-combined-yes.example"
164port: 80
165protocol: HTTP
166allowedRoutes:
167namespaces:
168from: Selector
169selector:
170matchLabels:
171istio.io/test-name-part: group
172matchExpressions:
173- key: istio.io/test-name-part
174operator: In
175values:
176- group
177- name: slctr-combined-no
178hostname: "*.slctr-combined-no.example"
179port: 80
180protocol: HTTP
181allowedRoutes:
182namespaces:
183from: Selector
184selector:
185matchLabels:
186istio.io/test-name-part: public
187matchExpressions:
188- key: istio.io/test-name-part
189operator: In
190values:
191- group
192---
193apiVersion: gateway.networking.k8s.io/v1beta1
194kind: HTTPRoute
195metadata:
196name: section-name-cross-namespace
197namespace: default
198spec:
199parentRefs:
200- name: gateway
201namespace: istio-system
202sectionName: foobar
203hostnames: ["alpha.foobar.example"]
204rules:
205- backendRefs:
206- name: httpbin
207port: 80
208---
209apiVersion: gateway.networking.k8s.io/v1beta1
210kind: HTTPRoute
211metadata:
212name: same-namespace-valid
213namespace: istio-system
214spec:
215parentRefs:
216- name: gateway
217namespace: istio-system
218sectionName: foobar
219- name: gateway
220namespace: istio-system
221sectionName: same-namespace
222rules:
223- backendRefs:
224- name: httpbin
225port: 81
226---
227apiVersion: gateway.networking.k8s.io/v1beta1
228kind: HTTPRoute
229metadata:
230name: same-namespace-invalid
231namespace: default
232spec:
233parentRefs:
234- kind: Gateway
235name: gateway
236namespace: istio-system
237sectionName: same-namespace
238hostnames: ["foo.same.example"]
239rules:
240- backendRefs:
241- name: echo
242port: 80
243---
244apiVersion: gateway.networking.k8s.io/v1alpha2
245kind: TCPRoute
246metadata:
247# Should not generate anything, the protocol is HTTP
248name: wrong-protocol
249namespace: default
250spec:
251parentRefs:
252- name: gateway
253namespace: istio-system
254sectionName: foobar
255rules:
256- backendRefs:
257- name: httpbin
258port: 82
259---
260apiVersion: gateway.networking.k8s.io/v1beta1
261kind: HTTPRoute
262metadata:
263name: host-mismatch
264namespace: default
265spec:
266parentRefs:
267- name: gateway
268namespace: istio-system
269sectionName: foobar
270hostnames: ["no.match.example"]
271rules:
272- backendRefs:
273- name: httpbin
274port: 84
275---
276apiVersion: gateway.networking.k8s.io/v1beta1
277kind: HTTPRoute
278metadata:
279name: bind-all
280namespace: default
281spec:
282parentRefs:
283- name: gateway
284namespace: istio-system
285rules:
286- backendRefs:
287- name: httpbin
288port: 85
289---
290apiVersion: gateway.networking.k8s.io/v1beta1
291kind: HTTPRoute
292metadata:
293name: bind-cross-namespace
294namespace: group-namespace1
295spec:
296parentRefs:
297- name: gateway
298namespace: istio-system
299sectionName: slctr-labels
300- name: gateway
301namespace: istio-system
302sectionName: slctr-expr-in-yes
303- name: gateway
304namespace: istio-system
305sectionName: slctr-expr-in-no
306- name: gateway
307namespace: istio-system
308sectionName: slctr-expr-notin-yes
309- name: gateway
310namespace: istio-system
311sectionName: slctr-expr-notin-no
312- name: gateway
313namespace: istio-system
314sectionName: slctr-expr-exists-yes
315- name: gateway
316namespace: istio-system
317sectionName: slctr-expr-exists-no
318- name: gateway
319namespace: istio-system
320sectionName: slctr-expr-dne-yes
321- name: gateway
322namespace: istio-system
323sectionName: slctr-expr-dne-no
324- name: gateway
325namespace: istio-system
326sectionName: slctr-combined-yes
327- name: gateway
328namespace: istio-system
329sectionName: slctr-combined-no
330rules:
331- backendRefs:
332- name: httpbin
333port: 86
334---
335apiVersion: gateway.networking.k8s.io/v1beta1
336kind: HTTPRoute
337metadata:
338name: bind-cross-namespace
339namespace: group-namespace2
340spec:
341parentRefs:
342- name: gateway
343namespace: istio-system
344sectionName: slctr-labels
345rules:
346- backendRefs:
347- name: httpbin
348port: 87
349---
350apiVersion: gateway.networking.k8s.io/v1beta1
351kind: HTTPRoute
352metadata:
353name: invalid-bind-cross-namespace
354namespace: default
355spec:
356parentRefs:
357- name: gateway
358namespace: istio-system
359sectionName: slctr-labels
360rules:
361- backendRefs:
362- name: httpbin
363port: 87
364
365