dotfiles/bin/kube-sh

9 lines
222 B
Text
Raw Permalink Normal View History

2018-02-22 12:26:29 +01:00
#!/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