@@ -22,6 +22,9 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
22
22
# Set the namespace to deploy the Gateway stack to
23
23
: " ${PROJECT_NAMESPACE:= default} "
24
24
25
+ # Set the host port to map to the Gateway's inbound port (30080)
26
+ : " ${GATEWAY_HOST_PORT:= 30080} "
27
+
25
28
# ------------------------------------------------------------------------------
26
29
# Setup & Requirement Checks
27
30
# ------------------------------------------------------------------------------
63
66
if kind get clusters 2> /dev/null | grep -q " ^${CLUSTER_NAME} $" ; then
64
67
echo " Cluster '${CLUSTER_NAME} ' already exists, re-using"
65
68
else
66
- kind create cluster --name " ${CLUSTER_NAME} "
69
+ kind create cluster --name " ${CLUSTER_NAME} " --config - << EOF
70
+ kind: Cluster
71
+ apiVersion: kind.x-k8s.io/v1alpha4
72
+ nodes:
73
+ - role: control-plane
74
+ extraPortMappings:
75
+ - containerPort: 30080
76
+ hostPort: ${GATEWAY_HOST_PORT}
77
+ protocol: TCP
78
+ EOF
67
79
fi
68
80
69
81
# Set the kubectl context to the kind cluster
@@ -126,13 +138,9 @@ You can watch the Endpoint Picker logs with:
126
138
127
139
$ kubectl --context ${KUBE_CONTEXT} logs -f deployments/endpoint-picker
128
140
129
- You can use a port-forward to access the Gateway:
130
-
131
- $ kubectl --context ${KUBE_CONTEXT} port-forward service/inference-gateway-istio 8080:80
132
-
133
141
With that running in the background, you can make requests:
134
142
135
- $ curl -s -w '\n' http://localhost:8080 /v1/completions -H 'Content-Type: application/json' -d '{"model":"food-review","prompt":"hi","max_tokens":10,"temperature":0}' | jq
143
+ $ curl -s -w '\n' http://localhost:${GATEWAY_HOST_PORT} /v1/completions -H 'Content-Type: application/json' -d '{"model":"food-review","prompt":"hi","max_tokens":10,"temperature":0}' | jq
136
144
137
145
-----------------------------------------
138
146
EOF
0 commit comments