From c0ab1d816a102ea13ed71f3ebe3cfca198f87e50 Mon Sep 17 00:00:00 2001 From: Steve McMaster Date: Sat, 20 Jul 2024 13:55:09 -0400 Subject: [PATCH] fix? --- base.tf.j2 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/base.tf.j2 b/base.tf.j2 index 0058fc3..3f92a29 100644 --- a/base.tf.j2 +++ b/base.tf.j2 @@ -420,11 +420,14 @@ resource "kubernetes_deployment" "main" { {% endblock %} {% block kubernetes_pod_main_tolerations %} - toleration { + dynamic "gpu_toleration" { for_each = data.coder_parameter.gpu.value == 0 ? [] : [1] - key = "nvidia.com/gpu" - operator = "Exists" - effect = "NoSchedule" + + toleration { + key = "nvidia.com/gpu" + operator = "Exists" + effect = "NoSchedule" + } } {% endblock %}