Add port forward script

This commit is contained in:
Daniel Lundin 2018-04-18 09:13:33 +02:00 committed by Daniel Lundin
parent 769cde53a9
commit c4e93c32cd

8
bin/kube-portforward Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -xeuo pipefail
selector="$1"
shift
pod=$(kubectl get pods -l ${selector} --field-selector=status.phase=Running -o template --template="{{with index .items 0}}{{.metadata.name}}{{end}}")
kubectl port-forward $pod "$@"