Skip to content
12 changes: 12 additions & 0 deletions docs/community/community_config_vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Community-contributed configuration variables are listed in the tables below. Th

* [Spot Nodes](#spot_nodes)
* [Netapp Volume Size](#netapp_volume_size)
* [OS and Kubelet Disk Types](#os_kubelet_disk_types)

<a name="spot_nodes"></a>
## Spot Nodes
Expand Down Expand Up @@ -38,3 +39,14 @@ To control the Netapp Volume size use the below community-maintained variable li
| Name | Description | Type | Default | Release Added | Notes |
| :--- | ---: | ---: | ---: | ---: | ---: |
| community_netapp_volume_size | Size of the netapp volume | number | 0 | 10.3.0 | Zero will disable, must be smaller than the Netapp Pool. The value is given in GB |

<a name="os_kubelet_disk_types"></a>
## OS Disk Type and Kubelet Disk Type

This gives the user the ability to choose the use the local temporary storage available to some nodes for the Operating system, and or the Kubelet.
The benefit of doing this is the local temporary disk is typically a high performance type of storage medium. If the kubelet is set to use this fast storage, then local emptyDir volume can be used for workloads such as SASWORK. This configuration works well on E-series machines where there is one local temporary disk. For L-series machines with many high performance nvme drives, consider using Azure Container storage instead.

| Name | Description | Type | Default | Release Added | Notes |
| :--- | ---: | ---: | ---: | ---: | ---: |
| community_os_disk_type | (Optional) The type of disk which should be used for the Operating System. Possible values are Ephemeral and Managed. Changing this forces a new resource to be created | string | `null` | 10.3.0 | |
| community_kubelet_disk_type | (Optional) The type of disk which should be used for the Kubelet. Possible values are OS (Where the OS Disk Type is then used) and Temporary. Defaults to Managed. Changing this forces a new resource to be created | string | `null` | 10.3.0 | |
14 changes: 8 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#
provider "azurerm" {

subscription_id = var.subscription_id
client_id = var.client_id
client_secret = var.client_secret
tenant_id = var.tenant_id
partner_id = var.partner_id
use_msi = var.use_msi
subscription_id = var.subscription_id
client_id = var.client_id
client_secret = var.client_secret
tenant_id = var.tenant_id
partner_id = var.partner_id
use_msi = var.use_msi

features {}
}
Expand Down Expand Up @@ -222,6 +222,8 @@ module "node_pools" {
community_priority = each.value.community_priority
community_eviction_policy = each.value.community_eviction_policy
community_spot_max_price = each.value.community_spot_max_price
community_os_disk_type = each.value.community_os_disk_type
community_kubelet_disk_type = each.value.community_kubelet_disk_type

}

Expand Down
6 changes: 6 additions & 0 deletions modules/aks_node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ resource "azurerm_kubernetes_cluster_node_pool" "autoscale_node_pool" {
priority = var.community_priority
eviction_policy = var.community_eviction_policy
spot_max_price = var.community_spot_max_price
os_disk_type = var.community_os_disk_type
kubelet_disk_type = var.community_kubelet_disk_type

temporary_name_for_rotation = substr("t${var.node_pool_name}", 0, 12)

lifecycle {
Expand Down Expand Up @@ -68,6 +71,9 @@ resource "azurerm_kubernetes_cluster_node_pool" "static_node_pool" {
priority = var.community_priority
eviction_policy = var.community_eviction_policy
spot_max_price = var.community_spot_max_price
os_disk_type = var.community_os_disk_type
kubelet_disk_type = var.community_kubelet_disk_type

temporary_name_for_rotation = substr("t${var.node_pool_name}", 0, 12)

dynamic "linux_os_config" {
Expand Down
12 changes: 12 additions & 0 deletions modules/aks_node_pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ variable "os_disk_size" {
default = 100
}

variable "community_os_disk_type" {
description = "(Optional) The type of disk which should be used for the Operating System. Possible values are Ephemeral and Managed. Changing this forces a new resource to be created"
type = string
default = null
}

variable "community_kubelet_disk_type" {
description = "(Optional) The type of disk which should be used for the Kubelet. Possible values are OS (Where the OS Disk Type is then used) and Temporary. Defaults to Managed. Changing this forces a new resource to be created"
type = string
default = null
}

variable "os_type" {
description = "The Operating System which should be used for this Node Pool. Changing this forces a new resource to be created. Possible values are Linux and Windows. Defaults to Linux"
type = string
Expand Down
3 changes: 2 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,13 @@ variable "node_pools" {
community_priority = optional(string, "Regular")
community_eviction_policy = optional(string)
community_spot_max_price = optional(string)
community_kubelet_disk_type = optional(string)
community_os_disk_type = optional(string)
linux_os_config = optional(object({
sysctl_config = optional(object({
vm_max_map_count = optional(number)
}))
}))

}))

default = {
Expand Down