Creating Worker Nodes
Learn how to create worker nodes and view them using Terraform.
Defining worker nodes
We can manage worker nodes through the google_container_node_pool module. We’ve prepared yet another definition that we can use.
Explaining the output
Press + to interact
resource "google_container_node_pool" "primary_nodes" {name = var.cluster_namelocation = var.regioncluster = google_container_cluster.primary.nameversion = var.k8s_versionnode_config {preemptible = var.preemptiblemachine_type = var.machine_typeoauth_scopes = ["https://www.googleapis.com/auth/cloud-platform"]}autoscaling {min_node_count = var.min_node_countmax_node_count = var.max_node_count}management {auto_upgrade = false}timeouts {create = "15m"update = "1h"}}
That definition is a bit bigger than the ones we’ve used before. There are more things we might want to define for worker nodes, so that definition has a few more fields than others.
-
Lines 2–4: ...
Get hands-on with 1400+ tech skills courses.