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 +}