Last active
July 18, 2016 21:08
-
-
Save cdemers/8351180dcf30753866ffac7715cc2cf3 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
#!/bin/sh | |
# Starts a bash within a container running on Kubernetes while initializing | |
# the terminal type to xterm and the size to your actual terminal size. Makes | |
# it possible to have vi, more, etc work in a usable way until PR #25273 is | |
# merged. Derived from a snip by Hubert Chen (https://github.com/hubt) | |
if [ "$1" = "" ]; then | |
echo "Usage: kbash.sh {pod} [container]" | |
exit 1 | |
fi | |
if [ "$2" != "" ]; then | |
CNT="-c $2" | |
fi | |
COLUMNS=`tput cols` | |
LINES=`tput lines` | |
TERM=xterm | |
kubectl exec -ti $1 $CNT env COLUMNS=$COLUMNS LINES=$LINES TERM=$TERM bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment