Skip to content

Commit e48670a

Browse files
committed
add gatewayapi testdata
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
1 parent 2955e08 commit e48670a

6 files changed

+824
-16
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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: listener-1
11+
protocol: HTTP
12+
port: 80
13+
hostname: listener-1.gateway-1.envoyproxy.io
14+
allowedRoutes:
15+
namespaces:
16+
from: All
17+
httpRoutes:
18+
- apiVersion: gateway.networking.k8s.io/v1
19+
kind: HTTPRoute
20+
metadata:
21+
namespace: default
22+
name: httproute-1
23+
spec:
24+
hostnames:
25+
- listener-1.gateway-1.envoyproxy.io
26+
parentRefs:
27+
- namespace: envoy-gateway
28+
name: gateway-1
29+
sectionName: listener-1
30+
rules:
31+
- matches:
32+
- path:
33+
value: "/foo"
34+
backendRefs:
35+
- name: service-1
36+
port: 8080
37+
securityPolicies:
38+
- apiVersion: gateway.envoyproxy.io/v1alpha1
39+
kind: SecurityPolicy
40+
metadata:
41+
namespace: default
42+
name: policy-for-route-1
43+
spec:
44+
targetRef:
45+
group: gateway.networking.k8s.io
46+
kind: HTTPRoute
47+
name: httproute-1
48+
sectionName: not-found-section-name
49+
cors:
50+
allowHeaders:
51+
- "x-httproute-1"
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
gateways:
2+
- apiVersion: gateway.networking.k8s.io/v1
3+
kind: Gateway
4+
metadata:
5+
creationTimestamp: null
6+
name: gateway-1
7+
namespace: envoy-gateway
8+
spec:
9+
gatewayClassName: envoy-gateway-class
10+
listeners:
11+
- allowedRoutes:
12+
namespaces:
13+
from: All
14+
hostname: listener-1.gateway-1.envoyproxy.io
15+
name: listener-1
16+
port: 80
17+
protocol: HTTP
18+
status:
19+
listeners:
20+
- attachedRoutes: 1
21+
conditions:
22+
- lastTransitionTime: null
23+
message: Sending translated listener configuration to the data plane
24+
reason: Programmed
25+
status: "True"
26+
type: Programmed
27+
- lastTransitionTime: null
28+
message: Listener has been successfully translated
29+
reason: Accepted
30+
status: "True"
31+
type: Accepted
32+
- lastTransitionTime: null
33+
message: Listener references have been resolved
34+
reason: ResolvedRefs
35+
status: "True"
36+
type: ResolvedRefs
37+
name: listener-1
38+
supportedKinds:
39+
- group: gateway.networking.k8s.io
40+
kind: HTTPRoute
41+
- group: gateway.networking.k8s.io
42+
kind: GRPCRoute
43+
httpRoutes:
44+
- apiVersion: gateway.networking.k8s.io/v1
45+
kind: HTTPRoute
46+
metadata:
47+
creationTimestamp: null
48+
name: httproute-1
49+
namespace: default
50+
spec:
51+
hostnames:
52+
- listener-1.gateway-1.envoyproxy.io
53+
parentRefs:
54+
- name: gateway-1
55+
namespace: envoy-gateway
56+
sectionName: listener-1
57+
rules:
58+
- backendRefs:
59+
- name: service-1
60+
port: 8080
61+
matches:
62+
- path:
63+
value: /foo
64+
status:
65+
parents:
66+
- conditions:
67+
- lastTransitionTime: null
68+
message: Route is accepted
69+
reason: Accepted
70+
status: "True"
71+
type: Accepted
72+
- lastTransitionTime: null
73+
message: Resolved all the Object references for the Route
74+
reason: ResolvedRefs
75+
status: "True"
76+
type: ResolvedRefs
77+
controllerName: gateway.envoyproxy.io/gatewayclass-controller
78+
parentRef:
79+
name: gateway-1
80+
namespace: envoy-gateway
81+
sectionName: listener-1
82+
infraIR:
83+
envoy-gateway/gateway-1:
84+
proxy:
85+
listeners:
86+
- address: null
87+
name: envoy-gateway/gateway-1/listener-1
88+
ports:
89+
- containerPort: 10080
90+
name: http-80
91+
protocol: HTTP
92+
servicePort: 80
93+
metadata:
94+
labels:
95+
gateway.envoyproxy.io/owning-gateway-name: gateway-1
96+
gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway
97+
ownerReference:
98+
kind: GatewayClass
99+
name: envoy-gateway-class
100+
name: envoy-gateway/gateway-1
101+
namespace: envoy-gateway-system
102+
securityPolicies:
103+
- apiVersion: gateway.envoyproxy.io/v1alpha1
104+
kind: SecurityPolicy
105+
metadata:
106+
creationTimestamp: null
107+
name: policy-for-route-1
108+
namespace: default
109+
spec:
110+
cors:
111+
allowHeaders:
112+
- x-httproute-1
113+
targetRef:
114+
group: gateway.networking.k8s.io
115+
kind: HTTPRoute
116+
name: httproute-1
117+
sectionName: not-found-section-name
118+
status:
119+
ancestors:
120+
- ancestorRef:
121+
group: gateway.networking.k8s.io
122+
kind: Gateway
123+
name: gateway-1
124+
namespace: envoy-gateway
125+
sectionName: listener-1
126+
conditions:
127+
- lastTransitionTime: null
128+
message: No section name not-found-section-name found for HTTPRoute httproute-1
129+
reason: Invalid
130+
status: "False"
131+
type: Accepted
132+
controllerName: gateway.envoyproxy.io/gatewayclass-controller
133+
xdsIR:
134+
envoy-gateway/gateway-1:
135+
accessLog:
136+
json:
137+
- path: /dev/stdout
138+
http:
139+
- address: 0.0.0.0
140+
hostnames:
141+
- listener-1.gateway-1.envoyproxy.io
142+
isHTTP2: false
143+
metadata:
144+
kind: Gateway
145+
name: gateway-1
146+
namespace: envoy-gateway
147+
sectionName: listener-1
148+
name: envoy-gateway/gateway-1/listener-1
149+
path:
150+
escapedSlashesAction: UnescapeAndRedirect
151+
mergeSlashes: true
152+
port: 10080
153+
routes:
154+
- destination:
155+
metadata:
156+
kind: HTTPRoute
157+
name: httproute-1
158+
namespace: default
159+
name: httproute/default/httproute-1/rule/0
160+
settings:
161+
- addressType: IP
162+
endpoints:
163+
- host: 7.7.7.7
164+
port: 8080
165+
metadata:
166+
name: service-1
167+
namespace: default
168+
sectionName: "8080"
169+
name: httproute/default/httproute-1/rule/0/backend/0
170+
protocol: HTTP
171+
weight: 1
172+
hostname: listener-1.gateway-1.envoyproxy.io
173+
isHTTP2: false
174+
metadata:
175+
kind: HTTPRoute
176+
name: httproute-1
177+
namespace: default
178+
name: httproute/default/httproute-1/rule/0/match/0/listener-1_gateway-1_envoyproxy_io
179+
pathMatch:
180+
distinct: false
181+
name: ""
182+
prefix: /foo
183+
readyListener:
184+
address: 0.0.0.0
185+
ipFamily: IPv4
186+
path: /ready
187+
port: 19003

internal/gatewayapi/testdata/securitypolicy-override-replace.in.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,17 @@ httpRoutes:
111111
- namespace: envoy-gateway
112112
name: gateway-1
113113
rules:
114-
- matches:
114+
- name: rule-1
115+
matches:
116+
- path:
117+
value: "/httproute-5-rule-1"
118+
backendRefs:
119+
- name: service-1
120+
port: 8080
121+
- name: rule-2
122+
matches:
115123
- path:
116-
value: "/httproute-5"
124+
value: "/httproute-5-rule-2"
117125
backendRefs:
118126
- name: service-1
119127
port: 8080
@@ -238,3 +246,17 @@ securityPolicies:
238246
cors:
239247
allowHeaders:
240248
- "x-httproute-5"
249+
- apiVersion: gateway.envoyproxy.io/v1alpha1
250+
kind: SecurityPolicy
251+
metadata:
252+
namespace: default
253+
name: policy-for-route-5-rule-2
254+
spec:
255+
targetRef:
256+
group: gateway.networking.k8s.io
257+
kind: HTTPRoute
258+
name: httproute-5
259+
sectionName: rule-2
260+
cors:
261+
allowHeaders:
262+
- "x-httproute-5-rule-2"

0 commit comments

Comments
 (0)