A few weeks ago I released a small tool called kubectx that makes it easy to use kubectl command on multiple clusters. Today, I am adding another tool called kubens that can be used to switch between Kubernetes namespaces back and forth.

This was a feature request came from one of the users.

Here is a demo:

You don’t need to install kubens separately as it comes together with kubectx. Just like kubectx, kubens also supports zsh/bash shell completion out of the box. Refer to the repository for documentation and installation guide.

With this v0.3.1 release, you can now install these tools with their short names (kctx and kns) to prevent collision with the kubectl as they normally share the “kube” prefix. To do that, you can just pass --with-short-names to the “brew install” command.

Try it out and give feedback!