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

ibm_container_worker_pool_zone_attachment should wait for ALBs to finish in a new zone #1372

Closed
hasueki opened this issue Apr 24, 2020 · 0 comments

Comments

@hasueki
Copy link
Contributor

hasueki commented Apr 24, 2020

Terraform Version

Terraform v0.12.20

Affected Resource(s)

  • ibm_container_worker_pool_zone_attachment

Terraform Configuration Files

data "ibm_container_cluster" "cluster" {
  cluster_name_id = ibm_container_cluster.cluster.id
}

resource "ibm_container_cluster" "cluster" {
  name              = "cluster-1"
  datacenter        = "dal10"
  machine_type      = "b3c.4x16"
  hardware          = "shared"
  private_vlan_id   = "<PRIVATE_VLAN_ID>"
  public_vlan_id    = "<PUBLIC_VLAN_ID>"
  kube_version      = "1.17"
  default_pool_size = "1"
}

resource "ibm_container_worker_pool_zone_attachment" "zone" {
  worker_pool     = "default"
  cluster         = ibm_container_cluster.cluster.name
  zone            = "dal12"
  private_vlan_id = "<PRIVATE_VLAN_ID>"
  public_vlan_id  = "<PUBLIC_VLAN_ID>"
}

resource "ibm_container_alb" "disable_public_alb1" {
  depends_on = [
    ibm_container_cluster.cluster
  ]

  alb_id = [
    for alb in ibm_container_cluster.cluster.albs:
      alb.id if alb.alb_type == "public" && length(regexall("alb1", alb.id)) > 0
  ][0]
  disable_deployment = true
}

resource "ibm_container_alb" "disable_public_alb2" {
  depends_on = [
    ibm_container_cluster.cluster,
    ibm_container_worker_pool_zone_attachment.zone
  ]

  alb_id = [
    for alb in data.ibm_container_cluster.cluster.albs:
      alb.id if alb.alb_type == "public" && length(regexall("alb2", alb.id)) > 0
  ][0]
  disable_deployment = true
}

Expected Behavior

When creating a worker pool attachment in a new zone, it should wait for the default ALBs (private and public) in the new zones to finish associating to the cluster.

Actual Behavior

The worker pool zone attachment only waits for the new workers to become ready, and finishes before the new ALBs to come up in the new zones. This causes issues in my use case above, to go ahead and disable the ALBs and Terraform apply will fail since the ALB creation is still underway. disable_public_alb1 works as expected because ibm_container_cluster waits for ALBs to finish, but is not the case with ibm_container_worker_pool_zone_attachment.

Steps to Reproduce

  1. Set appropriate values
  2. terraform apply

References

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

No branches or pull requests

1 participant