Created
May 16, 2016 17:00
-
-
Save spacepluk/18e5567c208ccadbe2003cb96e03b59c to your computer and use it in GitHub Desktop.
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
| command() { | |
| local pods=($(IFS=$' ' get-podnames $1)) | |
| local cmd=${2:-bash} | |
| local tmux_pane=$TMUX_PANE | |
| local i=0 | |
| for pod in ${pods[*]}; do | |
| if [ -z "$TMUX" ]; then | |
| kubectl exec -i -t $pod -- "$cmd" | |
| else | |
| echo tmux split-window -p $((100 / ( ${#pods[@]} - $i))) "kubectl exec -i -t $pod -- $cmd" | |
| tmux split-window -p $((100 / (${#pods[@]} - $i))) "kubectl exec -i -t $pod -- $cmd" | |
| tmux select-pane -t $TMUX_PANE | |
| i=$((i + 1)) | |
| fi | |
| done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment