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 84733d0 commit 5a01293
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-ebs-csi-driver" = {
nameOverride = var.name
controller = {
serviceAccount = {
annotations = {
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ resource "argocd_application" "this" {
path = "charts/ebs-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 = "ebs-csi-driver"
}

variable "create_role" {
description = "Boolean to indicate that the OIDC assumable IAM role should be created. **If passing `iam_role_arn` this should be false, otherwise if you want to create the OIDC assumable IAM role provided by this module, you will need to specify the variable `cluster_oidc_issuer_url`.**"
type = bool
Expand Down

0 comments on commit 5a01293

Please sign in to comment.