diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index e3f6dbb..bec1164 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -124,6 +124,22 @@ if [ $? -eq 0 ]; then fi } + # Shortcut for kubectl + kctl() { + local kube_config + if [ -z $KUBECONFIG ]; then + kube_config=$HOME/.kube/config + else + kube_config=$KUBECONFIG + fi + if [ -f $kube_config ]; then + kubectl $@ + else + echo >&2 error: $kube_config does not exist + return 1 + fi + } + fi # change to git directory