Skip to content

Commit

Permalink
Added configurable disk size for all node groups (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
amarin-dspace authored May 27, 2024
1 parent 4bae25a commit 4873c71
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.86.0"
version = "3.92.0"
}
random = {
version = "3.5.1"
Expand All @@ -29,16 +29,19 @@ module "simphera_base" {
infrastructurename = var.infrastructurename
tags = var.tags
linuxNodeSize = var.linuxNodeSize
linuxNodeDiskSize = var.linuxNodeDiskSize
linuxNodeCountMin = var.linuxNodeCountMin
linuxNodeCountMax = var.linuxNodeCountMax
linuxExecutionNodeSize = var.linuxExecutionNodeSize
linuxExecutionNodeDiskSize = var.linuxExecutionNodeDiskSize
linuxExecutionNodeCountMin = var.linuxExecutionNodeCountMin
linuxExecutionNodeCountMax = var.linuxExecutionNodeCountMax
linuxExecutionNodeDeallocate = var.linuxExecutionNodeDeallocate
gpuNodePool = var.gpuNodePool
gpuNodeCountMin = var.gpuNodeCountMin
gpuNodeCountMax = var.gpuNodeCountMax
gpuNodeSize = var.gpuNodeSize
gpuNodeDiskSize = var.gpuNodeDiskSize
gpuNodeDeallocate = var.gpuNodeDeallocate
ssh_public_key_path = var.ssh_public_key_path
licenseServer = var.licenseServer
Expand Down
6 changes: 3 additions & 3 deletions modules/simphera_base/k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resource "azurerm_kubernetes_cluster" "aks" {
min_count = var.linuxNodeCountMin
max_count = var.linuxNodeCountMax
enable_auto_scaling = true
os_disk_size_gb = 128
os_disk_size_gb = var.linuxNodeDiskSize
type = "VirtualMachineScaleSets"
max_pods = 110
vnet_subnet_id = azurerm_subnet.default-node-pool-subnet.id
Expand Down Expand Up @@ -119,7 +119,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "execution-nodes" {
name = "execnodes"
mode = "User"
orchestrator_version = var.kubernetesVersion
os_disk_size_gb = 128
os_disk_size_gb = var.linuxExecutionNodeDiskSize
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id
min_count = var.linuxExecutionNodeCountMin
max_count = var.linuxExecutionNodeCountMax
Expand Down Expand Up @@ -156,7 +156,7 @@ resource "azurerm_kubernetes_cluster_node_pool" "gpu-execution-nodes" {
name = "gpuexecnodes"
mode = "User"
orchestrator_version = var.kubernetesVersion
os_disk_size_gb = 128
os_disk_size_gb = var.gpuNodeDiskSize
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id
min_count = var.gpuNodeCountMin
max_count = var.gpuNodeCountMax
Expand Down
18 changes: 18 additions & 0 deletions modules/simphera_base/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ variable "linuxNodeSize" {
default = "Standard_D4s_v4"
}

variable "linuxNodeDiskSize" {
type = number
description = "The disk size in GiB of the nodes for the regular services"
default = 200
}

variable "linuxNodeCountMin" {
type = number
description = "The minimum number of Linux nodes for the regular services"
Expand All @@ -38,6 +44,12 @@ variable "linuxExecutionNodeSize" {
default = "Standard_D16s_v4"
}

variable "linuxExecutionNodeDiskSize" {
type = number
description = "The disk size in GiB of the nodes for the job execution"
default = 200
}

variable "linuxExecutionNodeCountMin" {
type = number
description = "The minimum number of Linux nodes for the job execution"
Expand Down Expand Up @@ -80,6 +92,12 @@ variable "gpuNodeSize" {
default = "Standard_NC16as_T4_v3"
}

variable "gpuNodeDiskSize" {
type = number
description = "The disk size in GiB of the nodes for gpu job execution"
default = 200
}

variable "gpuNodeDeallocate" {
type = bool
description = "Configures whether the nodes for the gpu job execution are 'Deallocated (Stopped)' by the cluster auto scaler or 'Deleted'."
Expand Down
20 changes: 19 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ variable "linuxNodeSize" {
default = "Standard_D4s_v4"
}

variable "linuxNodeDiskSize" {
type = number
description = "The disk size in GiB of the nodes for the regular services"
default = 200
}

variable "linuxNodeCountMin" {
type = number
description = "The minimum number of Linux nodes for the regular services"
Expand All @@ -49,6 +55,12 @@ variable "linuxExecutionNodeSize" {
default = "Standard_D16s_v4"
}

variable "linuxExecutionNodeDiskSize" {
type = number
description = "The disk size in GiB of the nodes for the job execution"
default = 200
}

variable "linuxExecutionNodeCountMin" {
type = number
description = "The minimum number of Linux nodes for the job execution"
Expand Down Expand Up @@ -91,6 +103,12 @@ variable "gpuNodeSize" {
default = "Standard_NC16as_T4_v3"
}

variable "gpuNodeDiskSize" {
type = number
description = "The disk size in GiB of the gpu nodes"
default = 200
}

variable "gpuNodeDeallocate" {
type = bool
description = "Configures whether the nodes for the gpu job execution are 'Deallocated (Stopped)' by the cluster auto scaler or 'Deleted'."
Expand Down Expand Up @@ -142,7 +160,7 @@ variable "logAnalyticsWorkspaceResourceGroupName" {
variable "kubernetesVersion" {
type = string
description = "The version of the AKS cluster."
default = "1.28.3"
default = "1.28.9"
}

variable "kubernetesTier" {
Expand Down

0 comments on commit 4873c71

Please sign in to comment.