2021-11-20 10:55:14 +00:00
|
|
|
#!/bin/sh
|
2021-11-21 10:19:19 +00:00
|
|
|
# Execute commands on all hosts of the currently selected kubernetes cluster
|
|
|
|
# Do export KUBECONFIG=~/your-admin.conf before using this script
|
2021-11-20 10:55:14 +00:00
|
|
|
|
|
|
|
#set -x
|
|
|
|
|
2021-12-10 23:02:45 +00:00
|
|
|
domain=$1; shift
|
|
|
|
|
2021-11-20 10:55:14 +00:00
|
|
|
tmp=$(mktemp)
|
2021-12-10 23:02:45 +00:00
|
|
|
kubectl get node -o name | sed -e 's,node/,,' -e "s,\$,.$domain,"> "$tmp"
|
2021-11-20 10:55:14 +00:00
|
|
|
#cat "$tmp"
|
|
|
|
pssh -h "$tmp" -l root -i "$@"
|
|
|
|
rm -f "$tmp"
|