Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add OS and Kubelet disk type options. #385

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 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 @@ -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
Expand Down Expand Up @@ -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" {
Expand Down
4 changes: 4 additions & 0 deletions modules/aks_node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
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 "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
Expand Down
16 changes: 9 additions & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down