From 7b92f4b49cc42d005fb1273587323457d224732c Mon Sep 17 00:00:00 2001 From: Josh Mize Date: Mon, 6 Jan 2020 15:20:18 -0600 Subject: [PATCH] Add k8s-forward --- .bash_functions.d/k8s | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bash_functions.d/k8s b/.bash_functions.d/k8s index aa99994..0a8ff01 100644 --- a/.bash_functions.d/k8s +++ b/.bash_functions.d/k8s @@ -54,6 +54,10 @@ k8s-bash() { k8s-exec $1 $2 bash } +k8s-forward(){ + kubectl port-forward $(k8s-pod $1) $2 +} + k8s-r00t() { # https://mobile.twitter.com/mauilion/status/1129468485480751104 kubectl run r00t --restart=Never -ti --rm --image lol --overrides '{"spec":{"hostPID": true, "containers":[{"name":"1","image":"alpine","command":["nsenter","--mount=/proc/1/ns/mnt","--","/bin/bash"],"stdin": true,"tty":true,"securityContext":{"privileged":true}}]}}'