Skip to content

Commit

Permalink
Modified node pools to have a condition enabled for GPU pools
Browse files Browse the repository at this point in the history
  • Loading branch information
dunefro committed Mar 16, 2024
1 parent 63ed175 commit 50a4fc1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
48 changes: 24 additions & 24 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,50 +21,50 @@ locals {
}
]
gpupools = [
{
var.enable_A100_node_pools ? {
name = "a100"
vm_size = "Standard_NC24ads_A100_v4"
},
{
} : null,
var.enable_A100_node_pools ? {
name = "a100x2"
vm_size = "Standard_NC48ads_A100_v4"
},
{
} : null,
var.enable_A100_node_pools ? {
name = "a100x4"
vm_size = "Standard_NC96ads_A100_v4"
},
{
} : null,
var.enable_A10_node_pools ? {
name = "a10"
vm_size = "Standard_NV6ads_A10_v5"
},
{
} : null,
var.enable_A10_node_pools ? {
name = "a10x2"
vm_size = "Standard_NV12ads_A10_v5"
},
{
} : null,
var.enable_A10_node_pools ? {
name = "a10x3"
vm_size = "Standard_NV18ads_A10_v5"
},
{
} : null,
var.enable_A10_node_pools ? {
name = "a10x6"
vm_size = "Standard_NV36ads_A10_v5"
},
{
} : null,
var.enable_T4_node_pools ? {
name = "t4"
vm_size = "Standard_NC4as_T4_v3"
},
{
} : null,
var.enable_T4_node_pools ? {
name = "t4x2"
vm_size = "Standard_NC8as_T4_v3"
},
{
} : null,
var.enable_T4_node_pools ? {
name = "t4x4"
vm_size = "Standard_NC16as_T4_v3"
},
{
} : null,
var.enable_T4_node_pools ? {
name = "t4x16"
vm_size = "Standard_NC64as_T4_v3"
}
} : null
]
node_pools = merge({ for k, v in local.cpupools : "${v["name"]}sp" => {
name = "${v["name"]}sp"
Expand Down Expand Up @@ -110,7 +110,7 @@ locals {
zones = []
vnet_subnet_id = var.subnet_id
max_pods = var.max_pods_per_node
} },
} if v != null },
{ for k, v in local.gpupools : "${v["name"]}" => {

Check warning on line 114 in locals.tf

View workflow job for this annotation

GitHub Actions / tflint (ubuntu-latest)

Interpolation-only expressions are deprecated in Terraform v0.12.14

Check warning on line 114 in locals.tf

View workflow job for this annotation

GitHub Actions / tflint (macos-latest)

Interpolation-only expressions are deprecated in Terraform v0.12.14

Check warning on line 114 in locals.tf

View workflow job for this annotation

GitHub Actions / tflint (windows-latest)

Interpolation-only expressions are deprecated in Terraform v0.12.14
name = "${v["name"]}"

Check warning on line 115 in locals.tf

View workflow job for this annotation

GitHub Actions / tflint (ubuntu-latest)

Interpolation-only expressions are deprecated in Terraform v0.12.14

Check warning on line 115 in locals.tf

View workflow job for this annotation

GitHub Actions / tflint (macos-latest)

Interpolation-only expressions are deprecated in Terraform v0.12.14

Check warning on line 115 in locals.tf

View workflow job for this annotation

GitHub Actions / tflint (windows-latest)

Interpolation-only expressions are deprecated in Terraform v0.12.14
node_count = 0
Expand All @@ -131,5 +131,5 @@ locals {
zones = []
vnet_subnet_id = var.subnet_id
max_pods = var.max_pods_per_node
} })
} if v != null })
}
26 changes: 13 additions & 13 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ variable "intial_node_pool_instance_type" {
type = string
}

variable "intial_node_pool_spot_instance_type" {
description = "Instance size of the initial node pool"
default = "Standard_D4s_v5"
type = string
}
# variable "intial_node_pool_spot_instance_type" {
# description = "Instance size of the initial node pool"
# default = "Standard_D4s_v5"
# type = string
# }

variable "initial_node_pool_max_surge" {
description = "Max surge in percentage for the intial node pool"
Expand All @@ -49,20 +49,20 @@ variable "initial_node_pool_max_surge" {
}
variable "enable_A10_node_pools" {
description = "Enable A10 node pools spot/on-demand"
type = bool
default = true
type = bool
default = true
}

variable "enable_A100_node_pools" {
description = "Enable A100 node pools spot/on-demand"
type = bool
default = true
description = "Enable A100 node pools spot/on-demand"
type = bool
default = true
}

variable "enable_T4_node_pools" {
description = "Enable T4 node pools spot/on-demand"
type = bool
default = true
description = "Enable T4 node pools spot/on-demand"
type = bool
default = true
}

variable "workload_identity_enabled" {
Expand Down

0 comments on commit 50a4fc1

Please sign in to comment.