Created
February 22, 2019 02:56
-
-
Save leoh0/dc83cb34dce4cbec96954321a352079e to your computer and use it in GitHub Desktop.
stern search & select label
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
| function sss () | |
| { | |
| pods=$(kubectl get pods --all-namespaces \ | |
| --no-headers --show-labels | \ | |
| sed '1d' | \ | |
| fzf -x -m -e +s --reverse --no-mouse \ | |
| --bind=left:page-up,right:page-down | \ | |
| awk '{print $1" "$7}'); | |
| if [[ $pods != "" ]]; then | |
| namespace=${pods/ *}; | |
| label=${pods/* }; | |
| stern -t -n "$namespace" -l "$label"; | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment