Skip to content

Instantly share code, notes, and snippets.

@andreigec
Created November 9, 2019 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreigec/089994cc441792ebf8b4672b525b2de3 to your computer and use it in GitHub Desktop.
Save andreigec/089994cc441792ebf8b4672b525b2de3 to your computer and use it in GitHub Desktop.
# run with execk8s <alias>
execk8s(){
echo will exec into $1
EXEC1=$(kubectl get pods -l app=$1 -n $1 | sed -n '2p' | sed 's/\s.*$//')
echo E1=$EXEC1
kubectl exec $EXEC1 -n $1 -it /bin/sh
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment