Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· OpenAIAi2 WildChat-4.8M (AI2)

I deploy helm chart with terraform "helm release" I didn't do any change but every…

  1. User

    I deploy helm chart with terraform "helm release" I didn't do any change but every terraform apply create new secret called sh.helm.release.v1.argocd.15, sh.helm.release.v1.argocd.v16 etc

  2. Assistant

    This issue occurs because Terraform detects the change in the sh.helm.release.v1.argocd secret (the helm release metadata stored by Helm) and attempts to keep its state up-to-date, causing it to create new secrets while applying the changes.

    To resolve this issue, you can do the following:

    1. Configure Terraform to ignore the changes in the secret created by the helm-release: Add lifecycle configuration to your helm_release block in your Terraform HCL file to ignore the secret creation:
    resource "helm_release" "argocd" {
      # Your existing configuration
      
      lifecycle {
        ignore_changes = [
          metadata[0].annotations["meta.helm.sh/release-name"]
        ]
      }
    }
    

    This tells Terraform to ignore the specific annotation that stores the release name, which should prevent the automatic creation of new secrets.

    1. Alternately, you can use the --skip-crds flag with the Helm provider in Terraform:
    provider "helm" {
      # Your existing configuration
      
      skip_crds = true
    }
    

    This option tells the Helm provider not to install custom resource definitions (CRDs) during the release, which can help mitigate the issue of creating new secrets every time.

    Make sure to run terraform init and terraform apply again after making these changes.

    Keep in mind that depending on your use-case, you may need to investigate further and adjust the configuration of your helm_release in Terraform, or you may need to update the specific Helm chart if there are specific conditions within that chart that cause recreation on every apply.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.