Tanzu Mission Control -Resize ClustersMarch 10, 2020
A pretty common task that a Kubernetes administrator must do is to resize the cluster. We need more nodes to handle more workloads, or we’ve overprovisioned a cluster and are trying to save costs. This usually took some custom automation scripts such as node autoscaler, or it was done manually based on request.
Tanzu Mission Control can resize our cluster very simply from the TMC portal.
Scale Out a Cluster
Within the TMC Portal, find the cluster that needs to be resized. Within the cluster screen, find the “Node pools” menu. Node pools define the worker nodes that are part of the Kubernetes cluster thats been deployed.
In this screen, I have a default node pool which is the worker nodes I originally deployed. I COULD edit that pool and simply modify the number of nodes. This would adjust the worker nodes in my cluster accordingly. For this example though, I’ll create a new node pool which will adjust my worker nodes, but will configure basically create a new group of worker nodes. Maybe they are different size, or need different tags or something.
As you can see I’ve created a new node pool and specified the size and number of nodes. I also added two sets of tags. Note that there are two sets of options here:
Node Label – Labels seen within the Kubernetes cluster.
Cloud label – Tags applied to the AWS instances.
When I’ve got it setup the way I want, click save. As soon as I click save, TMC starts to provision my additional pool and add it to the Kubernetes clusters.
After a few minutes the nodes have been deployed and added to the cluster. As you can see the cluster below shows all my nodes, and a second kubectl command lists only the nodes with the Node Label I specified for the new pool.
Likewise in the AWS console, I can see a different tag for the Cloud Label listed on those instances.
Scale In a Cluster
OK, that was fun, but we’re pretty worried about costs. Go in and edit your nodes to reduce the total size of the cluster now. I will do two actions.
- Delete my new hollow-pool1 node pool.
- reduce the size of the default-node-pool from 3 nodes to 2
First, we’ll delete the recently added node pool.
Click Delete and accept the confirmation.
Next, go to the default node pool and click edit, to change the number of worker nodes from 3 to 2.
After a few minutes your cluster should match your desired state, configured within TMC.
For this example cluster, we started with six total nodes (including the control plane nodes), added two nodes in a new pool, and then deleted that pool and one additional node from the default pool for a total of five nodes left running.