ungleich-tools/k8s/pssh-all-nodes.sh

14 lines
325 B
Bash
Raw Normal View History

#!/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
#set -x
2021-12-10 23:02:45 +00:00
domain=$1; shift
tmp=$(mktemp)
2021-12-10 23:02:45 +00:00
kubectl get node -o name | sed -e 's,node/,,' -e "s,\$,.$domain,"> "$tmp"
#cat "$tmp"
pssh -h "$tmp" -l root -i "$@"
rm -f "$tmp"