Complete the code to specify the minimum number of nodes in a node pool.
resource "google_container_node_pool" "primary_nodes" { name = "primary-node-pool" cluster = google_container_cluster.primary.name node_count = [1] }
The node_count sets the number of nodes in the pool. It must be a positive integer, like 3.
Complete the code to enable autoscaling for the node pool.
resource "google_container_node_pool" "autoscaling_pool" { name = "autoscale-pool" cluster = google_container_cluster.primary.name autoscaling { min_node_count = 1 max_node_count = [1] } }
The max_node_count must be greater than or equal to min_node_count. 5 is a reasonable max.
Fix the error in the autoscaling block by completing the missing field.
resource "google_container_node_pool" "fixed_pool" { name = "fixed-pool" cluster = google_container_cluster.primary.name autoscaling { [1] = 2 max_node_count = 5 } }
The autoscaling block requires min_node_count to set the minimum nodes allowed.
Fill both blanks to configure autoscaling with a minimum of 2 nodes and a maximum of 6 nodes.
resource "google_container_node_pool" "scale_pool" { name = "scale-pool" cluster = google_container_cluster.primary.name autoscaling { min_node_count = [1] max_node_count = [2] } }
Set min_node_count to 2 and max_node_count to 6 to allow scaling between these limits.
Fill all three blanks to create a node pool with autoscaling enabled, minimum 1 node, maximum 4 nodes, and initial node count 2.
resource "google_container_node_pool" "full_pool" { name = "full-pool" cluster = google_container_cluster.primary.name initial_node_count = [1] autoscaling { min_node_count = [2] max_node_count = [3] } }
Set initial_node_count to 2, min_node_count to 1, and max_node_count to 4 for proper autoscaling setup.