dotfiles/bin/kube-sh
2018-02-22 12:26:29 +01:00

8 lines
222 B
Bash
Executable file

#!/bin/bash
set -xe
ns=$1
shift
selector="$@"
pod=$(kubectl get pods --namespace=$ns $selector -o template --template="{{with index .items 0}}{{.metadata.name}}{{end}}")
exec kubectl --namespace=$ns exec -ti $pod /bin/sh