Add port forward script
This commit is contained in:
parent
769cde53a9
commit
c4e93c32cd
1 changed files with 8 additions and 0 deletions
8
bin/kube-portforward
Executable file
8
bin/kube-portforward
Executable 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 "$@"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue