diff --git a/main.tf b/main.tf index 28ee7a23..3e999e5f 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 {} } @@ -200,8 +200,8 @@ module "node_pools" { machine_type = each.value.machine_type fips_enabled = var.fips_enabled os_disk_size = each.value.os_disk_size - # TODO: enable with azurerm v2.37.0 - # os_disk_type = each.value.os_disk_type + os_disk_type = each.value.os_disk_type + kubelet_disk_type = each.value.kubelet_disk_type enable_auto_scaling = each.value.min_nodes == each.value.max_nodes ? false : true node_count = each.value.min_nodes min_nodes = each.value.min_nodes == each.value.max_nodes ? null : each.value.min_nodes @@ -274,11 +274,11 @@ module "message_broker" { } data "external" "git_hash" { - program = ["files/tools/iac_git_info.sh"] + program = ["${path.module}/files/tools/iac_git_info.sh"] } data "external" "iac_tooling_version" { - program = ["files/tools/iac_tooling_version.sh"] + program = ["${path.module}/files/tools/iac_tooling_version.sh"] } resource "kubernetes_config_map" "sas_iac_buildinfo" { diff --git a/modules/aks_node_pool/main.tf b/modules/aks_node_pool/main.tf index 500cd98e..a9cdd077 100755 --- a/modules/aks_node_pool/main.tf +++ b/modules/aks_node_pool/main.tf @@ -14,10 +14,10 @@ resource "azurerm_kubernetes_cluster_node_pool" "autoscale_node_pool" { proximity_placement_group_id = var.proximity_placement_group_id == "" ? null : var.proximity_placement_group_id vm_size = var.machine_type os_disk_size_gb = var.os_disk_size - # TODO: enable after azurerm v2.37.0 - # os_disk_type = var.os_disk_type - os_type = var.os_type - enable_auto_scaling = var.enable_auto_scaling + os_disk_type = var.os_disk_type + kubelet_disk_type = var.kubelet_disk_type + os_type = var.os_type == null ? null : var.os_type + enable_auto_scaling = var.enable_auto_scaling # Still in preview, revisit if needed later - https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools-preview # enable_node_public_ip = var.enable_node_public_ip node_count = var.node_count @@ -46,7 +46,8 @@ resource "azurerm_kubernetes_cluster_node_pool" "static_node_pool" { vm_size = var.machine_type os_disk_size_gb = var.os_disk_size # TODO: enable after azurerm v2.37.0 - # os_disk_type = var.os_disk_type + os_disk_type = var.os_disk_type + kubelet_disk_type = var.kubelet_disk_type os_type = var.os_type enable_auto_scaling = var.enable_auto_scaling node_count = var.node_count diff --git a/modules/aks_node_pool/variables.tf b/modules/aks_node_pool/variables.tf index e3981b8c..76856e5a 100755 --- a/modules/aks_node_pool/variables.tf +++ b/modules/aks_node_pool/variables.tf @@ -46,12 +46,17 @@ variable "os_disk_size" { default = 100 } -# TODO: enable after azurerm v2.37.0 -# variable "os_disk_type" { -# description = "The type of disk which should be used for the Operating System. Possible values are Ephemeral and Managed. Defaults to Managed. Changing this forces a new resource to be created" -# type = string -# default = "Managed" -# } +variable "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 "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" diff --git a/variables.tf b/variables.tf index 445100fb..d33d106b 100644 --- a/variables.tf +++ b/variables.tf @@ -561,13 +561,15 @@ variable "node_pools_proximity_placement" { variable "node_pools" { description = "Node pool definitions" type = map(object({ - machine_type = string - os_disk_size = number - min_nodes = string - max_nodes = string - max_pods = string - node_taints = list(string) - node_labels = map(string) + machine_type = string + os_disk_size = number + kubelet_disk_type = optional(string) + os_disk_type = optional(string) + min_nodes = string + max_nodes = string + max_pods = string + node_taints = list(string) + node_labels = map(string) })) default = {