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

addons not being enabled post-cluster creation #2346

Closed
evpirnia opened this issue Mar 12, 2021 · 1 comment
Closed

addons not being enabled post-cluster creation #2346

evpirnia opened this issue Mar 12, 2021 · 1 comment

Comments

@evpirnia
Copy link

Terraform Version

Terraform v0.12.20

Affected Resource(s)

  • ibm_container_addons

Terraform Configuration Files

variables.tf

// ... 
variable cluster_addons {
  description = "list of cluster addons with name and (optional) version defined to be enabled on cluster"
  type = list(object({
    name = string
  }))
  default = [
    { name = "istio", version = "1.8" },
    { name = "kube-terminal" },
    { name = "vpc-block-csi-driver" }
  ]
}

main.tf

##############################################################################
# IBM Cloud Provider
##############################################################################
provider ibm {
  ibmcloud_api_key = var.ibmcloud_apikey
  region           = var.ibm_region
  generation       = var.generation
  ibmcloud_timeout = 60
}
##############################################################################
# Data blocks
##############################################################################
data ibm_resource_group group {
  name = var.resource_group
}

data ibm_is_vpc vpc {
  name = var.vpc_name
}
##############################################################################
# IKS
##############################################################################
resource ibm_container_vpc_cluster cluster {
  name              = var.cluster_name
  vpc_id            = data.ibm_is_vpc.vpc.id
  flavor            = var.machine_type
  // ... 
}

data ibm_container_cluster_config cluster {
  cluster_name_id   = ibm_container_vpc_cluster.cluster.id
  resource_group_id = data.ibm_resource_group.group.id
  config_dir        = path.root
  admin             = true
  network           = true
}
##############################################################################
# Addons
##############################################################################
resource ibm_container_addons cluster_addons {  
  cluster           = ibm_container_vpc_cluster.cluster.id
  resource_group_id = data.ibm_resource_group.group.id

  dynamic "addons" {
    for_each = var.cluster_addons
    content {
      name    = addons.value["name"]
      version = lookup(addons.value, "version", null) // The version is not always specified
    }
  }

  depends_on = [ibm_container_vpc_cluster.cluster]
}

Debug Output

See slack thread for debug output: https://ibm-cloudplatform.slack.com/archives/G01R0RTA3QT/p1615512168000100

Panic Output

None

Expected Behavior

All 3 addons should be enabled on the cluster.

Actual Behavior

Only the Block Storage for VPC addon was enabled on the cluster.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

None

References

None

@kavya498
Copy link
Collaborator

Fixed in latest

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

2 participants