Skip to content

Commit 0a332dc

Browse files
committed
GKE: support ephemeral_storage_local_ssd_config
1 parent 7a95548 commit 0a332dc

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

google/_modules/gke/node_pool/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ resource "google_container_node_pool" "current" {
5858
effect = taint.value["effect"]
5959
}
6060
}
61+
62+
dynamic "ephemeral_storage_local_ssd_config" {
63+
for_each = var.ephemeral_storage_local_ssd_config == null ? [] : [1]
64+
65+
content {
66+
local_ssd_count = var.ephemeral_storage_local_ssd_config.local_ssd_count
67+
}
68+
}
6169
}
6270

6371
management {

google/_modules/gke/node_pool/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,11 @@ variable "guest_accelerator" {
138138
description = "`guest_accelerator` block supports during node_group creation, useful to provision GPU-capable nodes. Default to `null` or `{}` which will disable GPUs."
139139
default = null
140140
}
141+
142+
variable "ephemeral_storage_local_ssd_config" {
143+
type = object({
144+
local_ssd_count = number
145+
})
146+
description = "`ephemeral_storage_local_ssd_config` block, useful for node groups with local SSD. Defaults to `null`"
147+
default = null
148+
}

google/cluster/node-pool/configuration.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ locals {
3737
node_workload_metadata_config = local.cfg["node_workload_metadata_config"] != null ? local.cfg["node_workload_metadata_config"] : "GKE_METADATA"
3838

3939
service_account_email = local.cfg["service_account_email"]
40+
41+
ephemeral_storage_local_ssd_config = local.cfg["ephemeral_storage_local_ssd_config"]
4042
}

google/cluster/node-pool/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ module "node_pool" {
3434

3535
service_account_email = local.service_account_email
3636
disable_per_node_pool_service_account = local.service_account_email == null ? false : true
37+
38+
ephemeral_storage_local_ssd_config = local.ephemeral_storage_local_ssd_config
3739
}

google/cluster/node-pool/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ variable "configuration" {
3232
node_workload_metadata_config = optional(string)
3333

3434
service_account_email = optional(string)
35+
36+
ephemeral_storage_local_ssd_config = optional(object({
37+
local_ssd_count = number
38+
}))
3539
}))
3640
description = "Map with per workspace cluster configuration."
3741
}

0 commit comments

Comments
 (0)