Skip to content

Conversation

@petecheslock
Copy link
Contributor

Added logic to use a CLI-provided namespace if the namespace cannot be detected from kubeconfig.

User reported issue from the community slack

When a kubeconfig context has no namespace field set, the script fails with:

❌ Unable automatically detect namespace. Environment variable "LLMDBENCH_CONTROL_CLUSTER_NAMESPACE". 
Specify namespace via CLI option "-p/--namespace" or environment variable "LLMDBENCH_HARNESS_NAMESPACE"

This occurs even when -p/--namespace is provided, because:

  1. LLMDBENCH_CONTROL_CLUSTER_NAMESPACE is read from the kubeconfig context (line 518)
  2. If the context has no namespace, it remains empty
  3. The -p flag sets LLMDBENCH_VLLM_COMMON_NAMESPACE but not LLMDBENCH_CONTROL_CLUSTER_NAMESPACE
  4. The validation check at line 202 in run.sh fails because LLMDBENCH_CONTROL_CLUSTER_NAMESPACE is empty

In this scenario the user is working in the default namespace (or any namespace) whose kubeconfig context doesn't specify a namespace and they should be able to use -p/--namespace to provide it.

This solution adds a fallback after kubeconfig detection: if LLMDBENCH_CONTROL_CLUSTER_NAMESPACE is empty and LLMDBENCH_VLLM_COMMON_NAMESPACE is set (via -p), use that value.

This ensures:

  • Existing behavior is preserved (kubeconfig namespace takes precedence when present)
  • The -p flag works as expected when kubeconfig detection fails
  • No breaking changes (only applies when detection returns empty)

Added logic to use a CLI-provided namespace if the namespace cannot be detected from kubeconfig.

Signed-off-by: Pete Cheslock <[email protected]>
@maugustosilva maugustosilva merged commit 15a2c68 into llm-d:main Nov 12, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants