Last active
August 4, 2024 17:20
-
-
Save wittawasw/6ce1fd3226fbc125015e44713fbabd99 to your computer and use it in GitHub Desktop.
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
function ks() { | |
kgpo | awk 'NR>1 {print $1}' | grep "$1" | while read -r POD_NAME; do | |
echo "$POD_NAME" | |
done | |
} | |
function krrm() { | |
kgpo | awk 'NR>1 {print $1}' | grep "$1" | while read -r POD_NAME; do | |
krm pod "$POD_NAME" | |
echo "Pod $POD_NAME restarted." | |
done | |
} | |
function ke() { | |
POD_NAME=$(kgpo | awk 'NR>1 {print $1}' | grep "$1" | head -n 1) | |
if [ -z "$2" ]; then | |
k exec -it "$POD_NAME" -- /bin/sh | |
else | |
shift | |
k exec -it "$POD_NAME" -- "$@" | |
fi | |
} | |
function kl() { | |
POD_NAME=$(kgpo | awk 'NR>1 {print $1}' | grep "$1" | head -n 1) | |
if [ "$2" = "-f" ]; then | |
k logs -f "$POD_NAME" | |
else | |
k logs "$POD_NAME" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment