Grow by a count
The home group has home_count machines. Make it four.
home_region = "nbg1"far_region = "hel1"home_count = 4server_type = "cx23"shc_version = "0.1.2"The plan adds the machine, its place on the private network and its
shc_node, rewrites the SSH configuration file and puts the new server on
the home group’s firewall.
$ tofu -chdir=learn/cluster plan... # local_file.ssh_config must be replaced... # module.shc.hcloud_server.node["home04.learn"] will be created... # module.shc.module.core[0].shc_node.workers["home04.learn"] will be created...$ tofu -chdir=learn/cluster apply -auto-approve...$ tofu -chdir=learn/cluster output node_names[ "far01.learn", "home01.learn", "home02.learn", "home03.learn", "home04.learn",]$ ssh -F learn/cluster/ssh/config home01 sudo shc node lsNAME STATE CONDITION AVAIL CLOUD LOCATION ROOM BUILD LEADER VOTERfar01.learn healthy ready active hetzner hetzner/hel1 ok 0.1.2 no nohome01.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 yes yeshome02.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 no yeshome03.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 no yeshome04.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 no no$ ssh -F learn/cluster/ssh/config home04 sudo shc node status...Five nodes. The new one joined the same way the first three did, and the voter set stayed at three. Shrinking is the same edit the other way: a lower count plans the removal of the highest-numbered machines of the group, and each one leaves the cluster before its machine is deleted.
shc@docs:~$