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 mynamespaceOutput: Context "kind-kind" modified. (I am using kind cluster)
If you want an even shorter version, add an alias in your ~/.zshrc file to call this function: alias kc='kubecontext'