Skip to content

Commit

Permalink
Added new kforward function to forward Kubernetes ports to local
Browse files Browse the repository at this point in the history
  • Loading branch information
eko committed Dec 16, 2018
1 parent cbd130e commit aa0ec75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .functions
Expand Up @@ -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
}

0 comments on commit aa0ec75

Please sign in to comment.