Skip to content

Instantly share code, notes, and snippets.

@half2me
Created Sep 12, 2019
Embed
What would you like to do?
run a command on kubernetes pod by deployment name
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