Created
June 26, 2017 18:58
-
-
Save StephanX/bfad0735296fc4ee5f4f710fddeaaeca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ku='kubectl' | |
alias kube='kubectl' | |
kubectl() { | |
if [[ $1 == "namespace" || $1 == "ns" ]] ; then | |
if [[ $2 ]] ; then | |
command kubectl config set-context $(kubectl config current-context) --namespace=${2} 2>&1 >>/dev/null | |
else command kubectl config view $(kubectl config current-context) | grep namespace | awk '{ print $2 }' | |
fi | |
elif [[ $1 == "desc" || $1 == "de" ]] ; then | |
shift | |
command kubectl describe "$@" | |
elif [[ $1 == "rm" || $1 == "del" ]] ; then | |
shift | |
command kubectl delete "$@" | |
elif [[ $1 == "ingresslogs" ]] ; then | |
command kubectl logs -f --namespace=default $(kubectl get pods --namespace=default | grep ingress-controller | awk '{ print $1 }') | grep -v 'change in configuration' | |
else | |
command kubectl "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment