@@ -18,17 +18,12 @@ metadata:
18
18
labels :
19
19
gateway-conformance : backend
20
20
---
21
- apiVersion : v1
22
- kind : Namespace
23
- metadata :
24
- name : gateway-conformance-web-backend
25
- labels :
26
- gateway-conformance : web-backend
27
- ---
21
+ # A basic Gateway resource that allows HTTPRoutes from the same namespace.
22
+ # Tests can use this as a parent reference for routes that target InferencePools.
28
23
apiVersion : gateway.networking.k8s.io/v1
29
24
kind : Gateway
30
25
metadata :
31
- name : conformance-gateway
26
+ name : conformance-primary- gateway
32
27
namespace : gateway-conformance-infra
33
28
spec :
34
29
gatewayClassName : " {GATEWAY_CLASS_NAME}"
@@ -58,30 +53,32 @@ spec:
58
53
allowedRoutes :
59
54
namespaces :
60
55
from : All
56
+
57
+ # ## The following defines the essential resources for the gateway conformance test.
58
+ # ## All resources are created in the 'gateway-conformance-app-backend' namespace.
61
59
---
60
+ # Deploys a mock backend service to act as a model server.
62
61
apiVersion : apps/v1
63
62
kind : Deployment
64
63
metadata :
65
- name : inference-model-1
64
+ name : primary- inference-model-server-deployment
66
65
namespace : gateway-conformance-app-backend
67
66
labels :
68
- app : inference-model-1
67
+ app : primary- inference-model-server
69
68
spec :
70
- replicas : 1
71
69
selector :
72
70
matchLabels :
73
- app : inference-model-1
71
+ app : primary- inference-model-server
74
72
template :
75
73
metadata :
76
74
labels :
77
- app : inference-model-1
75
+ app : primary- inference-model-server
78
76
spec :
79
77
containers :
80
- - name : echo-basic-1
78
+ - name : echoserver
81
79
image : gcr.io/k8s-staging-gateway-api/echo-basic:v20240412-v1.0.0-394-g40c666fd
82
80
ports :
83
- - name : http
84
- containerPort : 3000
81
+ - containerPort : 3000
85
82
readinessProbe :
86
83
httpGet :
87
84
path : /
@@ -103,29 +100,28 @@ spec:
103
100
fieldRef :
104
101
fieldPath : status.podIP
105
102
---
103
+ # Deploys a secondary mock backend service to act as a model server.
106
104
apiVersion : apps/v1
107
105
kind : Deployment
108
106
metadata :
109
- name : inference-model-2
107
+ name : secondary- inference-model-server-deployment
110
108
namespace : gateway-conformance-app-backend
111
109
labels :
112
- app : inference-model-2
110
+ app : secondary- inference-model-server
113
111
spec :
114
- replicas : 1
115
112
selector :
116
113
matchLabels :
117
- app : inference-model-2
114
+ app : secondary- inference-model-server
118
115
template :
119
116
metadata :
120
117
labels :
121
- app : inference-model-2
118
+ app : secondary- inference-model-server
122
119
spec :
123
120
containers :
124
- - name : echo-basic-2
121
+ - name : echoserver
125
122
image : gcr.io/k8s-staging-gateway-api/echo-basic:v20240412-v1.0.0-394-g40c666fd
126
123
ports :
127
- - name : http
128
- containerPort : 3000
124
+ - containerPort : 3000
129
125
readinessProbe :
130
126
httpGet :
131
127
path : /
@@ -146,3 +142,209 @@ spec:
146
142
valueFrom :
147
143
fieldRef :
148
144
fieldPath : status.podIP
145
+ ---
146
+ # --- Primary InferencePool Definition ---
147
+ apiVersion : inference.networking.x-k8s.io/v1alpha2
148
+ kind : InferencePool
149
+ metadata :
150
+ name : primary-inference-pool
151
+ namespace : gateway-conformance-app-backend
152
+ spec :
153
+ selector :
154
+ app : primary-inference-model-server
155
+ targetPortNumber : 3000
156
+ extensionRef :
157
+ name : primary-endpoint-picker-svc
158
+ ---
159
+ # --- Primary Conformance EPP service Definition ---
160
+ apiVersion : v1
161
+ kind : Service
162
+ metadata :
163
+ name : primary-endpoint-picker-svc
164
+ namespace : gateway-conformance-app-backend
165
+ spec :
166
+ selector :
167
+ app : primary-app-backend-epp
168
+ ports :
169
+ - protocol : TCP
170
+ port : 9002
171
+ targetPort : 9002
172
+ appProtocol : http2
173
+ type : ClusterIP
174
+ ---
175
+ # --- Primary Conformance EPP Deployment ---
176
+ apiVersion : apps/v1
177
+ kind : Deployment
178
+ metadata :
179
+ name : primary-app-endpoint-picker
180
+ namespace : gateway-conformance-app-backend
181
+ labels :
182
+ app : primary-app-backend-epp
183
+ spec :
184
+ replicas : 1
185
+ selector :
186
+ matchLabels :
187
+ app : primary-app-backend-epp
188
+ template :
189
+ metadata :
190
+ labels :
191
+ app : primary-app-backend-epp
192
+ spec :
193
+ # Conservatively, this timeout should mirror the longest grace period of the pods within the pool
194
+ terminationGracePeriodSeconds : 130
195
+ containers :
196
+ - name : epp
197
+ image : us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:main
198
+ imagePullPolicy : Always
199
+ args :
200
+ - -poolName
201
+ - " primary-inference-pool"
202
+ - -poolNamespace
203
+ - " gateway-conformance-app-backend"
204
+ - -v
205
+ - " 4"
206
+ - --zap-encoder
207
+ - " json"
208
+ - -grpcPort
209
+ - " 9002"
210
+ - -grpcHealthPort
211
+ - " 9003"
212
+ env :
213
+ - name : USE_STREAMING
214
+ value : " true"
215
+ - name : ENABLE_REQ_HEADER_BASED_SCHEDULER_FOR_TESTING # Used for conformance test.
216
+ value : " true"
217
+ ports :
218
+ - containerPort : 9002
219
+ - containerPort : 9003
220
+ - name : metrics
221
+ containerPort : 9090
222
+ livenessProbe :
223
+ grpc :
224
+ port : 9003
225
+ service : inference-extension
226
+ initialDelaySeconds : 5
227
+ periodSeconds : 10
228
+ readinessProbe :
229
+ grpc :
230
+ port : 9003
231
+ service : inference-extension
232
+ initialDelaySeconds : 5
233
+ periodSeconds : 10
234
+ ---
235
+ # --- Secondary InferencePool Definition ---
236
+ apiVersion : inference.networking.x-k8s.io/v1alpha2
237
+ kind : InferencePool
238
+ metadata :
239
+ name : secondary-inference-pool
240
+ namespace : gateway-conformance-app-backend
241
+ spec :
242
+ selector :
243
+ app : secondary-inference-model-server
244
+ targetPortNumber : 3000
245
+ extensionRef :
246
+ name : secondary-endpoint-picker-svc
247
+ ---
248
+ # --- Secondary Conformance EPP service Definition ---
249
+ apiVersion : v1
250
+ kind : Service
251
+ metadata :
252
+ name : secondary-endpoint-picker-svc
253
+ namespace : gateway-conformance-app-backend
254
+ spec :
255
+ selector :
256
+ app : secondary-app-backend-epp
257
+ ports :
258
+ - protocol : TCP
259
+ port : 9002
260
+ targetPort : 9002
261
+ appProtocol : http2
262
+ type : ClusterIP
263
+ ---
264
+ # --- Secondary Conformance EPP Deployment ---
265
+ apiVersion : apps/v1
266
+ kind : Deployment
267
+ metadata :
268
+ name : secondary-app-endpoint-picker
269
+ namespace : gateway-conformance-app-backend
270
+ labels :
271
+ app : secondary-app-backend-epp
272
+ spec :
273
+ replicas : 1
274
+ selector :
275
+ matchLabels :
276
+ app : secondary-app-backend-epp
277
+ template :
278
+ metadata :
279
+ labels :
280
+ app : secondary-app-backend-epp
281
+ spec :
282
+ # Conservatively, this timeout should mirror the longest grace period of the pods within the pool
283
+ terminationGracePeriodSeconds : 130
284
+ containers :
285
+ - name : epp
286
+ image : us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:main
287
+ imagePullPolicy : Always
288
+ args :
289
+ - -poolName
290
+ - " secondary-inference-pool"
291
+ - -poolNamespace
292
+ - " gateway-conformance-app-backend"
293
+ - -v
294
+ - " 4"
295
+ - --zap-encoder
296
+ - " json"
297
+ - -grpcPort
298
+ - " 9002"
299
+ - -grpcHealthPort
300
+ - " 9003"
301
+ env :
302
+ - name : USE_STREAMING
303
+ value : " true"
304
+ - name : ENABLE_REQ_HEADER_BASED_SCHEDULER_FOR_TESTING # Used for conformance test.
305
+ value : " true"
306
+ ports :
307
+ - containerPort : 9002
308
+ - containerPort : 9003
309
+ - name : metrics
310
+ containerPort : 9090
311
+ livenessProbe :
312
+ grpc :
313
+ port : 9003
314
+ service : inference-extension
315
+ initialDelaySeconds : 5
316
+ periodSeconds : 10
317
+ readinessProbe :
318
+ grpc :
319
+ port : 9003
320
+ service : inference-extension
321
+ initialDelaySeconds : 5
322
+ periodSeconds : 10
323
+ ---
324
+ # --- Required Role and RoleBinding for Conformance Test for EPP ---
325
+ apiVersion : rbac.authorization.k8s.io/v1
326
+ kind : Role
327
+ metadata :
328
+ name : inference-model-reader
329
+ namespace : gateway-conformance-app-backend
330
+ rules :
331
+ - apiGroups : ["inference.networking.x-k8s.io"]
332
+ resources : ["inferencemodels", "inferencepools"]
333
+ verbs : ["get", "list", "watch"]
334
+ - apiGroups : [""]
335
+ resources : ["pods"]
336
+ verbs : ["get", "list", "watch"]
337
+ ---
338
+ apiVersion : rbac.authorization.k8s.io/v1
339
+ kind : RoleBinding
340
+ metadata :
341
+ name : epp-to-inference-model-reader
342
+ namespace : gateway-conformance-app-backend
343
+ subjects :
344
+ - kind : ServiceAccount
345
+ name : default
346
+ namespace : gateway-conformance-app-backend
347
+ roleRef :
348
+ kind : Role
349
+ name : inference-model-reader
350
+ apiGroup : rbac.authorization.k8s.io
0 commit comments