You can scale out a Tanzu Kubernetes cluster by increasing number of control plane nodes using kubectl.

You can only scale out the control plane by increasing the number of nodes from 1 to 3. The number of control plane nodes must be odd (1 or 3). You cannot scale in (reduce) the number of control plane nodes.

Prerequisites

Procedure

  1. Switch to the namespace where the Kubernetes cluster is running.
    kubectl config use-context NAMESPACE
  2. List the Kubernetes clusters that are running in the namespace.
    kubectl get tanzukubernetescluster -n NAMESPACE
    For example:
    kubectl get tanzukubernetescluster -n tkg-cluster-ns
    The command returns the name of the clusters running, the number of control plane VMs, the number of worker nodes, software version, age, and phase. For a description of the status fields, see Tanzu Kubernetes Cluster Lifecycle Status in kubectl.
  3. Get the number of nodes running in the target cluster.
    kubectl get tanzukubernetescluster CLUSTER-NAME
    This example cluster has 1 control plane node and 3 worker nodes.
    NAME                CONTROL PLANE   WORKER   DISTRIBUTION                     AGE   PHASE
    tkg-cluster-01      1               3        v1.18.5+vmware.1-tkg.1.886c781   1d    running
    
  4. To load the cluster manifest for editing, run the command kubectl edit.
    kubectl edit tanzukubernetescluster/CLUSTER-NAME
    For example:
    kubectl edit tanzukubernetescluster/tkg-cluster-01
    The cluster manifest opens in the text editor defined by your KUBE_EDITOR or EDITOR environment variables. When you save the file, kubectl updates the manifest.
  5. Edit the spec.workers.count parameter in the cluster manifest and increase the control plane count form 1 to 3.
    ...
    controlPlane:
        count: 1
    ...
    
    ...
    ControlPlane:
        count: 3
    ...
    
  6. To apply the changes, save the file in the text editor.
    When you save the file, kubectl applies the changes to the cluster. In the background, the Virtual Machine Service on the Supervisor Cluster provisions the new worker node.
  7. To verify that the new nodes are added, run the following command.
    kubectl get tanzukubernetescluster CLUSTER-NAME
    The scaled out control plane now has 3 nodes:
    NAME                CONTROL PLANE   WORKER   DISTRIBUTION                     AGE   PHASE
    tkg-cluster-01      3               3        v1.18.5+vmware.1-tkg.1.886c781   1d    running