Skip to content

Commit b7a3875

Browse files
authored
fix(standalone): require modelServers.matchLabels when InferencePool is disabled (#1695)
When router.inferencePool.create=false the EPP --endpoint-selector is rendered solely from router.modelServers.matchLabels. If matchLabels is omitted the selector renders empty and EPP rejects it at startup, because standalone mode requires either --pool-name or a non-empty --endpoint-selector. The existing matchLabels validation lives in _inferencepool.yaml, which only renders when an InferencePool is created, so the create=false path had no guard and produced a broken EPP deployment silently. Add the check to the standalone validations so helm template fails fast with an actionable message, and add a negative test case to hack/verify-helm.sh covering the reproducer from the issue. Fixes #1665 Signed-off-by: Jonathan Wrede <wrede.jonathan00@gmail.com>
1 parent 4c16a44 commit b7a3875

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

config/charts/llm-d-router-standalone/templates/_validations.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ standalone validations
1818
{{- if not (or (eq $proxyMode "sidecar") (eq $proxyMode "service")) -}}
1919
{{- fail (printf ".Values.router.proxy.mode must be one of [sidecar, service], got %q" $proxyMode) -}}
2020
{{- end -}}
21+
{{- /* Without an InferencePool the EPP --endpoint-selector is rendered from modelServers.matchLabels; an empty selector is rejected by EPP at startup, so require it here. */ -}}
22+
{{- $useInferencePool := ne .Values.router.inferencePool.create false -}}
23+
{{- if not $useInferencePool -}}
24+
{{- if or (empty .Values.router.modelServers) (not .Values.router.modelServers.matchLabels) -}}
25+
{{- fail ".Values.router.modelServers.matchLabels is required when .Values.router.inferencePool.create=false: standalone mode renders the EPP --endpoint-selector from matchLabels and cannot start with an empty selector" -}}
26+
{{- end -}}
27+
{{- end -}}
2128
{{- $failOpen := index $proxy "failOpen" -}}
2229
{{- if and (not (kindIs "invalid" $failOpen)) (not (kindIs "bool" $failOpen)) -}}
2330
{{- fail (printf ".Values.router.proxy.failOpen must be a boolean, got %q" (toString $failOpen)) -}}

hack/verify-helm.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ for key in "${!test_cases_llm_d_router_standalone[@]}"; do
148148
done
149149

150150
echo "Running llm-d-router-standalone negative validation tests..."
151+
missing_endpoint_selector_command="${HELM} template ${SCRIPT_ROOT}/config/charts/llm-d-router-standalone --set router.inferencePool.create=false --set router.modelServers.type=vllm --set 'router.modelServers.targetPorts[0].number=8000' >/dev/null"
152+
echo "Executing: ${missing_endpoint_selector_command}"
153+
if eval "${missing_endpoint_selector_command}"; then
154+
echo "Helm template unexpectedly succeeded for inferencePool.create=false without modelServers.matchLabels"
155+
exit 1
156+
fi
157+
151158
invalid_proxy_command="${HELM} template ${SCRIPT_ROOT}/config/charts/llm-d-router-standalone --set router.modelServers.matchLabels.app=llm-instance-gateway --set router.inferencePool.create=false --set router.proxy.proxyType=bogus >/dev/null"
152159
echo "Executing: ${invalid_proxy_command}"
153160
if eval "${invalid_proxy_command}"; then

0 commit comments

Comments
 (0)