Skip to content

Commit bd24da7

Browse files
committed
ix: handle KinD/minikube (no LoadBalancer) in deploy and conformance scripts
Signed-off-by: Aneesh Puttur <aneeshputtur@gmail.com>
1 parent 957b45c commit bd24da7

File tree

4 files changed

+43
-15
lines changed

4 files changed

+43
-15
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ help:
2121
@echo " make undeploy - Remove all infrastructure"
2222
@echo " make undeploy-kserve - Remove KServe"
2323
@echo ""
24+
@echo "Mock model (no GPU):"
25+
@echo " make deploy-mock-model - Deploy mock LLMInferenceService"
26+
@echo " make clean-mock-model - Clean up mock deployment"
27+
@echo ""
2428
@echo "Other:"
2529
@echo " make status - Show deployment status"
2630
@echo " make test - Run ODH conformance tests"

scripts/setup-gateway.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,24 @@ spec:
165165
name: ${GATEWAY_NAME}-config
166166
EOF
167167

168-
# Wait for Gateway to be programmed
169-
log_wait "Waiting for Gateway to be programmed..."
170-
if kubectl wait --for=condition=Programmed gateway/"${GATEWAY_NAME}" -n "${KSERVE_NAMESPACE}" --timeout=120s; then
171-
log_success "Gateway created and programmed: ${GATEWAY_NAME}"
168+
# Wait for Gateway to be accepted (Programmed requires a LoadBalancer which
169+
# is not available on KinD/minikube)
170+
log_wait "Waiting for Gateway to be accepted..."
171+
kubectl wait --for=condition=Accepted gateway/"${GATEWAY_NAME}" -n "${KSERVE_NAMESPACE}" --timeout=120s
172+
log_success "Gateway accepted: ${GATEWAY_NAME}"
173+
174+
# Wait for Programmed (external IP) — skip on platforms without LoadBalancer
175+
if kubectl get nodes -o jsonpath='{.items[0].spec.providerID}' 2>/dev/null | grep -qE "^(kind|minikube)://"; then
176+
log_info "Skipping Programmed check (no LoadBalancer on KinD/minikube)"
172177
else
173-
log_error "Gateway failed to become programmed within timeout"
174-
kubectl get gateway "${GATEWAY_NAME}" -n "${KSERVE_NAMESPACE}" -o yaml
175-
return 1
178+
log_wait "Waiting for Gateway to be programmed..."
179+
if kubectl wait --for=condition=Programmed gateway/"${GATEWAY_NAME}" -n "${KSERVE_NAMESPACE}" --timeout=120s; then
180+
log_success "Gateway programmed with external IP: ${GATEWAY_NAME}"
181+
else
182+
log_error "Gateway failed to become programmed within timeout"
183+
kubectl get gateway "${GATEWAY_NAME}" -n "${KSERVE_NAMESPACE}" -o yaml
184+
return 1
185+
fi
176186
fi
177187
}
178188

test/conformance/verify-llm-d-deployment.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,16 +982,15 @@ check_llminferenceservice_resources() {
982982
# Check each one's status
983983
local ready_count=0
984984
local not_ready=()
985-
while IFS= read -r line; do
986-
local name ready
987-
name=$(echo "$line" | awk '{print $1}')
988-
ready=$(echo "$line" | awk '{print $3}')
985+
while IFS= read -r name; do
986+
local ready
987+
ready=$($KUBECTL get llminferenceservice "$name" -n "$LLMD_NAMESPACE" -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || echo "")
989988
if [[ "$ready" == "True" ]]; then
990989
((ready_count++))
991990
else
992991
not_ready+=("$name")
993992
fi
994-
done < <($KUBECTL get llminferenceservice -n "$LLMD_NAMESPACE" --no-headers 2>/dev/null)
993+
done < <($KUBECTL get llminferenceservice -n "$LLMD_NAMESPACE" --no-headers -o custom-columns=NAME:.metadata.name 2>/dev/null)
995994

996995
if [[ "$ready_count" -eq "$llmisvc_count" ]]; then
997996
log_pass "All $llmisvc_count LLMInferenceService(s) are Ready"

test/deploy-model.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,27 @@ kubectl get pods -n "$NAMESPACE"
142142
# Test inference via the service URL
143143
SERVICE_URL=$(kubectl get llmisvc "$MODEL_NAME" -n "$NAMESPACE" -o jsonpath='{.status.url}')
144144
echo ""
145-
echo "[INFO] Testing inference at $SERVICE_URL ..."
145+
146+
if [[ -z "$SERVICE_URL" ]]; then
147+
echo "[INFO] No external URL (no LoadBalancer — expected on KinD/minikube)"
148+
echo "[INFO] Testing inference via port-forward to mock pod..."
149+
POD_NAME=$(kubectl get pod -n "$NAMESPACE" -l app.kubernetes.io/name="$MODEL_NAME",kserve.io/component=workload -o jsonpath='{.items[0].metadata.name}' 2>/dev/null)
150+
kubectl port-forward -n "$NAMESPACE" "pod/$POD_NAME" 8000:8000 &
151+
PF_PID=$!
152+
sleep 3
153+
SERVICE_URL="https://localhost:8000"
154+
CLEANUP_PF=true
155+
else
156+
echo "[INFO] Testing inference at $SERVICE_URL ..."
157+
CLEANUP_PF=false
158+
fi
146159

147160
RESPONSE=$(curl -s -k --max-time 30 -X POST "${SERVICE_URL}/v1/chat/completions" \
148161
-H "Content-Type: application/json" \
149162
-d '{"model":"mock-model","messages":[{"role":"user","content":"Hello"}],"max_tokens":20}')
150163

164+
[[ "$CLEANUP_PF" == "true" ]] && kill $PF_PID 2>/dev/null || true
165+
151166
if echo "$RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print('[PASS] Response:', d['choices'][0]['message']['content'])" 2>/dev/null; then
152167
echo ""
153168
echo "=== Mock model deployed successfully ==="
@@ -156,10 +171,10 @@ if echo "$RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print
156171
echo " URL: $SERVICE_URL"
157172
echo " Cleanup: make clean-mock-model"
158173
else
159-
echo "[WARN] Inference test via gateway failed (gateway may not be configured)"
174+
echo "[WARN] Inference test failed"
160175
echo " Response: $RESPONSE"
161176
echo ""
162-
echo "=== Mock model deployed (inference via gateway not verified) ==="
177+
echo "=== Mock model deployed (inference not verified) ==="
163178
echo " LLMInferenceService: $MODEL_NAME"
164179
echo " Namespace: $NAMESPACE"
165180
echo " Cleanup: make clean-mock-model"

0 commit comments

Comments
 (0)