This page shows you how to autoscale your clusters. To learn about how the cluster autoscaler works, refer to Cluster autoscaler .
Cluster autoscaling resizes the number of nodes in a given node pool based on
the demands of your workloads. You specify minReplicas
and maxReplicas
values for each node pool in your cluster.
For an individual node pool, minReplicas
must be ≥ 1. However, the sum
of the untainted user cluster nodes at any given time must be at least 3. This
means the sum of the minReplicas
values for all autoscaled node pools, plus
the sum of the replicas
values for all non-autoscaled node pools, must be at
least 3.
Create a user cluster with autoscaling
To create a user cluster with autoscaling, add the autoscaling
field to the nodePools
section in the user cluster configuration file
.
nodePools:
- name: pool‐1
…
replicas: 3
...
autoscaling:
minReplicas: 1
maxReplicas: 5
This configuration creates a node pool with 3 replicas, and applies autoscaling with the minimum node pool size as 1 and the maximum node pool size as 5.
The minReplicas
value must be ≥ 1.
Add a node pool with autoscaling
To add a node pool with autoscaling to an existing cluster:
- Edit the user cluster configuration file to add a new node pool, and include the
autoscalingfield. Adapt the values ofminReplicasandmaxReplicasas needed.
nodePools:
- name: my-new-node-pool
…
replicas: 3
...
autoscaling:
minReplicas: 1
maxReplicas: 5
- Run the
gkectl update cluster --config <var class="edit">USER_CLUSTER_CONFIG</var> --kubeconfig <var class="edit">ADMIN_CLUSTER_KUBECONFIG</var>command.
Enable an existing node pool for autoscaling
To enable autoscaling for a node pool in an existing cluster:
-
Edit a specific
nodePoolin the user cluster configuration file, and include theautoscalingfield. Adapt the values ofminReplicasandmaxReplicasas needed.nodePools:- name: my-existing-node-pool … replicas: 3 ... autoscaling: minReplicas: 1 maxReplicas: 5

