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- ---
1401# --- HTTPRoute Scenario 1: Port Unspecified ---
2+ ---
1413apiVersion : gateway.networking.k8s.io/v1
1424kind : HTTPRoute
1435metadata :
1479 parentRefs :
14810 - group : gateway.networking.k8s.io
14911 kind : Gateway
150- name : conformance-gateway
12+ name : conformance-primary- gateway
15113 namespace : gateway-conformance-infra
15214 sectionName : http
15315 hostnames :
15618 - backendRefs :
15719 - group : inference.networking.x-k8s.io
15820 kind : InferencePool
159- name : target-pool-port-validation
21+ name : primary-inference-pool
16022 # Port is intentionally unspecified here
16123 matches :
16224 - path :
17335 parentRefs :
17436 - group : gateway.networking.k8s.io
17537 kind : Gateway
176- name : conformance-gateway
38+ name : conformance-primary- gateway
17739 namespace : gateway-conformance-infra
17840 sectionName : http
17941 hostnames :
18244 - backendRefs :
18345 - group : inference.networking.x-k8s.io
18446 kind : InferencePool
185- name : target-pool-port-validation
47+ name : primary-inference-pool
18648 port : 3000 # Port matches InferencePool's targetPortNumber
18749 matches :
18850 - path :
19961 parentRefs :
20062 - group : gateway.networking.k8s.io
20163 kind : Gateway
202- name : conformance-gateway
64+ name : conformance-primary- gateway
20365 namespace : gateway-conformance-infra
20466 sectionName : http
20567 hostnames :
@@ -208,37 +70,10 @@ spec:
20870 - backendRefs :
20971 - group : inference.networking.x-k8s.io
21072 kind : InferencePool
211- name : target-pool-port-validation
73+ name : primary-inference-pool
21274 port : 8888 # Port does NOT match InferencePool's targetPortNumber
21375 matches :
21476 - path :
21577 type : PathPrefix
21678 value : /test-port-non-matching
21779---
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