Open ctwilleager-alio opened 1 year ago
Hi,
unfortunately, I'm not able to reproduce this... it works as expected when I try it.
resource "helm_release" "vault" {
name = "vault"
repository = "https://helm.releases.hashicorp.com"
chart = "vault"
version = "0.25.0"
}
➜ issue-helm-1215 terraform apply -auto-approve
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# helm_release.vault will be created
+ resource "helm_release" "vault" {
+ atomic = false
+ chart = "vault"
+ cleanup_on_fail = false
+ create_namespace = false
+ dependency_update = false
+ disable_crd_hooks = false
+ disable_openapi_validation = false
+ disable_webhooks = false
+ force_update = false
+ id = (known after apply)
+ lint = false
+ manifest = (known after apply)
+ max_history = 0
+ metadata = (known after apply)
+ name = "vault"
+ namespace = "default"
+ pass_credentials = false
+ recreate_pods = false
+ render_subchart_notes = true
+ replace = false
+ repository = "https://helm.releases.hashicorp.com"
+ reset_values = false
+ reuse_values = false
+ skip_crds = false
+ status = "deployed"
+ timeout = 300
+ verify = false
+ version = "0.25.0"
+ wait = true
+ wait_for_jobs = false
}
Plan: 1 to add, 0 to change, 0 to destroy.
helm_release.vault: Creating...
helm_release.vault: Creation complete after 9s [id=vault]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
Same problem with grafana-agent
resource "helm_release" "grafana-agent-helm" {
name = "default-agent"
repository = "https://grafana.github.io/helm-charts"
chart = "grafana-agent"
}
@ctwilleager-alio Do you have a directory with the name vault
in your Terraform project directory? I had the same problem, after renaming it was no longer a problem.
Example to reproduce: main.tf:
resource "helm_release" "vault" {
name = "vault"
namespace = "vault"
repository = "https://helm.releases.hashicorp.com"
chart = "vault"
}
terraform init
mkdir vault
terraform apply -auto-approve
# Error: could not download chart: Chart.yaml file is missing
rmdir vault
terraform apply -auto-approve
# Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
@alexsomesan Can you please execute mkdir vault
before you execute terraform.
@alexsomesan Confirmed same problem here. This makes modules kind of annoying. I moved my longhorn
to a TF module under a directory called longhorn
because . . why wouldn't I name it that, and it broke. Took a while to find this.
Something else I forgot to mention, it does seem to be intermittent. I'm confident that the longhorn module was working with a directory called longhorn
before but then it stopped and would not start working again, so reproduction me be difficult.
This bug should very seriously be investigated and resolved. The module should not be assuming that just because there is a directory with values, we want to load a custom chart from it. I structure my folders in such a way that when i have a custom helm_resource, i pair it with a folder for that resource, makes it very easy to follow. There are obviously other ways, but the module shouldn't be looking for a directory unless it's told to.
As others have noticed, you can work around it by renaming the folder, in my case, I don't like that as it disrupts my structure and feels bloated, so you can also directly point at the .tgz in the chart uri.
Terraform, Provider, Kubernetes and Helm Versions
Affected Resource(s)
I am unable to deploy Helm with Terraform despite providing the correct repository URL and chart name, as per many of examples I've looked at. The Helm insists the Chart.yaml is missing, when it is not actually missing.
Terraform Configuration Files
Debug Output
Steps to Reproduce
values
andset
,terraform apply
Expected Behavior
Terraform should deploy vault with helm_release.
Actual Behavior
Terraform helm_provider is failing with:
Community Note