Terraform-provider-helm: the 'home' parameter on the helm provider is broken

Created on 24 Oct 2018  路  2Comments  路  Source: hashicorp/terraform-provider-helm

Terraform Version

Terraform v0.11.10

  • provider.aws v1.41.0
  • provider.external v1.0.0
  • provider.helm v0.1.0
  • provider.kubernetes v1.3.0
  • provider.local v1.1.0
  • provider.null v1.0.0
  • provider.template v1.0.0

Affected Resource(s)

  • helm provider
  • helm repository

Terraform Configuration Files

works:

provider "helm" {
  service_account = "tiller"
  tiller_image    = "gcr.io/kubernetes-helm/tiller:v2.11.0"
  namespace       = "kube-system"
  debug           = "true"

  kubernetes {
    config_path = "./kubeconfig_${var.release_env[var.environment]}"
  }
}

resource "helm_repository" "artifactory" {
  name = "artifactory"
  url  = "https://artifactory.granicuslabs.com/artifactory/helm"
}

doesn't work:

provider "helm" {
  service_account = "tiller"
  tiller_image    = "gcr.io/kubernetes-helm/tiller:v2.11.0"
  namespace       = "kube-system"
  debug           = "true"
  home            = "./.helm"

  kubernetes {
    config_path = "./kubeconfig_${var.release_env[var.environment]}"
  }
}

resource "helm_repository" "artifactory" {
  name = "artifactory"
  url  = "https://artifactory.granicuslabs.com/artifactory/helm"
}

Expected Behavior

it should initialize helm in the directory specified in 'home' and install tiller.

Actual Behavior

helm_repository.artifactory: Creating...
  metadata.#: "" => "<computed>"
  name:       "" => "artifactory"
  url:        "" => "https://artifactory.granicuslabs.com/artifactory/helm"

Error: Error applying plan:

1 error(s) occurred:

* helm_repository.artifactory: 1 error(s) occurred:

* helm_repository.artifactory: Couldn't load repositories file (.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)

so I run

export HELM_HOME="./.helm"
helm init --client-only    
Creating ./.helm
Creating .helm/repository
Creating .helm/repository/cache
Creating .helm/repository/local
Creating .helm/plugins
Creating .helm/starters
Creating .helm/cache/archive
Creating .helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at ./.helm.
Not installing Tiller due to 'client-only' flag having been set
Happy Helming!

THEN I run terraform apply again and get:
```helm_repository.artifactory: Creating...
metadata.#: "" => ""
name: "" => "artifactory"
url: "" => "https://artifactory.granicuslabs.com/artifactory/helm"

Error: Error applying plan:

1 error(s) occurred:

  • helm_repository.artifactory: 1 error(s) occurred:

  • helm_repository.artifactory: Looks like "https://artifactory.granicuslabs.com/artifactory/helm" is not a valid chart repository or cannot be reached: open .helm/repository/cache/.helm/repository/cache/artifactory-index.yaml: no such file or directory
    in addition, helm tiller is not installed in my cluster.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. add a home = ./.helm to the helm provider
  2. terraform apply

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • GH-1234
bug

Most helpful comment

FYI, I've submitted two PRs to address this issue:

All 2 comments

FYI, I've submitted two PRs to address this issue:

Helm PR https://github.com/helm/helm/pull/5189 was merged and is targeted for 2.14.0.

Was this page helpful?
0 / 5 - 0 ratings