Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/zsh
- app=$1
- container=$app
- cmd="/bin/bash"
- if [[ $2 ]]; then container=$2; fi
- if [[ $container == "nginx" ]]; then cmd='/bin/sh'; fi
- pod=$(kubectl get pods | grep $app | head -1 | ruby -ne 'puts $_.split(" ")[0]')
- kubectl exec -ti $pod -c $container $cmd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement