Loads kubectx and kubens automagically for you
APACHE-2.0 License
kubectx is a great tool for Kubernetes that provides a kubectx
and kubens
command that make it easier for you to work with multiple clusters and namespaces.
kubectx-zshplugin automatically installs them into your ZSH environment for you.
kubectx-zshplugin
can be automatically loaded as a ZSH plugin by any framework that supports oh-my-zsh compatible plugins.
If you're using zgen:
zgen load unixorn/kubectx-zshplugin
to your .zshrc
along with your other zgen load
commands.zgen reset && zgen save
. zgen
will automatically clone the git
repository the next time you start a terminal session.If you're using Antigen:
antigen bundle unixorn/kubectx-zshplugin
to your .zshrc
where you've listed your other plugins.antigen bundle unixorn/kubectx-zshplugin
in a running shell to have antigen
automatically clone and load the new plugin immediately.If you're using oh-my-zsh:
In the terminal, change to oh-my-zsh's custom plugin directory:
cd ~/.oh-my-zsh/custom/plugins/
Clone the repository into a new kubectx
directory:
git clone --recursive https://github.com/unixorn/kubectx-zshplugin.git kubectx
cd ~/.oh-my-zsh/custom/plugins/kubectx/
git submodule init
git submodule update
Edit your ~/.zshrc
and add kubectx
– same as clone directory – to the list of plugins to enable:
plugins=( ... kubectx )
Then, restart your terminal application to refresh context and use the plugin. Alternatively, you can source your current shell configuration:
source ~/.zshrc