github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/scripts/vagrant/provision/rolling_restart_dbnodes.sh (about) 1 #!/bin/bash 2 3 set -xe 4 5 export KUBECONFIG="$(kind get kubeconfig-path --name="kind")" 6 7 # Perform rolling restarts of db nodes forever. 8 NODE_NUM=0 9 while true 10 do 11 if (( NODE_NUM > 2 )); then 12 NODE_NUM=0 13 fi 14 15 $(kubectl exec test-cluster-rep$NODE_NUM-0 kill 1) || true 16 # Wait until the killed node is bootstrapped before moving on to kill the next node. 17 bootstrapped=false 18 while [ "$bootstrapped" == "false" ] 19 do 20 if kubectl exec test-cluster-rep$NODE_NUM-0 -- curl -f localhost:9002/bootstrapped; then 21 bootstrapped=true 22 fi 23 sleep 30s 24 done 25 26 NODE_NUM=$(( NODE_NUM + 1 )) 27 done