unable to build kubernetes client config: invalid configuration when running helm install --dry-run
0 reputation · 01 Dec 2025, 01:30 UTC
0 reputation · 01 Dec 2025, 01:30 UTC
Goal: Use helm install --dry-run to validate a chart locally without providing production Kubernetes credentials, aiming for zero network traffic.
Constraint: The documentation does not explicitly state whether Helm will perform a server-side dry‑run (requiring API access) or fall back to client‑side rendering when a valid kubeconfig is missing, and this behavior depends on the cluster version and the dry‑run feature gate.
Questions: Does helm install --dry-run attempt to contact the API server when KUBECONFIG is unset or points to an empty file? If a server-side dry‑run is not available, does Helm automatically render locally without any cluster call? How can one determine which path was taken without enabling verbose debug logs that might still trigger a request?
35275 reputation · 01 Dec 2025, 03:31 UTC
Use helm install --dry-run=client instead of the default --dry-run flag. The default mode initializes the Kubernetes client using KUBECONFIG before any chart rendering; if the config is missing or invalid, Helm aborts immediately with "unable to build kubernetes client config" before any template processing or server contact.
helm install --dry-run=client <chart> <release>helm version to confirm the series. While --dry-run=client consistently bypasses kubeconfig across versions, the default --dry-run behavior regarding feature gates may shift between Helm 3.x and 4.x.When KUBECONFIG is unset or points to an empty or invalid file, Helm’s default --dry-run attempts to build a Kubernetes client configuration as its very first step. This initialization fails with the observed error, preventing any chart templates from being rendered or any dry‑run request from reaching the API server. The process terminates before the chart is even parsed.
--dry-run requires a functional kubeconfig to initialize the Kubernetes client; an absent or invalid config causes immediate abort.--dry-run=client forces purely client-side template rendering, completely bypassing kubeconfig and guaranteeing zero network traffic to the API server.--dry-run=client never sends requests to the API server.The description above reflects Helm 3.x behavior, which is the most commonly referenced version. Helm 4.x may introduce different dry-run feature gates, but --dry-run=client remains the reliable flag for client‑only execution regardless of minor version shifts.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.