0

The kubectl documentation says, we should use : to separate paths to multiple kubeconfig files, but it does not work in powershell:

> $env:KUBECONFIG="C:\Users\me\.kube\staging-config:C:\Users\me\.kube\demo-k8s-config"
> kubectl config get-contexts
error: error loading config file "C:\Users\me\.kube\staging-config:C:\Users\me\.kube\demo-k8s-config": open C:\Users\dturanme.kube\staging-config:C:\Users\me\.kube\demo-k8s-config: The filename, directory name, or volume label syntax is incorrect.

I've tried with newline separator as well.

0

1 Answer 1

1

You are correct ( : ) does not work in powershell to separate paths to multiple kubeconfig files instead it uses semicolon ( ; ) to separate paths.

For Example:

$env:KUBECONFIG="C:\Users\me\.kube\staging-config;C:\Users\me\.kube\demo-k8s-config"

In Powershell, the colon ( : ) is used to separate the drive letter from the rest of the path.

Refer to the official kubernetes document on Set the KUBECONFIG environment variable for more information.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.