Better k9s alias

This commit is contained in:
Thomas Forgione 2023-02-17 15:34:43 +01:00
parent a860c85827
commit c8f0d4d729
1 changed files with 14 additions and 1 deletions

View File

@ -79,7 +79,20 @@ fi
# Docker and kubernetes aliases # Docker and kubernetes aliases
command -v k9s > /dev/null 2>&1 command -v k9s > /dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
alias kns="k9s" kns() {
local kube_config
if [ -z $KUBECONFIG ]; then
kube_config=$HOME/.kube/config
else
kube_config=$KUBECONFIG
fi
if [ -f $kube_config ]; then
k9s
else
echo >&2 error: $kube_config does not exist
return 1
fi
}
fi fi
command -v lazydocker > /dev/null 2>&1 command -v lazydocker > /dev/null 2>&1