Terraform-provider-helm: [resolved] Error: repo jetstack not found

Created on 11 Oct 2019  路  5Comments  路  Source: hashicorp/terraform-provider-helm

Solution

https://github.com/terraform-providers/terraform-provider-helm/issues/354#issuecomment-541534473

Terraform Version

Terraform v0.12.10

Affected Resource(s)

  • helm_repository

Terraform Configuration Files

provider "helm" {
  version = "~> 0.10"
}

data "helm_repository" "jetstack" {
  name = "jetstack"
  url  = "https://charts.jetstack.io"
}

resource "helm_release" "cert_manager" {
  repository = data.helm_repository.jetstack.metadata.0.name
  name       = "cert-manager"
  chart      = "cert-manager"
  namespace  = "cert-manager"
  version    = "v0.11.0-beta.0"
}

Expected Behavior

Release created with repo.

Actual Behavior

Error: repo jetstack not found

References

Most helpful comment

Just if anyone else is running into it: Using a repo URL in repository param should also work:

provider "helm" {
  version = "~> 0.10"
}

resource "helm_release" "cert_manager" {
  repository = "https://charts.jetstack.io"
  name       = "cert-manager"
  chart      = "cert-manager"
  namespace  = "cert-manager"
  version    = "v0.11.0-beta.0"
}

P.S.
Actually, I think that should be the recommended way, instead of using helm_repository data/resource. It's even faster because terraform doesn't spent time on refreshing the state of helm_repository every time.

All 5 comments

SOLUTION

provider "helm" {
  version = "~> 0.10"

  # ...

  home = "${abspath(path.root)}/.helm"

  # ...
}

Just if anyone else is running into it: Using a repo URL in repository param should also work:

provider "helm" {
  version = "~> 0.10"
}

resource "helm_release" "cert_manager" {
  repository = "https://charts.jetstack.io"
  name       = "cert-manager"
  chart      = "cert-manager"
  namespace  = "cert-manager"
  version    = "v0.11.0-beta.0"
}

P.S.
Actually, I think that should be the recommended way, instead of using helm_repository data/resource. It's even faster because terraform doesn't spent time on refreshing the state of helm_repository every time.

@legal90 big thanks for this info!

And I think that's more clear to read 馃槈

Actually, I think that should be the recommended way, instead of using helm_repository data/resource. It's even faster because terraform doesn't spent time on refreshing the state of helm_repository every time.

The only problem with this approach is lack of basic auth support. It's not possible to use https://www.terraform.io/docs/providers/helm/repository.html#username and https://www.terraform.io/docs/providers/helm/repository.html#password without data helm_repository

Was this page helpful?
0 / 5 - 0 ratings