Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm_repository: deprecated #466

Merged
merged 1 commit into from
Apr 18, 2020
Merged

helm_repository: deprecated #466

merged 1 commit into from
Apr 18, 2020

Conversation

mcuadros
Copy link
Collaborator

Description

This PR deprecates helm_repository, this data source has several problems:

Since if we remove the capabilities of install the repository on the local machine, the resource results in a POJO, with no value other than host the variables to be reused in the helm_release resource.

The suggested new recommended behavior is to use variables to avoid de repetition of the repository URL or any other repository related values.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch? (If so, please include the test log in a gist)

References

Fix #416
Fix #335

@digitalkaoz
Copy link

@mcuadros @jrhouston this should work then but it wont:

resource "helm_release" "postgres" {
  # https://github.com/zalando/postgres-operator/blob/master/charts/postgres-operator/values-crd.yaml
  name = "postgres"
  version = "1.4.0"
  dependency_update = true
  description = "postgres HA stack zalando/postgres-operator"
  cleanup_on_fail = true
  atomic = true
  repository = "https://opensource.zalando.com/postgres-operator/charts/postgres-operator"
  chart = "postgres-operator"
}

it fails with

Error: failed to download "https://opensource.zalando.com/postgres-operator/charts/postgres-operator/postgres-operator-1.4.0.tgz"

but the file is there, so im a bit confused

$ curl -I https://opensource.zalando.com/postgres-operator/charts/postgres-operator/postgres-operator-1.4.0.tgz
HTTP/2 200
server: GitHub.com

provider version: provider.helm: version = "~> 1.1"

@digitalkaoz
Copy link

it only works if i manually added the helm repo from the CLI

$ helm repo add zalando https://opensource.zalando.com/postgres-operator/charts/postgres-operator

@mcuadros
Copy link
Collaborator Author

mcuadros commented Apr 17, 2020

I use CI so helm is clean for sure and this:

resource "helm_release" "redis" {
  provider   = helm.default
  chart      = "redis"
  name       = "redis"
  repository = "https://charts.bitnami.com/bitnami"
  version    = "10.5.6"
}

It working for me for weeks. And I have example with custom repositories and also with the stable one.

@digitalkaoz
Copy link

can you try it with the zalando operator?

another weird issue is this:

// working
resource "helm_release" "certs" {
  version           = "v0.15.0-alpha.0"
  repository      = " https://hub.helm.sh" #TODO why this space WTF? without it doesnt work
  chart              = "jetstack/cert-manager"
}

//doesnt work
resource "helm_release" "certs" {
  version           = "v0.15.0-alpha.0"
  repository      = "https://hub.helm.sh"
  chart              = "jetstack/cert-manager"
}

@digitalkaoz
Copy link

@mcuadros you are sure you dont have a repository data source anymore? maybe its still persistent in the state file?!

@mcuadros
Copy link
Collaborator Author

mcuadros commented Apr 17, 2020

The data sources are not persisted by definition in the state since they don't represent the desired state, the data source are used to retrieve data from the state or the real infrastructure.

All the URL handling is done by Helm himself, can you try with a clean environment? I never had any issue using URLs, at least in the last configuration I did.

I will try with yours.

NOTE: The repository URL for the cert should be https://charts.jetstack.io the other URL is a website without any index.yaml

@digitalkaoz
Copy link

// working
resource "helm_release" "certs" {
  version           = "v0.15.0-alpha.0"
  repository      = " https://hub.helm.sh" #TODO why this space WTF? without it doesnt work
  chart              = "jetstack/cert-manager"
}

//doesnt work
resource "helm_release" "certs" {
  version           = "v0.15.0-alpha.0"
  repository      = "https://hub.helm.sh"
  chart              = "jetstack/cert-manager"
}

i forget devel=true for a prerelease, thanks, the other issue still remains

@jrhouston
Copy link
Contributor

jrhouston commented Apr 17, 2020

// working
resource "helm_release" "certs" {
  version           = "v0.15.0-alpha.0"
  repository      = " https://hub.helm.sh" #TODO why this space WTF? without it doesnt work
  chart              = "jetstack/cert-manager"
}

//doesnt work
resource "helm_release" "certs" {
  version           = "v0.15.0-alpha.0"
  repository      = "https://hub.helm.sh"
  chart              = "jetstack/cert-manager"
}

i forget devel=true for a prerelease, thanks, the other issue still remains

https://hub.helm.sh isn't actually a helm repository it's a site for aggregating repositories. For cert-manager the following is what you need:

resource "helm_release" "example" {
  name              = "example"
  version           = "v0.15.0-alpha.0"
  repository        = "https://charts.jetstack.io"
  chart             = "cert-manager"
}

@mcuadros mcuadros merged commit 5b5d01f into master Apr 18, 2020
@eskp
Copy link

eskp commented May 5, 2020

Still seeing the issue when specifying the incubator repo url

resource "helm_release" "alb_ingress" { name = "aws-alb-ingress-controller" repository = "https://kubernetes-charts-incubator.storage.googleapis.com" chart = "aws-alb-ingress-controller" namespace = "kube-system" version = "1.0.0" }

Error: failed to download "https://kubernetes-charts-incubator.storage.googleapis.com/aws-alb-ingress-controller-1.0.0.tgz" (hint: running helm repo update may help)

Provider version 1.0
Terraform v0.12.24

@ghost
Copy link

ghost commented May 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use helm provider v1 with plan & apply on different machines helm_repository does not refresh on apply
4 participants