Created
June 27, 2023 10:03
-
-
Save tuananh/ddfee6230a467de7b7a12ffb0f0cc053 to your computer and use it in GitHub Desktop.
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
#!/bin/env bash | |
result=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" | fzf) | |
if [ $# -eq 0 ] | |
then | |
echo "kubectl exec -it $result /bin/bash" | |
kubectl exec -it "$result" /bin/bash | |
fi | |
if [ $# -eq 1 ] | |
then | |
echo "kubectl exec -it $result $1" | |
kubectl exec -it "$result" "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment