After you create a Tanzu Kubernetes cluster, you can scale it up or down by increasing or reducing the number of node VMs that it contains. To scale a cluster, use the
tkg scale cluster command. You change the number of control plane nodes by specifying the
--controlplane-machine-count option. You change the number of worker nodes by specifying the
NOTE: If you deployed Tanzu Kubernetes clusters to vSphere 7.0 with Kubernetes, you can only scale the number of worker nodes upwards. You cannot scale down the number of worker nodes on vSphere 7 with Kubernetes. You cannot scale the number of control plane nodes either up or down on clusters that run in vSphere 7 with Kubernetes.
To scale a cluster that you originally deployed with 3 control plane nodes and 5 worker nodes to 5 and 10 nodes respectively, run the following command:
tkg scale cluster cluster_name --controlplane-machine-count 5 --worker-machine-count 10
If you initially deployed a cluster with
--controlplane-machine-count 1 and then you scale it up to 3 control plane nodes, Tanzu Kubernetes Grid automatically enables stacked HA on the control plane.
If the cluster in running in a namespace other than the
default namespace, you must specify the
--namespace option to scale that cluster.
tkg scale cluster cluster_name --controlplane-machine-count 5 --worker-machine-count 10 --namespace=my-namespace
IMPORTANT: Do not change context or edit the
kubeconfig file while Tanzu Kubernetes Grid operations are running.