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: Selector
26selector:
27matchLabels:
28istio.io/test-name-part: allowed
29---
30apiVersion: gateway.networking.k8s.io/v1beta1
31kind: HTTPRoute
32metadata:
33name: http
34namespace: allowed-1
35spec:
36parentRefs:
37- name: gateway
38namespace: istio-system
39- group: ""
40kind: Service
41name: a-example
42- group: ""
43kind: Service
44name: b-example
45hostnames: ["a.domain.example", "b.domain.example"]
46rules:
47- matches:
48- path:
49type: PathPrefix
50value: /foo
51headers:
52- name: my-header
53value: some-value
54type: Exact
55backendRefs:
56- name: svc1
57port: 80
58- matches:
59- path:
60type: RegularExpression
61value: /foo((\/).*)?
62backendRefs:
63- name: svc2
64port: 80
65---
66apiVersion: gateway.networking.k8s.io/v1beta1
67kind: HTTPRoute
68metadata:
69name: http
70namespace: allowed-2
71spec:
72parentRefs:
73- name: gateway
74namespace: istio-system
75- group: ""
76kind: Service
77name: a-example
78hostnames: ["a.domain.example"]
79rules:
80- matches:
81- path:
82type: PathPrefix
83value: /foo/bar
84- path:
85type: PathPrefix
86value: /bar
87backendRefs:
88- name: svc2
89port: 80
90- matches:
91- path:
92type: Exact
93value: /baz
94headers:
95- name: my-header
96value: some-value
97type: Exact
98queryParams:
99- name: my-param
100value: some-value
101type: RegularExpression
102backendRefs:
103- name: svc2
104port: 80
105- matches:
106- path:
107type: PathPrefix
108value: /
109backendRefs:
110- name: svc3
111port: 80
112- matches:
113- method: PATCH
114path:
115type: PathPrefix
116value: /
117backendRefs:
118- name: svc2
119port: 80
120---
121apiVersion: gateway.networking.k8s.io/v1beta1
122kind: HTTPRoute
123metadata:
124name: http
125namespace: default
126spec:
127parentRefs:
128- name: gateway
129namespace: istio-system
130hostnames: ["a.domain.example", "b.domain.example"]
131rules:
132- matches:
133- path:
134type: PathPrefix
135value: /abc
136headers:
137- name: my-header
138value: some-value
139type: Exact
140backendRefs:
141- name: svc4
142port: 80
143---
144