Version 1.6. This version is supported as outlined in the Anthos version support policy, offering the latest patches and updates for security vulnerabilities, exposures, and issues impacting Anthos clusters on VMware (GKE on-prem). Refer to the release notes for more details. This is not the most recent version.

Resizing a user cluster

This page describes how to resize an Anthos clusters on VMware (GKE on-prem) user cluster. Resizing a user cluster means adding or removing nodes from that cluster. Removing nodes from a cluster should release that cluster's IP addresses, making them available for use by other nodes. Adding nodes requires that IP addresses are available for those nodes.

You resize a user cluster by changing the replicas fields in the nodePools section of your configuration file and deploying those changes to your existing cluster with the gkectl update cluster command.

For information on maximum and minimum limits for user clusters, refer to Quotas and limits.

For information on managing node pools with gkectl update cluster, refer to creating and managing node pools.

Verify that enough IP addresses are available

If you are adding additional nodes to a cluster, be sure that the cluster has enough IP addresses. Verifying that you have enough IP addresses depends on whether the cluster uses a DHCP server or static IPs.

DHCP

If the cluster uses DHCP, check that the DHCP server in the network in which the nodes are created has enough IP addresses. There should be more IP addresses than there are nodes running in the user cluster.

Static IPs

If the cluster uses static IPs, running gkectl update cluster first verifies whether you've allocated enough IP addresses in the cluster. If not, you can find the number of extra IP addresses needed for the update operation in the error message.

If you need to add more IP addresses to the user cluster, perform the following steps:

  1. Open the user cluster's hostconfig file for editing.

  2. Verify that all of the IP addresses reserved for a user cluster are included in the hostconfig file because gkectl update cluster only support adding static IPs to user cluster.

  3. To view the addresses reserved for a user cluster:

    kubectl get cluster --kubeconfig [ADMIN_CLUSTER_KUBECONFIG] 
    -n [USER_CLUSTER_NAME] [USER_CLUSTER_NAME] -o yaml
    where:

    • [ADMIN_CLUSTER_KUBECONFIG] tells kubectl to use the admin cluster's kubeconfig, which is used to view and/or change user cluster configurations.
    • -n [USER_CLUSTER_NAME] tells kubectl to look in a namespace named after the user cluster.
    • [USER_CLUSTER_NAME] -o yaml tells kubectl which user cluster you're running the command against. -o yaml displays the user cluster's configuration.
  4. If any of the addresses reserved for a user cluster is missing in the hostconfig file, add them to the corresponding block based on netmask and gateway.

  5. Add as many additional static IP addresses to the corresponding block as required, and then run gkectl update cluster.

Below is an example hostconfig file with its four static IP blocks highlighted:

hostconfig:
  dns: 172.16.255.1
  tod: 216.239.35.0
blocks:
- netmask: 255.255.248.0
  gateway: 21.0.135.254
  ips:
    - ip: 21.0.133.41
      hostname: user-node-1
    - ip: 21.0.133.50
      hostname: user-node-2
    - ip: 21.0.133.56
      hostname: user-node-3
    - ip: 21.0.133.47
      hostname: user-node-4

Resizing a user cluster

Starting from 1.5.0, you resize a cluster by changing the replicas fields in the nodePools section of your configuration file and deploying those changes to your existing cluster with the gkectl update cluster command.

Verify resize

To verify that the resize was successful, run:

kubectl --kubeconfig [USER_CLUSTER_KUBECONFIG] get nodes
kubectl --kubeconfig [USER_CLUSTER_KUBECONFIG] describe machinedeployments [NODE_POOL_NAME] | grep Replicas

where [USER_CLUSTER_KUBECONFIG] is the kubeconfig file of your user cluster. The number of nodes you chose should be reflected in these commands' output.

Troubleshooting

See Troubleshooting cluster creation and upgrade.