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

GKE: support ephemeral_storage_local_ssd_config #332

Closed
wants to merge 1 commit into from
Closed
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
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