From 4c4c6143794e20c273161e7c2a7b5c8659c649f7 Mon Sep 17 00:00:00 2001 From: Mike Norgate Date: Tue, 10 Sep 2024 11:06:24 +0100 Subject: [PATCH] feat: add GPU options to node template constraints (#84) --- main.tf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.tf b/main.tf index c70ef49..7d195f9 100644 --- a/main.tf +++ b/main.tf @@ -106,6 +106,7 @@ resource "castai_node_template" "this" { burstable_instances = try(constraints.value.burstable_instances, null) customer_specific = try(constraints.value.customer_specific, null) cpu_manufacturers = try(constraints.value.cpu_manufacturers, null) + is_gpu_only = try(constraints.value.is_gpu_only, false) dynamic "instance_families" { for_each = [for instance_families in flatten([lookup(constraints.value, "instance_families", [])]) : instance_families if instance_families != null] @@ -125,6 +126,18 @@ resource "castai_node_template" "this" { on_demand = try(custom_priority.value.on_demand, false) } } + + dynamic "gpu" { + for_each = [for gpu in flatten([lookup(constraints.value, "gpu", [])]) : gpu if gpu != null] + + content { + manufacturers = try(gpu.value.manufacturers, []) + include_names = try(gpu.value.include_names, []) + exclude_names = try(gpu.value.exclude_names, []) + min_count = try(gpu.value.min_count, null) + max_count = try(gpu.value.max_count, null) + } + } } } depends_on = [castai_autoscaler.castai_autoscaler_policies]