-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to fetch namespaces #107
Comments
Trying to find some work-arounds, I've stumbled on this: I have 2 config files: .kube/configs/cfg1.yaml, .kube/configs/cfg2.yaml.
kind: SwitchConfig
Ok 2 things:
|
Do you use the KUBECONFIG=/Users/<my_user>/.kube/.switch_tmp/config.3093589165.tmp
Another clue that the new
Probably the contexts without the switch prefix are the contexts taken from your current Kubeconfig file set via the |
First off, I must be doing something wrong....
In my .zshrc, I export KUBECONFIG dynamically, this way:
export KUBECONFIG="$(printf '%s\n' ~/.kube/configs/*.k8sconfig 2>/dev/null | awk '{printf "%s:", $0}' | sed 's/:$//')" 2>/dev/null
This allows my variable to be up-to-date at each start of my shell, regardless of the contents in ~/.kube/configs/ . All of my kube config files have the .k8sconfig extension.
My switch-config.yaml file is this:
kind: SwitchConfig
version: v1alpha1
kubeconfigStores:
showPrefix: false
kubeconfigName: "*.k8sconfig"
paths:
The problem I have right now is that I can select a context, but once done, if I come back with
ks ns
it breaks with the following error:WARN[0000] failed to retrieve current namespaces: unable to create rest config: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
Why is that, and how may I correct my setup ? Obviously I am missing something.
I currently have 2 config files in .kube/configs, but it will soon grow. I've tried exporting KUBECONFIG= one of those files. What happens then is that when I run switcher, it lists the contexts from KUBECONFIG, and then the contexts from the 2 files in .kube/configs/ .. This means one file is listed twice.
Moreover, regardless of which context I choose, when it exits and then I try switcher ns, regardless of which config file switch to, switcher ns will always lists the namespaces from the first selected file. As if my selection is disregarded past the first occurence.
The text was updated successfully, but these errors were encountered: