-
-
Save tamalsaha/4e6a5c1144e2daf370398520e20fdef7 to your computer and use it in GitHub Desktop.
Kubectl exec with working terminal
This file contains hidden or 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
#!/bin/sh | |
if [ "$1" = "" ]; then | |
echo "Usage: ksh <pod> [flags_to_kubectl]" | |
exit 1 | |
fi | |
POD=$1 | |
shift | |
COLUMNS=`tput cols` | |
LINES=`tput lines` | |
TERM=xterm | |
KUBE_SHELL=${KUBE_SHELL:-bash} | |
kubectl exec -i -t $POD "$@" -- env COLUMNS=$COLUMNS LINES=$LINES TERM=$TERM "$KUBE_SHELL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @coresolve !