diff --git a/bin/kube-setns b/bin/kube-setns new file mode 100755 index 0000000..5ac0619 --- /dev/null +++ b/bin/kube-setns @@ -0,0 +1,3 @@ +#!/bin/bash +set -xeuo pipefail +kubectl config set-context $(kubectl config current-context) --namespace "$1" diff --git a/bin/kube-sh b/bin/kube-sh new file mode 100755 index 0000000..afef6a2 --- /dev/null +++ b/bin/kube-sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -xe +ns=$1 +shift +selector="$@" +pod=$(kubectl get pods --namespace=$ns $selector -o template --template="{{with index .items 0}}{{.metadata.name}}{{end}}") +exec kubectl --namespace=$ns exec -ti $pod /bin/sh +