When I started to work with Kubernetes, It was a bit annoying to deal with multi clusters from CLI at the same time.
First suggestion was always kubectx. It's a nice tool that helps you to switch between clusters back and forth. But my main problem with it was that kubectx switches kubectl context globally. In other words, it changes the cluster context for all shells and terminals.
I've tried to find if someone fixed this problem before, but unfortunately I couldn't find a good enough solution for that purpose. So last year I decided to write my own simple solution for that!
No aliases, no extra custom changes, autocomplete out-of-the-box, and it doesn't matter if you work with 1 or 100 K8s clusters! If your liked kubectx/kubens probably you will like kubech!
Kubech is a tool similar to kubectx, but allows you to set kubectl contexts/namespaces per shell/terminal to manage multi Kubernetes cluster at the same time. i.e. same as kubectx but per shell/terminal.
Here are some of its features:
- Each shell/terminal will have its own context (K8s cluster) or namespace!
- Easy to use! Just source it in your favorite shell.
- No aliases, no extra customizations, it doesn't matter if you work with 1 or 100 K8s clusters!
- It still can be used along with other tools like kubectx/kubens.
- It doesn't change anything in ~/.kube/config file. So it works perfectly with static and dynamic kube config files.
- It supports autocomplete for contexts and namespaces.
That's it! Enjoy! ⎈