Created
June 19, 2018 08:34
-
-
Save zepptron/9635568b9d90d858daca7780feb8c4b7 to your computer and use it in GitHub Desktop.
.bashrc & .zshrc: usefull kubectl + fzf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
podlog () { | |
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}')) | |
echo kubectl logs -n ${pod[1]} ${pod[2]} | |
kubectl logs -n ${pod[1]} ${pod[2]} | |
} | |
podexec () { | |
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}')) | |
local cmd=${@:-"/bin/sh"} | |
echo kubectl exec -it --namespace ${pod[1]} ${pod[2]} $cmd | |
kubectl exec -it --namespace ${pod[1]} ${pod[2]} $cmd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment