Exec command in all pods kubectl

Run a command in every pod matching a label selector

kubectl get pods -n <ns> -l app=<label> -o name | xargs -I{} kubectl exec {} -n <ns> -- <cmd>
more kubectl all 73 commands →