Terraform v0.11.10
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"
}
it should initialize helm in the directory specified in 'home' and install tiller.
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.
Please list the steps required to reproduce the issue, for example:
home = ./.helm to the helm provider terraform applyAre there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
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.
Most helpful comment
FYI, I've submitted two PRs to address this issue: