From a113f9c98bb6e37938d2ef13ce612e5bc6e46e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= Date: Fri, 12 Jan 2024 15:58:38 +0100 Subject: [PATCH] fix!: hardcode the release name to remove the destination cluster I found out that Argo CD passes the name of the application as a value to set the Helm chart. This means that all the templating that used `{ $.Release.Name }` would resolve to the name given to Argo CD application. In a multicluster deployment, using a single Argo CD, the names of the applications must be different. We solved that by appending the cluster name to the default application name when deploying on different clusters than `in-cluster`. However, this resulted in multiple problems for deployments that depended on the name of the application being static, so this solves that. --- main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.tf b/main.tf index eac834dc..27f18ced 100644 --- a/main.tf +++ b/main.tf @@ -103,6 +103,10 @@ resource "argocd_application" "this" { target_revision = var.target_revision plugin { name = "kustomized-helm" + env { + name = "HELM_ARGS" + value = "--name-template kube-prometheus-stack" + } env { name = "HELM_VALUES" value = data.utils_deep_merge_yaml.values.output