4 ms·
Have been burnt by this, I have to deal with close to 8 clusters and it is very easy to make a mistake. Would highly recommend kubie, it allows you to switch a
by evnix 2y ago
Have been burnt by this, I have to deal with close to 8 clusters and it is very easy to make a mistake.
Would highly recommend kubie, it allows you to switch and shows you the name of the cluster in the prompt. It's probably a more visual way of solving the same problem.
https://github.com/sbstp/kubie https://github.com/sbstp/kubie
- Yasuraka 2y agoI do this with kubectx to switch and kube-ps1 with ohmyzsh to display cluster/namespace in my usual prompt
- glitchcrab 2y ago'close to 8 clusters' is a strange turn of phrase. So you manage 6 or 7?
- glitchcrab 2y agoI toyed with the idea of having a kubeconfig per cluster some time ago, but I work with 10s of clusters on a daily basis (often with multiple terminals targeting the same cluster) and having to auth every single time would have been too much of a pain. Instead I went with kubeswitch which still gives you a different kubeconfig per terminal but allows you to re-use existing sessions. https://github.com/danielfoehrKn/kubeswitch https://github.com/danielfoehrKn/kubeswitch
- arccy 2y agowhether a reauth is necessary depends on your k8s setup a lot of the cloud ones only configure kubeconfig to call an external command, which can share auth state between terminals
- glitchcrab 2y agoSure, but I'm switching between AWS, Azure and vSphere clusters regularly and they all behave differently.
- Telemaco019 2y agoCool project, I didn't know it. I love the idea, thanks for sharing it!
- terinjokes 2y agoIt also solves a problem many of the other solutions here miss: the prompt is printed once and so it can easily be showing stale information if you change the current context in another shell. With kubie entering a context copies the configuration to a new file and sets KUBECONFIG appropriately, so it is not affected by changes in another shell.