Skip to content

Commit

Permalink
GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
pk0331 committed Jan 9, 2023
1 parent 92bde16 commit 8e86ccf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,14 @@ resource "google_container_node_pool" "pools" {
local.node_pools_oauth_scopes[each.value["name"]],
)

guest_accelerator = [
for guest_accelerator in lookup(each.value, "accelerator_count", 0) > 0 ? [{
type = lookup(each.value, "accelerator_type", "")
dynamic "guest_accelerator" {
for_each = lookup(each.value, "accelerator_count", null) == null ? []: [1]
content {
type = lookup(each.value, "accelerator_type", null) == null ? "nvidia-tesla-t4": each.value["accelerator_type"]
count = lookup(each.value, "accelerator_count", 0)
gpu_partition_size = lookup(each.value, "gpu_partition_size", null)
}] : [] : {
type = guest_accelerator["type"]
count = guest_accelerator["count"]
gpu_partition_size = guest_accelerator["gpu_partition_size"]
}
]
}

dynamic "workload_metadata_config" {
for_each = local.cluster_node_metadata_config
Expand Down

0 comments on commit 8e86ccf

Please sign in to comment.