@@ -5,41 +5,46 @@ NAMESPACE=${1:-kubeflow-user-example-com}
55SCRIPT_DIRECTORY=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
66TEST_DIRECTORY=" ${SCRIPT_DIRECTORY} /kserve"
77
8- if ! command -v pytest & > /dev/null; then
9- echo " Installing test dependencies..."
10- pip install -r ${TEST_DIRECTORY} /requirements.txt
11- fi
8+ echo " === KServe Predictor Service Labels ==="
9+ kubectl get pods -n ${NAMESPACE} -l serving.knative.dev/service=isvc-sklearn-predictor --show-labels || true
1210
1311export KSERVE_INGRESS_HOST_PORT=${KSERVE_INGRESS_HOST_PORT:- localhost: 8080}
1412export KSERVE_M2M_TOKEN=" $( kubectl -n ${NAMESPACE} create token default-editor) "
1513export KSERVE_TEST_NAMESPACE=${NAMESPACE}
1614
1715cat << EOF | kubectl apply -f -
18- apiVersion: networking.istio .io/v1beta1
19- kind: VirtualService
16+ apiVersion: gateway. networking.k8s .io/v1
17+ kind: HTTPRoute
2018metadata:
2119 name: test-sklearn-path
2220 namespace: ${NAMESPACE}
2321spec:
24- gateways:
25- - kubeflow/kubeflow-gateway
26- hosts:
27- - '*'
28- http:
29- - match:
30- - uri:
31- prefix: /kserve/${NAMESPACE} /test-sklearn/
32- rewrite:
33- uri: /
34- route:
35- - destination:
36- host: knative-local-gateway.istio-system.svc.cluster.local
37- headers:
38- request:
39- set:
40- Host: test-sklearn-predictor.${NAMESPACE} .svc.cluster.local
41- weight: 100
42- timeout: 300s
22+ parentRefs:
23+ - name: kubeflow-gateway
24+ namespace: istio-system
25+ rules:
26+ - matches:
27+ - path:
28+ type: PathPrefix
29+ value: /kserve/${NAMESPACE} /isvc-sklearn/
30+ filters:
31+ - type: URLRewrite
32+ urlRewrite:
33+ path:
34+ type: ReplacePrefixMatch
35+ replacePrefixMatch: /
36+ - type: RequestHeaderModifier
37+ requestHeaderModifier:
38+ set:
39+ - name: Host
40+ value: isvc-sklearn-predictor.${NAMESPACE} .svc.cluster.local
41+ backendRefs:
42+ - name: knative-local-gateway
43+ namespace: istio-system
44+ port: 80
45+ weight: 100
46+ timeouts:
47+ request: 300s
4348EOF
4449
4550cat << EOF | kubectl apply -f -
0 commit comments