From c4e93c32cdc0ef0216cc9f5183fdd660966cf3c4 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Wed, 18 Apr 2018 09:13:33 +0200 Subject: [PATCH] Add port forward script --- bin/kube-portforward | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 bin/kube-portforward diff --git a/bin/kube-portforward b/bin/kube-portforward new file mode 100755 index 0000000..a6f7c7b --- /dev/null +++ b/bin/kube-portforward @@ -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 "$@" + +