单纯的强制重启:
#cat restartall.sh
#!/bin/bash
nodes=$(kubectl get nodes | awk 'NR != 1{print $1}')
for node in ${nodes[@]}
do
echo "==== Shut down $node ===="
#ssh $node sudo shutdown -h 1
ssh $node shutdown -r +1 #1分钟后重启
done
单纯的强制重启:
#cat restartall.sh
#!/bin/bash
nodes=$(kubectl get nodes | awk 'NR != 1{print $1}')
for node in ${nodes[@]}
do
echo "==== Shut down $node ===="
#ssh $node sudo shutdown -h 1
ssh $node shutdown -r +1 #1分钟后重启
done