Tonight I followed Arnold Galovics’ series on Kubernetes on Oracle Cloud and spun up a tiny ARM64 Kubernetes cluster. The really neat thing about this is that it actually all falls under their free tier, so I don’t expect to pay anything for it. In fact, their free tier might actually have enough room to launch two tiny clusters! (A better idea would be a similar cluster with larger nodes, because they presently each have a single Graviton core… so we’re talking like a fraction of a Raspberry Pi in terms of compute strength!)...
This is the reboot function from a basic script I use to perform a rolling reboot of a cluster. The way you’d use it is by looping through a list of nodes, and calling the script like ./roll.sh ${NODE}.
#!/bin/bash
# roll.sh
set -euxo pipefail
NODE=$1
ssh ${NODE} reboot
# the following blocks until the reboot begins, and then loops until we can authenticate
ssh ${NODE} dmesg -w || until ssh ${NODE} whoami
do
sleep 1s
done
If you can safely reboot more than one node at a time in your cluster, you can use threading to call the script more than once. Exercise left to the reader, but I probably will eventually enhance this myself with a loop running up to MAX_OFFLINE_NODES threads at once.
I care a lot about giving back to the open source community by way of contributing, and my code has made it to some rather high-profile projects as a result. You can find me on DN42, and I’m easy to find on the hackint IRC as bri.
I’m open to work at this time.[1] Formal résumé available upon request. Contact me.