From 89a5ecea1cc27d6cc8c3446159ac95170e2f328e Mon Sep 17 00:00:00 2001 From: Dmitry Beykun Date: Mon, 22 Jul 2024 03:35:16 +0900 Subject: [PATCH] Add support for guest accelerators in GKE node pool --- google/cluster/node-pool/configuration.tf | 2 ++ google/cluster/node-pool/main.tf | 2 ++ google/cluster/node-pool/variables.tf | 12 +++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/google/cluster/node-pool/configuration.tf b/google/cluster/node-pool/configuration.tf index 2906b6b..523be54 100644 --- a/google/cluster/node-pool/configuration.tf +++ b/google/cluster/node-pool/configuration.tf @@ -48,4 +48,6 @@ locals { instance_tags = local.cfg["instance_tags"] ephemeral_storage_local_ssd_config = local.cfg["ephemeral_storage_local_ssd_config"] + + guest_accelerator = local.cfg["guest_accelerator"] } diff --git a/google/cluster/node-pool/main.tf b/google/cluster/node-pool/main.tf index 03bfa88..923024e 100644 --- a/google/cluster/node-pool/main.tf +++ b/google/cluster/node-pool/main.tf @@ -45,4 +45,6 @@ module "node_pool" { network_config = local.network_config ephemeral_storage_local_ssd_config = local.ephemeral_storage_local_ssd_config + + guest_accelerator = local.guest_accelerator } diff --git a/google/cluster/node-pool/variables.tf b/google/cluster/node-pool/variables.tf index b6dfd1f..4172b2d 100644 --- a/google/cluster/node-pool/variables.tf +++ b/google/cluster/node-pool/variables.tf @@ -26,7 +26,7 @@ variable "configuration" { value = string effect = string }))) - + labels = optional(map(string)) labels = optional(map(string)) @@ -62,6 +62,16 @@ variable "configuration" { ephemeral_storage_local_ssd_config = optional(object({ local_ssd_count = number })) + + guest_accelerator = optional(object({ + type = string + count = number + gpu_partition_size = optional(string) + gpu_sharing_config = optional(object({ + gpu_sharing_strategy = optional(string) + max_shared_clients_per_gpu = optional(number) + })) + })) })) description = "Map with per workspace cluster configuration."