kube-spawn icon indicating copy to clipboard operation
kube-spawn copied to clipboard

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

Open blixtra opened this issue 6 years ago • 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.

blixtra avatar Nov 30 '17 12:11 blixtra

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

blixtra avatar Nov 30 '17 12:11 blixtra

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

alban avatar Nov 30 '17 13:11 alban

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 avatar Nov 30 '17 13:11 schu

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

schu avatar Nov 30 '17 13:11 schu

@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.

alban avatar Nov 30 '17 13:11 alban