ungleich-tools/k8s/pssh-all-nodes.sh
Nico Schottelius e7b56339f1 ++comment
2021-11-21 11:19:19 +01:00

11 lines
285 B
Bash
Executable file

#!/bin/sh
# 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"