Skip to content

Commit

Permalink
GKE: support ephemeral_storage_local_ssd_config
Browse files Browse the repository at this point in the history
  • Loading branch information
rzk committed Jan 24, 2024
1 parent 7a95548 commit 0a332dc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions google/_modules/gke/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ resource "google_container_node_pool" "current" {
effect = taint.value["effect"]
}
}

dynamic "ephemeral_storage_local_ssd_config" {
for_each = var.ephemeral_storage_local_ssd_config == null ? [] : [1]

content {
local_ssd_count = var.ephemeral_storage_local_ssd_config.local_ssd_count
}
}
}

management {
Expand Down
8 changes: 8 additions & 0 deletions google/_modules/gke/node_pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,11 @@ variable "guest_accelerator" {
description = "`guest_accelerator` block supports during node_group creation, useful to provision GPU-capable nodes. Default to `null` or `{}` which will disable GPUs."
default = null
}

variable "ephemeral_storage_local_ssd_config" {
type = object({
local_ssd_count = number
})
description = "`ephemeral_storage_local_ssd_config` block, useful for node groups with local SSD. Defaults to `null`"
default = null
}
2 changes: 2 additions & 0 deletions google/cluster/node-pool/configuration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ locals {
node_workload_metadata_config = local.cfg["node_workload_metadata_config"] != null ? local.cfg["node_workload_metadata_config"] : "GKE_METADATA"

service_account_email = local.cfg["service_account_email"]

ephemeral_storage_local_ssd_config = local.cfg["ephemeral_storage_local_ssd_config"]
}
2 changes: 2 additions & 0 deletions google/cluster/node-pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ module "node_pool" {

service_account_email = local.service_account_email
disable_per_node_pool_service_account = local.service_account_email == null ? false : true

ephemeral_storage_local_ssd_config = local.ephemeral_storage_local_ssd_config
}
4 changes: 4 additions & 0 deletions google/cluster/node-pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ variable "configuration" {
node_workload_metadata_config = optional(string)

service_account_email = optional(string)

ephemeral_storage_local_ssd_config = optional(object({
local_ssd_count = number
}))
}))
description = "Map with per workspace cluster configuration."
}
Expand Down

0 comments on commit 0a332dc

Please sign in to comment.