Scale Up/Down
Add or remove control and worker nodes at the infrastructure and Kubernetes levels.
This guide covers scaling your cluster at both the infrastructure and Kubernetes levels.
Scale Infrastructure
Add worker nodes
Edit
terraform.tfvars– updateworker_node_types:worker_node_types = [ { type = "cx23", count = 2 }, { type = "cx33", count = 1 }, # 3 workers total, mixed types ]Apply changes:
tofu applyRegenerate Ansible inventory:
./scripts/generate-ansible-inventory.shRun Ansible playbooks on the new nodes – see Server Management (Ansible) for the full workflow.
Add replica control nodes
Same pattern using control_node_types:
control_node_types = [
{ type = "cx23", count = 2 }, # 2 replicas → 3 total control nodes
]
Then tofu apply, regenerate inventory, and run Ansible playbooks.
Remove nodes
- Drain and remove from Kubernetes first (see Remove nodes from Kubernetes below)
- Update
terraform.tfvarsto reduce node counts - Run
tofu apply
Scale Kubernetes
Join new worker nodes
After provisioning and running Ansible playbooks on new nodes, join them to the cluster. Follow Step 2 of the Kubernetes guide to run the kubeadm join command.
Remove nodes from Kubernetes
Before removing infrastructure, drain and delete the node from Kubernetes:
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
kubectl delete node <node-name>
Then update terraform.tfvars and run tofu apply to remove the infrastructure.
Examples
Master-only (no replicas, no workers)
# terraform.tfvars
master_control_node_type = "cx23"
control_node_types = []
worker_node_types = []
Add 2 workers
# terraform.tfvars
worker_node_types = [
{ type = "cx23", count = 2 },
]
Mixed server types
# terraform.tfvars
control_node_types = [
{ type = "cx23", count = 2 },
]
worker_node_types = [
{ type = "cx23", count = 2 },
{ type = "cx33", count = 1 },
]