Question

How to resize Kubernetes cluster?

We followed the starter kit to kick start our cluster and I have a couple of questions.

#1 We bootstrapped the cluster following this: https://github.com/digitalocean/Kubernetes-Starter-Kit-Developers/tree/main/15-automate-with-terraform-flux#step-2---bootstrapping-doks-and-flux-cd However, initially created a cluster with 2 nodes.

What is the correct way to resize the cluster? Do I simply update the main.tf and apply the changes? Will it destroy anything in the cluster?

#2 After automating everything and having everything setup I took a quick look at the Compute Resource dashboard. Similar to this. And it appears that I am at 147% of CPU Limits Commitment before I even started. Digging a bit deeper, it looks like flus-system consumes up to 4 cpu’s. + ambassador up to 2. In our case, it is more than half of the cluster (we have a simple app). Of course, we can resize the cluster, but is that expected?

UPDATE If I try to update main.tf to 3 nodes and run: terraform plan -out priz_prod_cluster.out

I am getting the following error.


│ Error: Error retrieving Kubernetes cluster: GET https://api.digitalocean.com/v2/kubernetes/clusters/f9883560-f07a-4e54-9520-97f3210cb47b: 401 Unable to authenticate you
│
│   with module.doks_flux_cd.digitalocean_kubernetes_cluster.primary,
│   on .terraform/modules/doks_flux_cd/create-doks-with-terraform-flux/main.tf line 39, in resource "digitalocean_kubernetes_cluster" "primary":
│   39: resource "digitalocean_kubernetes_cluster" "primary" {
│
╵

All my keys and environment variables are updated and correct.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!