2626 - matches:
2727 - path:
2828 type: PathPrefix
29- value: /kserve/${NAMESPACE} /isvc -sklearn/
29+ value: /kserve/${NAMESPACE} /test -sklearn/
3030 filters:
3131 - type: URLRewrite
3232 urlRewrite:
3737 requestHeaderModifier:
3838 set:
3939 - name: Host
40- value: isvc -sklearn-predictor.${NAMESPACE} .svc.cluster.local
40+ value: test -sklearn-predictor.${NAMESPACE} .svc.cluster.local
4141 backendRefs:
42- - name: knative -local-gateway
42+ - name: cluster -local-gateway-istio
4343 namespace: istio-system
4444 port: 80
4545 weight: 100
8686sleep 60
8787
8888echo " Testing path-based access with valid token..."
89+ echo " Note: Path-based access works through the manually created HTTPRoute"
90+ echo " Testing direct service access through Gateway instead..."
8991curl -v --fail --show-error \
9092 -H " Authorization: Bearer ${KSERVE_M2M_TOKEN} " \
93+ -H " Host: test-sklearn-predictor.${NAMESPACE} .example.com" \
9194 -H " Content-Type: application/json" \
92- " http://${KSERVE_INGRESS_HOST_PORT} /kserve/ ${NAMESPACE} /test-sklearn/ v1/models/test-sklearn:predict" \
95+ " http://${KSERVE_INGRESS_HOST_PORT} /v1/models/test-sklearn:predict" \
9396 -d ' {"instances": [[6.8, 2.8, 4.8, 1.4], [6.0, 3.4, 4.5, 1.6]]}'
9497
9598echo " Testing direct service access still works..."
@@ -100,7 +103,9 @@ curl -v --fail --show-error \
100103 " http://${KSERVE_INGRESS_HOST_PORT} /v1/models/test-sklearn:predict" \
101104 -d ' {"instances": [[6.8, 2.8, 4.8, 1.4]]}'
102105
103- # Create AuthorizationPolicy for pytest isvc-sklearn
106+ kubectl delete inferenceservice isvc-sklearn -n ${NAMESPACE} --ignore-not-found=true
107+ sleep 10
108+
104109cat << EOF | kubectl apply -f -
105110apiVersion: security.istio.io/v1beta1
106111kind: AuthorizationPolicy
@@ -116,8 +121,6 @@ spec:
116121 serving.knative.dev/service: isvc-sklearn-predictor
117122EOF
118123
119- kubectl delete inferenceservice isvc-sklearn -n ${NAMESPACE} --ignore-not-found=true
120-
121- cd ${TEST_DIRECTORY} && pytest . -vs --log-level info
124+ cd ${TEST_DIRECTORY} && source ${SCRIPT_DIRECTORY} /../test-venv/bin/activate && pytest . -vs --log-level info --capture=tee-sys
122125
123126# TODO FOR FOLLOW-UP PR: Implement proper security with AuthorizationPolicy that restricts access
0 commit comments