diff --git a/main.tf b/main.tf index 4f47ce6d..55635882 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 {} } @@ -199,6 +199,8 @@ module "node_pools" { machine_type = each.value.machine_type fips_enabled = var.fips_enabled os_disk_size = each.value.os_disk_size + os_disk_type = each.value.os_disk_type + kubelet_disk_type = each.value.kubelet_disk_type auto_scaling_enabled = 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 @@ -258,11 +260,11 @@ module "netapp" { } 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 24b0106f..f1e27896 100755 --- a/modules/aks_node_pool/main.tf +++ b/modules/aks_node_pool/main.tf @@ -14,6 +14,8 @@ 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 + os_disk_type = var.os_disk_type + kubelet_disk_type = var.kubelet_disk_type os_type = var.os_type auto_scaling_enabled = var.auto_scaling_enabled node_public_ip_enabled = var.node_public_ip_enabled @@ -42,6 +44,8 @@ resource "azurerm_kubernetes_cluster_node_pool" "static_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 + os_disk_type = var.os_disk_type + kubelet_disk_type = var.kubelet_disk_type os_type = var.os_type auto_scaling_enabled = var.auto_scaling_enabled node_count = var.node_count diff --git a/modules/aks_node_pool/variables.tf b/modules/aks_node_pool/variables.tf index c0f17259..ce99d56e 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 "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" type = string diff --git a/variables.tf b/variables.tf index 1ac7515d..de5a8d74 100644 --- a/variables.tf +++ b/variables.tf @@ -549,13 +549,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 = {