Skip to content
SHC Docs

Grow by a count

The home group has home_count machines. Make it four.

~/learn/cluster/terraform.tfvars
home_region = "nbg1"
far_region = "hel1"
home_count = 4
server_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.

work
$ 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
...
work
$ tofu -chdir=learn/cluster apply -auto-approve
...
$ tofu -chdir=learn/cluster output node_names
[
"far01.learn",
"home01.learn",
"home02.learn",
"home03.learn",
"home04.learn",
]
work
$ ssh -F learn/cluster/ssh/config home01 sudo shc node ls
NAME STATE CONDITION AVAIL CLOUD LOCATION ROOM BUILD LEADER VOTER
far01.learn healthy ready active hetzner hetzner/hel1 ok 0.1.2 no no
home01.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 yes yes
home02.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 no yes
home03.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 no yes
home04.learn healthy ready active hetzner hetzner/nbg1 ok 0.1.2 no no
work
$ 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.

Next: Deployments through the provider.