diff --git a/docs/get_started/first_isvc.md b/docs/get_started/first_isvc.md index 331c2a051..922bc520d 100644 --- a/docs/get_started/first_isvc.md +++ b/docs/get_started/first_isvc.md @@ -186,6 +186,16 @@ Depending on your setup, use one of the following commands to curl the `Inferenc curl -v -H "Content-Type: application/json" http://sklearn-iris.kserve-test/v1/models/sklearn-iris:predict -d @./iris-input.json ``` +=== "Port forwarded service" + + If you have done `Port Forward` above during testing, you can extract the inference + server URL from the status and make a curl request to it. + + ```bash + SERVICE_HOSTNAME=$(kubectl get inferenceservice sklearn-iris -n kserve-test -o jsonpath='{.status.url}' | cut -d "/" -f 3) + curl -v -H "Host: ${SERVICE_HOSTNAME}" -H "Content-Type: application/json" "http://${INGRESS_HOST}:${INGRESS_PORT}/v1/models/sklearn-iris:predict" -d @./iris-input.json + ``` + You should see two predictions returned (i.e. `{"predictions": [1, 1]}`). Both sets of data points sent for inference correspond to the flower with index `1`. In this case, the model predicts that both flowers are "Iris Versicolour".