Skip to content

Update terraform helm chart module to use v0.13.7 terraform #34

FuchiCorp LLC edited this page Jun 16, 2022 · 4 revisions

Goal:

Update the terraform helm chart module to support the v0.13.7 version of terraform to deploy local and remote charts

Steps:

These are the steps to properly update helm chart module to terraform 0.13.7:

  1. Before you start, make sure to update the terraform version to 0.13.7 from 0.11.7 in the versions.tf file

image

  1. Run terraform init and modify the code so it doesn't show any problems

  2. Update the variables.tf file and main.tf file to use the new terraform syntax:

Before:

image main.tf file image

After:

image

image

Test the changes and create a local and remote helm chart:

  • create a test-module folder
  • create a module-test.tf file inside the test-module folder and add the following code:
module "helm_deploy" {
  source                 = "../"
  deployment_name        = "grafana"
  deployment_environment = "dev"
  deployment_path        = "grafana"
  chart_repo             = "https://grafana.github.io/helm-charts"
  enabled                = "true"
  remote_chart           = "true"
  release_version        = "6.22.0"

  ## Your custom values.yaml
  remote_override_values = <<EOF
## Put here your custom values like to override the values.yaml
replicas: 2
EOF 
}

module "helm_deploy_local" {
  source                 = "../"
  deployment_name        = "my-example-chart"
  deployment_environment = "dev"
  deployment_path        = "./local-demo2"
  remote_chart           = "false"
  enabled                = "true"
}
  • cd to test-module folder
  • open terminal and run helm create local-demo2

Check to see if the helm chart is created

helm ls -n dev

image

LINKS https://discuss.hashicorp.com/t/plan-showing-0-to-add-0-to-change-0-to-destroy/21198 https://registry.terraform.io/modules/fuchicorp/chart/helm/latest https://github.com/fuchicorp/terraform-helm-chart https://www.terraform.io/language/modules/develop/providers https://github.com/fuchicorp/terraform-helm-chart/pull/35/commits/a4a55df1a471797b9657ed81dccef5b8f7055013