From aa0ec75209f2547e2fc6ddcc12ebe2fb8109535a Mon Sep 17 00:00:00 2001 From: Vincent Composieux Date: Sun, 16 Dec 2018 11:08:31 +0100 Subject: [PATCH] Added new kforward function to forward Kubernetes ports to local --- .functions | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.functions b/.functions index 61b6a52..f0aada8 100644 --- a/.functions +++ b/.functions @@ -370,3 +370,10 @@ function rabbitgraph { done | \ jplot --steps 1200 ready+unacked+total+consumers+publish_rate+ack_rate+redeliver_rate } + +# Kubernetes port-forward alias +# Usage: kforward context namespace pod-name ports +function kforward { + podName=`kubectl get pods -n $2 --context $1 | grep $3 | cut -d' ' -f1` + kubectl port-forward --context=$1 -n $2 $podName $4 +}