hashicorp / terraform-provider-helm

Terraform Helm provider
https://www.terraform.io/docs/providers/helm/
Mozilla Public License 2.0
1.01k stars 371 forks source link

helm_release does not wait for daemonsets to be ready #1364

Open c4milo opened 6 months ago

c4milo commented 6 months ago

Terraform, Provider, Kubernetes and Helm Versions

❯ terraform version
Terraform v1.7.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/azurerm v3.102.0
+ provider registry.terraform.io/hashicorp/helm v2.13.2
+ provider registry.terraform.io/hashicorp/kubernetes v2.29.0
+ provider registry.terraform.io/hashicorp/random v3.6.1

Your version of Terraform is out of date! The latest version
is 1.8.3. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

Terraform Configuration Files

locals {
  redpanda_node_setup = "redpanda-node-setup"
}

resource "kubernetes_namespace" "redpanda_node_setup" {
  metadata {
    name = local.redpanda_node_setup
  }
}

resource "helm_release" "redpanda_node_setup" {
  name              = local.redpanda_node_setup
  chart             = "${path.module}/helm_charts/node-setup"
  version           = var.redpanda_node_setup_chart_version
  namespace         = kubernetes_namespace.redpanda_node_setup.id
  atomic            = true
  wait              = true
  wait_for_jobs     = true
  skip_crds         = true
  lint              = true
  cleanup_on_fail   = true  # it should be safe as long as we skip installing CRDs through Helm.
  verify            = false # enable cryptographic verification of provenance
  dependency_update = false
  create_namespace  = false
  max_history       = 5
  timeout           = 300 # 5min, destroy operations take a while.

  values = [
    "${templatefile("${path.module}/templates/redpanda_node_setup.helm.values.yml.tftpl", {
      node_setup_script = file("${path.module}/files/node_setup.bash")
    })}"
  ]
}

Debug Output

module.cert_manager.kubernetes_manifest.cert_manager_crds["files/crds/cert_manager.crd.2.yml"]: Creating...
2024-05-09T18:28:47.502-0400 [INFO]  Starting apply for module.cert_manager.kubernetes_manifest.cert_manager_crds["files/crds/cert_manager.crd.2.yml"]
2024-05-09T18:28:47.502-0400 [DEBUG] skipping FixUpBlockAttrs
2024-05-09T18:28:47.506-0400 [DEBUG] module.cert_manager.kubernetes_manifest.cert_manager_crds["files/crds/cert_manager.crd.2.yml"]: applying the planned Create change
2024-05-09T18:28:47.966-0400 [INFO]  provider.terraform-provider-helm_v2.13.2_x5: 2024/05/09 18:28:47 [DEBUG] creating 2 resource(s): timestamp=2024-05-09T18:28:47.966-0400
2024-05-09T18:28:48.025-0400 [INFO]  provider.terraform-provider-helm_v2.13.2_x5: 2024/05/09 18:28:48 [DEBUG] beginning wait for 2 resources with timeout of 5m0s: timestamp=2024-05-09T18:28:48.025-0400
module.redpanda_node_setup.helm_release.redpanda_node_setup: Creation complete after 1s [id=redpanda-node-setup]
2024-05-09T18:28:48.115-0400 [INFO]  provider.terraform-provider-helm_v2.13.2_x5: 2024/05/09 18:28:48 [DEBUG] creating 8 resource(s): timestamp=2024-05-09T18:28:48.115-0400
2024-05-09T18:28:48.229-0400 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot

Panic Output

Steps to Reproduce

  1. terraform apply

Expected Behavior

I was expecting it will wait for 3 daemonset pods to be ready before continuing.

Actual Behavior

It continued to the next resource right after scheduling the daemonset

Important Factoids

References

Community Note

iamunni commented 2 months ago

@jrhouston I'd like to take a look at this