0
0
GCPcloud~10 mins

Node pools and auto scaling in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the minimum number of nodes in a node pool.

GCP
resource "google_container_node_pool" "primary_nodes" {
  name       = "primary-node-pool"
  cluster    = google_container_cluster.primary.name
  node_count = [1]
}
Drag options to blanks, or click blank then click option'
A3
B0
C10
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a negative number for node_count
Setting node_count to zero which disables the pool
2fill in blank
medium

Complete the code to enable autoscaling for the node pool.

GCP
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]
  }
}
Drag options to blanks, or click blank then click option'
A5
B0
C-3
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Setting max_node_count less than min_node_count
Using negative numbers for max_node_count
3fill in blank
hard

Fix the error in the autoscaling block by completing the missing field.

GCP
resource "google_container_node_pool" "fixed_pool" {
  name       = "fixed-pool"
  cluster    = google_container_cluster.primary.name
  autoscaling {
    [1] = 2
    max_node_count = 5
  }
}
Drag options to blanks, or click blank then click option'
Anode_count
Bmin_node_count
Cmax_node_count
Dinitial_node_count
Attempts:
3 left
💡 Hint
Common Mistakes
Using node_count inside autoscaling block
Omitting min_node_count causes errors
4fill in blank
hard

Fill both blanks to configure autoscaling with a minimum of 2 nodes and a maximum of 6 nodes.

GCP
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]
  }
}
Drag options to blanks, or click blank then click option'
A2
B6
C10
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping min and max values
Setting min higher than max
5fill in blank
hard

Fill all three blanks to create a node pool with autoscaling enabled, minimum 1 node, maximum 4 nodes, and initial node count 2.

GCP
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]
  }
}
Drag options to blanks, or click blank then click option'
A1
B2
C4
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting initial_node_count outside min-max range
Using max_node_count less than min_node_count