diff --git a/docs/community/community_config_vars.md b/docs/community/community_config_vars.md index cc12e643..063def4b 100644 --- a/docs/community/community_config_vars.md +++ b/docs/community/community_config_vars.md @@ -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) ## Spot Nodes @@ -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 | + + +## 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 | | diff --git a/main.tf b/main.tf index 96d4594d..8bab4232 100644 --- a/main.tf +++ b/main.tf @@ -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 {} } @@ -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 } diff --git a/modules/aks_node_pool/main.tf b/modules/aks_node_pool/main.tf index 5d4b55d5..47a4bb9b 100755 --- a/modules/aks_node_pool/main.tf +++ b/modules/aks_node_pool/main.tf @@ -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 { @@ -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" { diff --git a/modules/aks_node_pool/variables.tf b/modules/aks_node_pool/variables.tf index 03b40c04..40d9e229 100755 --- a/modules/aks_node_pool/variables.tf +++ b/modules/aks_node_pool/variables.tf @@ -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 diff --git a/variables.tf b/variables.tf index 4fa3574b..fe94c9ad 100644 --- a/variables.tf +++ b/variables.tf @@ -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 = {