Skip to content

Instantly share code, notes, and snippets.

@tuananh
Created June 27, 2023 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuananh/ddfee6230a467de7b7a12ffb0f0cc053 to your computer and use it in GitHub Desktop.
Save tuananh/ddfee6230a467de7b7a12ffb0f0cc053 to your computer and use it in GitHub Desktop.
#!/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