aws-ia / terraform-aws-eks-blueprints

Configure and deploy complete EKS clusters.
https://aws-ia.github.io/terraform-aws-eks-blueprints/
Apache License 2.0
2.66k stars 1.42k forks source link

Argo app values is overwritten by addon_config values when add_on_application = true #917

Closed jochemvankessel closed 1 year ago

jochemvankessel commented 2 years ago

https://github.com/aws-ia/terraform-aws-eks-blueprints/blob/015834f05273cab73310cec68386aebf7d64627b/modules/kubernetes-addons/argocd/main.tf#L70-L72

See above lines.. I want to pass additional helm values to the addons chart, like below:

    addons = {
      #project            = "cluster-addons"
      path               = "chart"
      repo_url           = "https://github.com/aws-samples/eks-blueprints-add-ons.git"
      add_on_application = true
      values = {
        externalDns = yamldecode(templatefile("${path.module}/addon-values.yaml", {
          hosted_zone     = var.hosted_zone
          assume_role_arn = "arn:aws:iam::xxxxxxxxx:role/dns-manager"
          aws_region      = var.aws_region
          hostname        = var.hosted_zone
          ssl_cert_arn    = data.aws_acm_certificate.issued.arn
        }))["externalDns"]
      }
    }

Above works as expected when add_on_application = false However, when add_on_application = true it gets overwritten by the addon_config. Can we somehow loop through the values for each module and merge that with the addon_config?

askulkarni2 commented 2 years ago

This is a valid use-case for external-dns specifically since in this scenario you are passing AWS resources which could be otherwise created by the consumer terraform module.

jochemvankessel commented 2 years ago

Yeah, I think it is valid in all cases you need to pass environmental resource data from the parent to child projects. For sure in one-click deployment scenario’s. I really do understand the gitops bridge concept, but we could a bit more flexible here I think

askulkarni2 commented 2 years ago

@jochemvankessel that's great feedback. Thank you!

cc @kcaws

allamand commented 1 year ago

@jochemvankessel does the PR here can be used to solve your issue ?

bryantbiggs commented 1 year ago

closed in #1035

runningman commented 1 year ago

The merging of helm_config in to the gitops config should be default for all modules. In the current setup there doesn't seem to be a way to override any of the default values from terraform.