Skip to content

Commit

Permalink
fix!: hardcode the release name to remove the destination cluster
Browse files Browse the repository at this point in the history
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.

This is a breaking change because sometimes this requires an application to be deleted and recreated.
  • Loading branch information
lentidas committed Jan 19, 2024
1 parent 21c902d commit c64e00b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
locals {
helm_values = [{
"aws-efs-csi-driver" = {
nameOverride = var.name
storageClasses = [{
name = "efs"
parameters = {
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ resource "argocd_application" "this" {
path = "charts/efs-csi-driver"
target_revision = var.target_revision
helm {
values = data.utils_deep_merge_yaml.values.output
release_name = "efs-csi-driver"
values = data.utils_deep_merge_yaml.values.output
}
}

Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ variable "dependency_ids" {
## Module variables
#######################

variable "name" {
description = "Name used to override the chart name on deployment."
type = string
default = "efs-csi-driver"
}

variable "efs_file_system_id" {
description = "EFS Filesystem ID to use by the CSI driver to create volumes."
type = string
Expand Down

0 comments on commit c64e00b

Please sign in to comment.