Skip to content

wait_for_load_balancer on kubernetes_service data sourcesΒ #2787

@pinarruiz

Description

@pinarruiz

Description

Add an option on the data source to have a similar functionality to wait_for_load_balancer from kubernetes_service resource.

Potential Terraform Configuration

Right now, when deploying traefik (with helm), I use this to get the same functionality, but seems kinda janky to do (or maybe not and I am wrong)

resource "time_sleep" "wait_60_seconds" {
  count = local.enable_traefik ? 1 : 0

  create_duration = "60s"

  triggers = {
    # always_run = timestamp()
    traefik = jsonencode(helm_release.traefik[0])
  }

  depends_on = [helm_release.traefik]
}

data "kubernetes_service" "traefik" {
  count = local.enable_traefik ? 1 : 0

  metadata {
    name        = "traefik"
    namespace   = "traefik"
    annotations = { tf-helm-name = "traefik-helm" }
  }

  depends_on = [time_sleep.wait_60_seconds[0]]
}

As it can be seen, i have a time_sleep that waits 60 seconds, everytime the traefik helm deployment is changed, having the wait_for_load_balancer would make it so much easier and cleaner.

This particular use case is to register some domains that will point to traefik.

References

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions