Creating Worker Nodes
Understand how to define and manage worker node pools in AKS clusters using Terraform. This lesson guides you through creating additional node pools, adjusting VM sizes, enabling auto-scaling, and removing resources, ensuring you can maintain desired cluster states effectively.
We'll cover the following...
We'll cover the following...
Defining worker nodes
We can manage worker node pools (beyond the default one) through the azurerm_kubernetes_cluster_node_pool module. We’ve prepared yet another definition that we can use.
Explaining the output
- Line 2: We define the name of the node pool.
- Line 3: We define the ID of the Kubernetes cluster (
kubernetes_cluster_id). Instead of hard-coding it or setting to a value, we’re telling Terraform to use the ID field of theazurerm_kubernetes_cluster.primaryresource. - Lines 4–7: Further on, we have the size of the VMs (
vm_size), whether auto-scaling should be enabled (enable_auto_scaling), and the maximum (