kinvolk/kube-spawn

Feature request: command to output the path of the related kubeconfig file

Opened this issue · 5 comments

don't want to have to hunt down the file everytime I need to switch clusters.

I'd like to always be able to do something like export KUBECONFIG=kube-spawn -c mycluster --kubeconfig to set the KUBECONFIG file.

Couldn't figure out how to get backtick literal. :(

alban commented

It is also possible to add several directories in $KUBECONFIG and to use kubectl config subcommands to switch. Maybe something to explore.

schu commented

I think what would be nice in terms of UX is to automatically add/remove entries to/from ~/.kube/config with kube-spawn start/stop. The info message could then tell users how to use the context (either kubectl --context <my kube-spawn cluster> ... or kubectl config set-context <my kube-spawn cluster> && kubectl ...). kube-spawn could also allow users to set "switch to new context automatically " in kube-spawn's configuration.

schu commented

This way users could also use kubectl config get-contexts to learn about existing kube-spawn clusters.

alban commented

@schu it would be good but kube-spawn runs as root and the user for ~/.kube/config is not root. Not sure how to do it correctly with that constraint.