1
- # conformance/tests/basic/inferencepool_httproute_port_validation.yaml
2
-
3
- # --- Backend Deployment (reusing standard echoserver) ---
4
-
5
- apiVersion : apps/v1
6
- kind : Deployment
7
- metadata :
8
- name : infra-backend-deployment-port-test
9
- namespace : gateway-conformance-app-backend
10
- labels :
11
- app : infra-backend-port-test
12
- spec :
13
- replicas : 1
14
- selector :
15
- matchLabels :
16
- app : infra-backend-port-test
17
- template :
18
- metadata :
19
- labels :
20
- app : infra-backend-port-test
21
- spec :
22
- containers :
23
- - name : echoserver
24
- image : gcr.io/k8s-staging-gateway-api/echo-basic:v20240412-v1.0.0-394-g40c666fd
25
- ports :
26
- - containerPort : 3000
27
- readinessProbe :
28
- httpGet :
29
- path : /
30
- port : 3000
31
- initialDelaySeconds : 3
32
- periodSeconds : 5
33
- failureThreshold : 2
34
- env :
35
- - name : POD_NAME
36
- valueFrom :
37
- fieldRef :
38
- fieldPath : metadata.name
39
- - name : NAMESPACE
40
- valueFrom :
41
- fieldRef :
42
- fieldPath : metadata.namespace
43
- ---
44
- # --- Backend Service ---
45
- # Service for the infra-backend-deployment-port-test.
46
- apiVersion : v1
47
- kind : Service
48
- metadata :
49
- name : infra-backend-svc-port-test
50
- namespace : gateway-conformance-app-backend
51
- spec :
52
- selector :
53
- app : infra-backend-port-test
54
- ports :
55
- - name : http
56
- port : 3000
57
- targetPort : 3000
58
- ---
59
- # --- InferencePool Definition ---
60
- apiVersion : inference.networking.x-k8s.io/v1alpha2
61
- kind : InferencePool
62
- metadata :
63
- name : target-pool-port-validation
64
- namespace : gateway-conformance-app-backend
65
- spec :
66
- selector :
67
- app : " infra-backend-port-test"
68
- targetPortNumber : 3000
69
- extensionRef :
70
- name : target-pool-port-validation-epp
71
- ---
72
- apiVersion : v1
73
- kind : Service
74
- metadata :
75
- name : target-pool-port-validation-epp
76
- namespace : gateway-conformance-app-backend
77
- spec :
78
- selector :
79
- app : target-pool-port-validation-epp
80
- ports :
81
- - protocol : TCP
82
- port : 9002
83
- targetPort : 9002
84
- appProtocol : http2
85
- type : ClusterIP
86
- ---
87
- apiVersion : apps/v1
88
- kind : Deployment
89
- metadata :
90
- name : target-pool-port-validation-epp
91
- namespace : gateway-conformance-app-backend
92
- labels :
93
- app : target-pool-port-validation-epp
94
- spec :
95
- replicas : 1
96
- selector :
97
- matchLabels :
98
- app : target-pool-port-validation-epp
99
- template :
100
- metadata :
101
- labels :
102
- app : target-pool-port-validation-epp
103
- spec :
104
- terminationGracePeriodSeconds : 130
105
- containers :
106
- - name : epp
107
- image : us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:main
108
- imagePullPolicy : Always
109
- args :
110
- - -poolName
111
- - " target-pool-port-validation"
112
- - " -poolNamespace"
113
- - " gateway-conformance-app-backend"
114
- - -v
115
- - " 4"
116
- - --zap-encoder
117
- - " json"
118
- - -grpcPort
119
- - " 9002"
120
- - -grpcHealthPort
121
- - " 9003"
122
- ports :
123
- - containerPort : 9002
124
- - containerPort : 9003
125
- - name : metrics
126
- containerPort : 9090
127
- livenessProbe :
128
- grpc :
129
- port : 9003
130
- service : inference-extension
131
- initialDelaySeconds : 5
132
- periodSeconds : 10
133
- readinessProbe :
134
- grpc :
135
- port : 9003
136
- service : inference-extension
137
- initialDelaySeconds : 5
138
- periodSeconds : 10
139
- ---
140
1
# --- HTTPRoute Scenario 1: Port Unspecified ---
2
+ ---
141
3
apiVersion : gateway.networking.k8s.io/v1
142
4
kind : HTTPRoute
143
5
metadata :
147
9
parentRefs :
148
10
- group : gateway.networking.k8s.io
149
11
kind : Gateway
150
- name : conformance-gateway
12
+ name : conformance-primary- gateway
151
13
namespace : gateway-conformance-infra
152
14
sectionName : http
153
15
hostnames :
156
18
- backendRefs :
157
19
- group : inference.networking.x-k8s.io
158
20
kind : InferencePool
159
- name : target-pool-port-validation
21
+ name : primary-inference-pool
160
22
# Port is intentionally unspecified here
161
23
matches :
162
24
- path :
173
35
parentRefs :
174
36
- group : gateway.networking.k8s.io
175
37
kind : Gateway
176
- name : conformance-gateway
38
+ name : conformance-primary- gateway
177
39
namespace : gateway-conformance-infra
178
40
sectionName : http
179
41
hostnames :
182
44
- backendRefs :
183
45
- group : inference.networking.x-k8s.io
184
46
kind : InferencePool
185
- name : target-pool-port-validation
47
+ name : primary-inference-pool
186
48
port : 3000 # Port matches InferencePool's targetPortNumber
187
49
matches :
188
50
- path :
199
61
parentRefs :
200
62
- group : gateway.networking.k8s.io
201
63
kind : Gateway
202
- name : conformance-gateway
64
+ name : conformance-primary- gateway
203
65
namespace : gateway-conformance-infra
204
66
sectionName : http
205
67
hostnames :
@@ -208,37 +70,10 @@ spec:
208
70
- backendRefs :
209
71
- group : inference.networking.x-k8s.io
210
72
kind : InferencePool
211
- name : target-pool-port-validation
73
+ name : primary-inference-pool
212
74
port : 8888 # Port does NOT match InferencePool's targetPortNumber
213
75
matches :
214
76
- path :
215
77
type : PathPrefix
216
78
value : /test-port-non-matching
217
79
---
218
- # --- Conformance EPP Requried Role and RoleBindings ---
219
- apiVersion : rbac.authorization.k8s.io/v1
220
- kind : Role
221
- metadata :
222
- name : inference-model-reader
223
- namespace : gateway-conformance-app-backend
224
- rules :
225
- - apiGroups : ["inference.networking.x-k8s.io"]
226
- resources : ["inferencemodels", "inferencepools"]
227
- verbs : ["get", "list", "watch"]
228
- - apiGroups : [""]
229
- resources : ["pods"]
230
- verbs : ["get", "list", "watch"]
231
- ---
232
- apiVersion : rbac.authorization.k8s.io/v1
233
- kind : RoleBinding
234
- metadata :
235
- name : epp-to-inference-model-reader
236
- namespace : gateway-conformance-app-backend
237
- subjects :
238
- - kind : ServiceAccount
239
- name : default
240
- namespace : gateway-conformance-app-backend
241
- roleRef :
242
- kind : Role
243
- name : inference-model-reader
244
- apiGroup : rbac.authorization.k8s.io
0 commit comments