azurerm_kubernetes_cluster_node_pool

Manages a Node Pool within a Kubernetes Cluster

Example Usage

This example provisions a basic Kubernetes Node Pool. Other examples of the azurerm_kubernetes_cluster_node_pool resource can be found in the ./examples/kubernetes directory within the GitHub Repository

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_kubernetes_cluster" "example" {
  name                = "example-aks1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  dns_prefix          = "exampleaks1"

  default_node_pool {
    name       = "default"
    node_count = 1
    vm_size    = "Standard_D2_v2"
  }

  service_principal {
    client_id     = "00000000-0000-0000-0000-000000000000"
    client_secret = "00000000000000000000000000000000"
  }
}

resource "azurerm_kubernetes_cluster_node_pool" "example" {
  name                  = "internal"
  kubernetes_cluster_id = azurerm_kubernetes_cluster.example.id
  vm_size               = "Standard_DS2_v2"
  node_count            = 1

  tags = {
    Environment = "Production"
  }
}

Argument Reference

The following arguments are supported:



If enable_auto_scaling is set to true, then the following fields can also be configured:

If enable_auto_scaling is set to false, then the following fields can also be configured:


A kubelet_config block supports the following:


A linux_os_config block supports the following:


A node_network_profile block supports the following:


An allowed_host_ports block supports the following:


A sysctl_config block supports the following:


A upgrade_settings block supports the following:


A windows_profile block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Kubernetes Cluster Node Pools can be imported using the resource id, e.g.

terraform import azurerm_kubernetes_cluster_node_pool.pool1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool1