Forum breadcrumbs – You are here:Tracston Community Forum – DevOps, Micro Services, Cloud, Infrastructure, Development, Monitoring and more…DevOps / Micro Services / Automation: Kubernetes & Helm Chartsscripting shell commands on multi …
You need to log in to create posts and topics.
scripting shell commands on multiple containers

moshe@moshe
#1 · 03/12/2020, 3:26 pm
Quote from moshe on 03/12/2020, 3:26 pmProblem
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
Problem
User wants to execute multiple commands and get the results
Solution
Uploaded files:#!/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
Click for thumbs down.0Click for thumbs up.0