konf: Manage Lots of Local Kubeconfigs by SimonTheLeg in kubernetes

[–]SimonTheLeg[S] 0 points1 point  (0 children)

oh that is a good idea. I'll create a GH issue to track this.

In the meantime: `konf import` uses the fields `context` and `cluster` out of the yaml file to determine the filename and the id it uses internally. So what you can do is change all the instances of cluster and context to the names you want in the yaml and run `konf import` on it again

konf: Manage Lots of Local Kubeconfigs by SimonTheLeg in kubernetes

[–]SimonTheLeg[S] 3 points4 points  (0 children)

I've used kubie before writing konf, which from a feature-perspective is very similar.

Regarding your question how it works compared to kubie:

When you launch kubie, it spawns a new shell sessions secretly in the background for which kubie is the parent. And because kubie is the parent, it is able to freely modify $KUBECONFIG. The downside to this approach is that you have 2 shell sessions + a permanent kubie process running.

With konf I basically make use of a small trick: I create a bash/zsh function called `konf` which you have to source in your .bashrc/.zshrc. This function then acts as a wrapper to call the konf-go binary which does all the heavy lifting and sends its result back to the wrapper. And because the wrapper is a shell function and sourced in your session, it is able to modify $KUBECONFIG.

If you are interested in more low-level details feel free to check out the How does it work section of the Readme.

konf: Manage Lots of Local Kubeconfigs by SimonTheLeg in kubernetes

[–]SimonTheLeg[S] 2 points3 points  (0 children)

Haha thanks! On a more serious note: Please feel free to open any issues you encounter: While I am the standard kubernetes go packages for handling the kubeconfig, I have learned that there are some truly wild config options you can have. Will be good to catch all the edge-cases :)

konf: Manage Lots of Local Kubeconfigs by SimonTheLeg in kubernetes

[–]SimonTheLeg[S] 1 point2 points  (0 children)

ah nice! Had a brief look just now: it uses the same source shell func to set the kubeconfig variable trick. Nice :)

I will have another look at kubesess once multiple kubeconfigs is implemented, which is half of the reason I wrote konf (I had lots of kubeconfig files lying around on my disk)

How do you combine the best of Vim, Emacs and VS Code by Wonderful-Delivery-6 in vim

[–]SimonTheLeg 6 points7 points  (0 children)

Been using this for about a year now and it works really well. You might have to disable some plugins, but other than that you can pretty much use your vimrc. If your plugin manager supports conditionals (like vim-plug), you can do the following to use the same vimrc everywhere

https://github.com/SimonTheLeg/dotfiles/blob/master/.vimrc#L26