Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save madalinignisca/0f1a7025a89fc3eaff6a511ec00e3953 to your computer and use it in GitHub Desktop.
Save madalinignisca/0f1a7025a89fc3eaff6a511ec00e3953 to your computer and use it in GitHub Desktop.
How to change KubeOne Kubernetes Control Planes size

Original

Scaling up the control plane nodes is a bit more complicated. That's because the worker nodes can be easily replaced and/or powered off, but that's not the case for the control plane nodes.

In this case, you can't rely on Terraform to scale up the control plane nodes for you, because Terraform would power off all control plane nodes at the same time, which could make etcd lose the quorum (in that case your cluster would be corrupt/lost).

I haven't tested it, but I think you might have success if you do something like this:

Drain one of the control plane nodes (kubectl drain ) SSH to that node and power it off (sudo poweroff) Login to Hetzner Control Panel and scale up/down the instance Power on the instance after scaling it Wait for the node to come up Make sure kubectl get nodes returns Ready for that node Just to make sure, check etcd logs for that node (run kubectl get pods -n kube-system and then find the etcd pod for the node you restarted (each etcd pod has the node hostname in its name)) Repeat the steps for the remaining two control plane nodes (make sure that you do it for only one node at a time) After completing all steps for all control plane nodes, update the instance size in terraform.tfvars file Run terraform refresh to update your Terraform state with the changes you did manually Run terraform plan and make sure that it doesn't propose any additional changes Note that some providers might not allow you to scale down beyond the size you used when creating the instance. I think Hetzner might allow you to scale down, but if that's not the case, you'll have to use a different approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment