Created
January 30, 2026 06:18
-
-
Save arvind-iyer/fffb3a4f38095236f6f770fc353616b0 to your computer and use it in GitHub Desktop.
kube shortcuts
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 kdesc () | |
| { | |
| local cmd_args="${@:1:$#-1}" | |
| local pod_prefix="${!#}" | |
| local item_name=$(kubectl get $cmd_args | grep -P "^$pod_prefix"| awk '{ print $1 }') | |
| kubectl describe $cmd_args $item_name | |
| } | |
| function klog () | |
| { | |
| local cmd_args="${@:1:$#-1}" | |
| local pod_prefix="${!#}" | |
| local item_name=$(kubectl get pod $cmd_args | grep -P "^$pod_prefix" | head -1 | awk '{ print $1 }') | |
| kubectl logs -f --tail 200 $cmd_args $item_name | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment