rtlnl / terraform-kubernetes-linkerd2

Terraform module to deploy Linkerd2 on Kubernetes
MIT License
9 stars 3 forks source link

Unable to import module in project with Terraform 0.13.4 #10

Open wgebis opened 4 years ago

wgebis commented 4 years ago

Describe the bug Unable to import module in project with Terraform 13.4 due to:

Error: Invalid reference from destroy provisioner

  on .terraform/modules/linkerd/crds.tf line 17, in resource "null_resource" "crds":
  17:     command = "kubectl delete -f - <<EOF\n${data.template_file.crds.rendered}\nEOF"

Also two warning about deprecation also are there:

Warning: Interpolation-only expressions are deprecated

  on .terraform/modules/linkerd/controller.tf line 216, in resource "kubernetes_deployment" "linkerd_controller":
 216:             "${local.linkerd_deployment_incoming_proxy_port}",

(and 38 more similar warnings elsewhere)

....

Warning: Quoted keywords are deprecated

  on .terraform/modules/linkerd/crds.tf line 16, in resource "null_resource" "crds":
  16:     when = "destroy"

To Reproduce

  1. Put module in tf file
    module "linkerd" {
    source = "git::ssh://git@github.com/rtlnl/terraform-aws-linkerd2.git?ref=main"
    }
  2. Import it
    terraform init

Expected behavior Possibility to import module on Terraform >=0.13.4

Desktop (please complete the following information):

spaghettifunk commented 4 years ago

Thank you for reporting this bug @wgebis. I will take a look into this and solve it asap.

spaghettifunk commented 4 years ago

The problem has been fixed and tested with terraform 0.13.5 and kind. Let me know if the problem still appear! Thank you again šŸ‘

wgebis commented 4 years ago

Hi @spaghettifunk , Not sure if it is referred to that ticket, but I think you shout mark empty_dir under followed volume as lifecycle ignored:

 ~ volume {
                        name = "data"

                      - empty_dir {}
                    }

Every terraform apply discover that change (promethues and grafana deployment)

wgebis commented 4 years ago

And also that issue I've got:

It appears that you are trying to reach this service with a host of 'my_domain.
This does not match /^(localhost|127\.0\.0\.1|linkerd-web\.linkerd\.svc\.cluster\.local|linkerd-web\.linkerd\.svc|\[::1\])(:\d+)?$/ and has been denied for security reasons.
Please see https://linkerd.io/dns-rebinding for an explanation of what is happening and how to fix it.
spaghettifunk commented 4 years ago

I'll take a look at it tomorrow. Thanks for reporting šŸ‘