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

12 lines
285 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
tmp=$(mktemp)
kubectl get node -o name | sed 's,node/,,' > "$tmp"
#cat "$tmp"
pssh -h "$tmp" -l root -i "$@"
rm -f "$tmp"