Read-only archive. These discussions are from Tracston's earlier
technical forum and are kept online because the answers are still useful.
New replies are closed. Need help with something like this?
Talk to us.
Question
3 Dec 2020
Problem
User wants to execute multiple commands and get the results
Solution
#!/bin/sh
for i in $(kubectl get pods -n tracston | awk '{print $1}'); do
echo "$i"
kubectl exec -it $i -n tracston -- bash -c "env | grep TZ"
done
Attachment: exec_multi_commands.txt
Need this fixed properly?
We do this for a living.
Kubernetes, DevOps and platform engineering, delivered in days — not another weekend lost to a stack trace.
Start a project →