Created
August 18, 2024 05:02
-
-
Save cnnrrss/8ccfd53f70846de469a05d4b41380ccc to your computer and use it in GitHub Desktop.
fzf tail all pods
This file contains 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
pods() { | |
command='kubectl get pods --all-namespaces' fzf \ | |
--info=inline --layout=reverse --header-lines=1 \ | |
--prompt "$(kubectl config current-context | sed 's/-context$//')> " \ | |
--header $'╱ Enter (kubectl exec) ╱ CTRL-O (open log in editor) ╱ CTRL-R (reload) ╱\n\n' \ | |
--bind 'start:reload:$command' \ | |
--bind 'ctrl-r:reload:$command' \ | |
--bind 'ctrl-/:change-preview-window(80%,border-bottom|hidden|)' \ | |
--bind 'enter:execute:kubectl exec -it --namespace {1} {2} -- bash' \ | |
--bind 'ctrl-o:execute:${EDITOR:-vim} <(kubectl logs --all-containers --namespace {1} {2})' \ | |
--preview-window up:follow \ | |
--preview 'kubectl logs --follow --all-containers --tail=10000 --namespace {1} {2}' "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment