Skip to content

Instantly share code, notes, and snippets.

@butangero
Forked from jason-kane/kssh
Created October 24, 2023 20:47
Show Gist options
  • Save butangero/d82687c4ada632a5c8a8d7f9bdc338b3 to your computer and use it in GitHub Desktop.
Save butangero/d82687c4ada632a5c8a8d7f9bdc338b3 to your computer and use it in GitHub Desktop.
Shell wrapper for exec-ing into a kubernetes container with friendly terminal settings
#!/bin/sh
if [ "$1" = "" ]; then
echo "Usage: kshell <pod>"
exit 1
fi
COLUMNS=`tput cols`
LINES=`tput lines`
TERM=xterm
kubectl exec -i -t $@ 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