To enable autoscaling for an existing node pool, run the following command:
gcloud container clusters update [CLUSTER_NAME] --enable-autoscaling \ --min-nodes 1 --max-nodes 10 --zone [COMPUTE_ZONE] --node-pool default-pool
In this command:
-
--enable-autoscaling indicates that autoscaling is enabled.
-
--node-pool specifies the node pool for which autoscaling is enabled.
-
--min-nodes specifies the minimum number of nodes for the node pool.
-
--max-nodes specifies the maximum number of nodes for the node pool.
-
--zone specifies the cluster's [compute zone].
-
--node-pool specifies the desired node pool. If you have only one node pool, supply default-pool to this flag.