This is an zsh plugin to help with the usage and installation of multiple verions of common kubernetes tools, namely clusterctl
, kubectl
and kind
.
This plugin adds two functions for each of these tools, *_download
and *_switch
, to download and switch between versions.
Completion is rebuilt and cached after a version change.
This plugin supports configuration via zstyle
.
You can use zstyle ':k8sctl:binaries' path $YOURPATH
to configure the path where binaries are downloaded and symlinked. Defaults to $HOME/.local/bin
. This path should also be in your $PATH
.
I tested this only with zinit
, but if it works with antigen, OMZ or zgen, please contact me and I will update this list.
Add zinit load apoxa/kubernetes-helpers
to your zinit plugins in your .zshrc
This is based on a gist from sbueringer. I made it zsh-compatible (without using bashcompinit
) and fixed some minor bugs.