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

terraform helm_repository deprecated #4

Closed
ismailyenigul opened this issue Jul 12, 2020 · 11 comments · Fixed by #5
Closed

terraform helm_repository deprecated #4

ismailyenigul opened this issue Jul 12, 2020 · 11 comments · Fixed by #5
Assignees

Comments

@ismailyenigul
Copy link

Getting the following error while deploying this terraform module.

Warning: This resource is deprecated and will be removed in the next major version. 
Please supply the URL of your repository to helm_release resources directly, using the repository attribute.
See: https://www.terraform.io/docs/providers/helm/r/release.html#example-usage

  on .terraform/modules/eks-alb-ingress/main.tf line 1, in data "helm_repository" "default":
   1: data "helm_repository" "default" {


@martinhaus
Copy link
Member

Similar to lablabs/terraform-aws-eks-external-dns#7
@karol-bujacek please take a look.

@karol-bujacek
Copy link
Contributor

This will be fixed in pull-request #5 .

@ismailyenigul
Copy link
Author

Thanks.
I think you should also update docker images to use the image tag in the helm chart
at https://github.com/lablabs/terraform-aws-eks-alb-ingress/blob/master/templates/values.yaml.tpl#L23

@karol-bujacek
Copy link
Contributor

@ismailyenigul, we already know about this and we will fix it in separate branch / pull-request.

@ismailyenigul
Copy link
Author

@karol-bujacek ok cool. I deployed alb ingress and external dns but did not work on my EKS. then I had to deploy them manually.

btw, the helm chart expect that kubectl configured to use the current k8s cluster.
I was trying to deploy your charts while creating EKS cluster so there was no kubeconfig at that stage.

you might want to run aws eks update-kubeconfig --name $clustername for this case.
I used the following resource before installing an helm chart

resource "null_resource" "updatekubeconfig" {

  depends_on = [
    module.eks_cluster.eks_cluster_id
  ]

  provisioner "local-exec" {
    command     = var.update_kubeconfig_cmd
    interpreter = var.update_kubeconfig_interpreter
    environment = {
      CLUSTERNAME = module.eks_cluster.eks_cluster_id
    }
  }
}

variable "update_kubeconfig_cmd" {
  description = "Custom local-exec command to execute update .kube/config"
  type        = string
  default     = "aws eks update-kubeconfig --name  $CLUSTERNAME"
}

variable "update_kubeconfig_interpreter" {
  description = "Custom local-exec command line interpreter for the command."
  type        = list(string)
  default     = ["/bin/sh", "-c"]
}

@adys
Copy link
Contributor

adys commented Jul 16, 2020

@ismailyenigul we are preparing a PR where you can find an example in which we address the issue. We will let you know once it's ready.

@karol-bujacek
Copy link
Contributor

Thanks.
I think you should also update docker images to use the image tag in the helm chart
at https://github.com/lablabs/terraform-aws-eks-alb-ingress/blob/master/templates/values.yaml.tpl#L23

@ismailyenigul , now it is possible to use custom image tag in the Helm chart. We have completely remove values template file and we are using set blocks for changes instead. Take a look at pull-request #6 for more details.

@ismailyenigul
Copy link
Author

Thanks @karol-bujacek

One more thing the latest chart version is 1.0.2 at https://github.com/helm/charts/blob/master/incubator/aws-alb-ingress-controller/Chart.yaml
Your default chart seems too old.

variable "helm_chart_version" {
  default = "0.1.13"
}

@ismailyenigul
Copy link
Author

just deployed from master branch with chart version is 1.0.2
I got the following error:

E0719 16:54:09.233050       1 controller.go:217] kubebuilder/controller 
"msg"="Reconciler error" "error"="failed to reconcile LB managed SecurityGroup: failed to reconcile managed LoadBalancer 
securityGroup: InvalidVpcID.NotFound: The vpc ID 'vpc-xxx' does not exist\n\tstatus code: 400, 
request id: 62c7d0a2-0945-48c4-8837-0244994a5c19"  "controller"="alb-ingress-controller" "request"={"Namespace":"default","Name":"api"}

vpc-xxx is default value if autoDiscoverAwsVpcID != true
https://github.com/helm/charts/blob/master/incubator/aws-alb-ingress-controller/values.yaml#L18

I added the following settings to make it work. It is better to set in variables by default

settings = {
  autoDiscoverAwsRegion = "true"
  autoDiscoverAwsVpcID  = "true"
}

@karol-bujacek
Copy link
Contributor

@ismailyenigul , I agree that region and VPC configuration may not be obvious and it might cause errors like yours. Although, we prefer not to override these settings by default – I think it may cause troubles with overriding these values by mistake or constantly repeating these two values juts because you want to add different one. In the future we want to improve this configuration.

@karol-bujacek
Copy link
Contributor

One more thing the latest chart version is 1.0.2 at https://github.com/helm/charts/blob/master/incubator/aws-alb-ingress-controller/Chart.yaml
Your default chart seems too old.

@ismailyenigul , thank you. We will update the version after some testing – 0.1.13 and 1.0.2 looks like too big leap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants