A kubernetes alias for switching between namespaces.
- Copy the function inside
alias.sh
- Append it to your
~/.zshrc
(usevim ~/.zshrc
) - Apply the content of zshrc (use
source ~/.zshrc
)
kubecontext mynamespace
Output: Context "kind-kind" modified. (I am using kind cluster)
If you want an even shorter version, add an alias in your file to call this function: alias kc='kubecontext'