6A3T3RRKUBP2VMR7FFQJ5RNP62LAKUYDCCYRNHSXZR3O3Z73VZ5QC
#! /usr/bin/env zsh
fn_kube_shell_context="$(choose-kube-context ${1-qa})"
kube-attach "$fn_kube_shell_context" "$(choose-kube-pod --context $fn_kube_shell_context)" ${@:2}
unset fn_kube_shell_context
#! /usr/bin/env zsh
kube-shell $@ python manage.py shell
#! /usr/bin/env zsh
# $1 context alias
# $2 pod name
# $3 optional command to execute defaults to a bash shell
# $4+ args to pass to $3
kubectl exec --stdin --tty \
--context "$1" \
"$2" \
-- "${3-/bin/bash}" "${@:4}"
#! /usr/bin/env zsh
kubectl get po --no-headers "$@" \
| fzf --select-1 --exit-0 \
| cut -f 1 -d ' '
kubectl config get-contexts --no-headers \
| grep -e " ${1-.*} " \
| fzf -1 --header "Choose a kubectl context"\
| tr -s ' ' \
| cut -d ' ' -f 2