Skip to content

Commit fd24bec

Browse files
authored
Merge branch 'main' into api-l4-ip-filtering
2 parents 7ec6742 + ced5d75 commit fd24bec

File tree

8 files changed

+535
-34
lines changed

8 files changed

+535
-34
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
gateways:
2+
- apiVersion: gateway.networking.k8s.io/v1
3+
kind: Gateway
4+
metadata:
5+
namespace: envoy-gateway
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.example.com
25+
parentRefs:
26+
- namespace: envoy-gateway
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.example.com
44+
parentRefs:
45+
- namespace: envoy-gateway
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+
envoyextensionpolicies:
56+
- apiVersion: gateway.envoyproxy.io/v1alpha1
57+
kind: EnvoyExtensionPolicy
58+
metadata:
59+
namespace: default
60+
name: policy-for-http-route-1
61+
spec:
62+
targetRef:
63+
group: gateway.networking.k8s.io
64+
kind: HTTPRoute
65+
name: httproute-1
66+
lua:
67+
- type: Inline
68+
inline: |
69+
function envoy_on_response(response_handle)
70+
response_handle:headers():add("x-lua-custom", "FOO")
71+
end
72+
- apiVersion: gateway.envoyproxy.io/v1alpha1
73+
kind: EnvoyExtensionPolicy
74+
metadata:
75+
namespace: envoy-gateway
76+
name: policy-for-gateway
77+
spec:
78+
targetRef:
79+
group: gateway.networking.k8s.io
80+
kind: Gateway
81+
name: gateway-1
82+
lua:
83+
- type: Inline
84+
inline: |
85+
function envoy_on_request(request_handle)
86+
request_handle:logInfo("Policy attached to gateway")
87+
end
88+
- apiVersion: gateway.envoyproxy.io/v1alpha1
89+
kind: EnvoyExtensionPolicy
90+
metadata:
91+
namespace: default
92+
name: policy-for-http-route-2
93+
spec:
94+
targetRef:
95+
group: gateway.networking.k8s.io
96+
kind: HTTPRoute
97+
name: httproute-2
98+
lua:
99+
- type: Inline
100+
inline: |
101+
function envoy_on_response(response_handle)
102+
response_handle:headers():add("x-lua-route-2", "BAR")
103+
end

0 commit comments

Comments
 (0)