Scaling Existing Clusters

Page last updated:

This topic explains how to scale an existing cluster horizontally by adding worker nodes and vertically by changing the size of the node VMs.

Scale Horizontally by Changing the Number of Worker Nodes Using the PKS CLI

Follow the steps below to scale an existing cluster using the PKS CLI by increasing or decreasing the number of worker nodes.

  1. On the command line, run the following command to log in:

    pks login -a PKS-API -u USERNAME -k
    
    Where:

    • PKS-API is the domain name for the PKS API that you entered in Ops Manager > Enterprise PKS > PKS API > API Hostname (FQDN). For example, api.pks.example.com.
    • USERNAME is your user name.

      See Logging in to Enterprise PKS for more information about the pks login command.

      Note: If your operator has configured Enterprise PKS to use a SAML identity provider, you must include an additional SSO flag to use the above command. For information about the SSO flags, see the section for the above command in PKS CLI. For information about configuring SAML, see Configure SAML as an Identity Provider in the Installing topic for your IaaS.

  2. To view the current number of worker nodes in your cluster, run the following command:

    pks cluster CLUSTER-NAME
    

    Where CLUSTER-NAME is the name of your cluster.

  3. Run the following command:

    pks resize CLUSTER-NAME --num-nodes NUMBER-OF-WORKER-NODES
    

    Where:

    • CLUSTER-NAME is the name of your cluster.
    • NUMBER-OF-WORKER-NODES is the number of worker nodes you want to set for the cluster.
      • To scale down your existing cluster, enter a number lower than the current number of worker nodes.
      • To scale up your existing cluster, enter a number higher than the current number of worker nodes. The maximum number of worker nodes you can set is configured in the Plan pane of the Enterprise PKS tile in Pivotal Ops Manager.

    For example:

    $ pks resize my-cluster --num-nodes 5
    

    Note: This command may roll additional virtual machines in the cluster, which can affect workloads if the worker nodes are at capacity.

Scale Vertically by Changing Cluster Node VM Sizes in the PKS Tile

You can scale an existing cluster vertically by changing the size of the master or worker node VMs. When this is done, BOSH will recreate the VMs sequentially, one cluster at a time, and one node after another within the cluster. See VM Sizing for PKS Clusters for more information.

To change the size of a Kubernetes cluster node VM, complete the following steps:

  1. Log in to Ops Manager.
  2. Select the PKS tile.
  3. Select the plan that is in use by the cluster(s) you want to resize.
  4. To change the VM size:
    • For Master nodes, select the desired VM size from the Master/ETCD VM Type menu.
    • For Worker nodes, select the desired VM size from the Worker VM Type menu.

      Note: See Customize Master and Worker Node VM Size and Type for information on creating a custom VM size for use with a PKS cluster.

  5. Click Save to preserve tile changes.
  6. At the Installation Dashboard, click Review Pending Changes.
  7. For the PKS tile, expand the ERRANDS list.
  8. Select the Update all clusters errand if it is not already selected. You must ensure that Update all clusters errand is selected so that the cluster deployment manifest is regenerated after the plan is updated.

  9. Click Apply Changes.


Please send any feedback you have to pks-feedback@pivotal.io.