From 77403c3638c86f7e482c7688f5189ada7639c3c5 Mon Sep 17 00:00:00 2001 From: Daniel Bornkessel Date: Wed, 23 Mar 2022 09:50:07 +0100 Subject: [PATCH] Implement missing helm variabls k8s_replicas, k8s_pod_annotations and k8s_pod_labels weren't passed on to the helm chart --- main.tf | 17 +++++++++++++++++ variables.tf | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 2dffeea..cf6569f 100644 --- a/main.tf +++ b/main.tf @@ -430,6 +430,7 @@ resource "helm_release" "alb_controller" { "region" = local.aws_region_name "vpcId" = local.aws_vpc_id "hostNetwork" = var.enable_host_networking + "replicaCount" = var.k8s_replicas } content { name = set.key @@ -445,6 +446,22 @@ resource "helm_release" "alb_controller" { } } + dynamic "set" { + for_each = var.k8s_pod_annotations + content { + name = "podAnnotations.${set.key}" + value = set.value + } + } + + dynamic "set" { + for_each = var.k8s_pod_labels + content { + name = "podLabels.${set.key}" + value = set.value + } + } + depends_on = [var.alb_controller_depends_on] } diff --git a/variables.tf b/variables.tf index 4e9495d..2e64a5f 100644 --- a/variables.tf +++ b/variables.tf @@ -21,13 +21,14 @@ variable "k8s_replicas" { default = 1 } - +# missing variable "k8s_pod_annotations" { description = "Additional annotations to be added to the Pods." type = map(string) default = {} } +# missing variable "k8s_pod_labels" { description = "Additional labels to be added to the Pods." type = map(string)