Reputation: 79
Could anyone kindly explain the node_count
Terraform argument below (from here)?
node_count
- (Optional) The number of nodes per instance group. This field can be used to update the number of nodes per instance group but should not be used alongside autoscaling
.
What does "per instance group" mean?
Why shouldn't node_count
be used alongside autoscaling
?
Is there a way to control autoscaling triggers for the resource google_container_node_pool
?
Upvotes: 2
Views: 736
Reputation: 56869
It's not per "instance" but per "instance group". If you're coming from AWS it's like an auto scaling group. You can read more about it in GCP's documentation for instance groups.
You're basically being given the choice between a static amount of instances in the node pool (by using the node_count
parameter) or to allow the node pool to automatically scale and set the min and max size of the node pool via the autoscaling.min_node_count
and autoscaling.max_node_count
parameters.
With a container node pool the point is that you are running this to provide compute for containers running on Kubernetes via GKE. In Kubernetes, the cluster autoscaler is responsible for scaling compute to support the demand from the containers that are running or pending so that is what will scale out the size of the node pool.
Upvotes: 1