terraform-provider-helm icon indicating copy to clipboard operation
terraform-provider-helm copied to clipboard

Terraform apply doesnt update the changes in the helm chart

Open lavanyamylsamy opened this issue 4 years ago • 5 comments

Hello All,

Terraform version: Terraform v0.12.24

Helm provider version: helm = "~>1.0.0"

I am using helm provider in terraform to deploy mysql in AKS cluster. I deployed the application using helm charts via terraform, if i update the yaml files, version in chart.yaml and values in values.yaml file in the helmchart, terraform plan shows new changes in the version and terraform apply says modifying mysql in the console but nothing gets changed in the Backend.

I tried using reset_values flag, but nothing helps.

provider "kubernetes" {
    host     = var.aks-cluster-host

    client_key             = base64decode(var.aks-cluster-client-key)
    client_certificate     = base64decode(var.aks-cluster-client-cert)
    cluster_ca_certificate = base64decode(var.aks-cluster-client-cacert)
}

resource "helm_release" "mysql" {
  namespace = kubernetes_namespace.mecrmnsp.metadata.0.name
  name       = "mysql"
  chart      = "./helm charts/mysql"
  timeout    = "600"
  wait       = "true"
  reset_values = "true"
  version = "0.1.4"
  set {
        name  = "rbac.create"
       value = "true"
  }
}

Terraform plan

  # module.aks-helm.helm_release.mysql will be updated in-place
  ~ resource "helm_release" "mysql" {
        atomic                = false
        chart                 = "./helm charts/mysql"
        cleanup_on_fail       = false
        dependency_update     = false
        disable_crd_hooks     = false
        disable_webhooks      = false
        force_update          = false
        id                    = "mysql"
        max_history           = 0
        metadata              = [
            {
                chart     = "mysql"
                name      = "mysql"
                namespace = "qa"
                revision  = 2
                values    = jsonencode(
                    {
                        rbac = {
                            create = true
                        }
                    }
                )
                version   = "0.1.1"
            },
        ]
        name                  = "mysql"
        namespace             = "qa"
        recreate_pods         = false
        render_subchart_notes = true
        replace               = false
        reset_values          = true
        reuse_values          = false
        skip_crds             = false
        status                = "deployed"
        timeout               = 600
        verify                = false
      ~ version               = "0.1.1" -> "0.1.2"
        wait                  = true

        set {
            name  = "rbac.create"
            value = "true"
        }
    }

Terraform apply:

module.aks-helm.helm_release.mysql: Modifying... [id=mysql]
module.aks-helm.helm_release.mysql: Still modifying... [id=mysql, 10s elapsed]
module.aks-helm.helm_release.mysql: Still modifying... [id=mysql, 20s elapsed]
module.aks-helm.helm_release.mysql: Still modifying... [id=mysql, 30s elapsed]
module.aks-helm.helm_release.mysql: Still modifying... [id=mysql, 40s elapsed]
module.aks-helm.helm_release.mysql: Still modifying... [id=mysql, 50s elapsed]
module.aks-helm.helm_release.mysql: Still modifying... [id=mysql, 1m0s elapsed]
module.aks-helm.helm_release.mysql: Modifications complete after 1m8s [id=mysql]

Any help is appreciated

lavanyamylsamy avatar Jul 08 '20 05:07 lavanyamylsamy

Were you able to make progress here or is this still affecting you?

alexsomesan avatar Oct 28 '20 16:10 alexsomesan

Hi, I'm having a similar issue when trying to update the version. Does someone have any ideas ?

PLsergent avatar Nov 29 '21 11:11 PLsergent

I'm having the same issue. Any updates on this?

alicyn avatar Apr 04 '22 16:04 alicyn

Having the same issue.

manjudr avatar Apr 05 '22 07:04 manjudr

Having the same issue

usternik avatar May 24 '22 12:05 usternik

yup, still happens with Terraform version 1.4.6: linux amd64 (current github actions) I am thinking about creating a checksum of the helmchart in the workflow and change a terraform value in the depends_on section... Which is kindof what helm does, but terraform keeps us away from the helm run. maybe we can force helm update every time....

uvwildos avatar May 05 '23 23:05 uvwildos

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

github-actions[bot] avatar May 05 '24 00:05 github-actions[bot]