Created
September 12, 2019 09:56
-
-
Save half2me/ef8e7f41126e93c0c505f13d14426912 to your computer and use it in GitHub Desktop.
run a command on kubernetes pod by deployment name
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
k8exec() { | |
local pod=$1 | |
shift | |
kubectl exec -it $(kubectl get pods -o name | grep -m1 $pod | cut -d'/' -f 2) -- $@ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment