Created
March 15, 2021 08:41
-
-
Save marcelbirkner/6d86db6765b406e3e716c10d5b7b9547 to your computer and use it in GitHub Desktop.
Execute command on all running Kubernetes pods
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/bash | |
for POD in $(kubectl get pods --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') | |
do | |
kubectl exec -it ${POD} -- ps aux | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment