IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

Feature Request: Support cluster addons #721

Closed barlock closed 4 years ago

barlock commented 5 years ago

Provide a native mechanism to configure cluster add-ons.

Equivalent of "ibmcloud ks cluster-addons-*"

Terraform Version

0.11.x

Affected Resource(s)

n/a

barlock commented 5 years ago

Likely depends on bluemix-go support https://github.com/IBM-Cloud/bluemix-go/issues/148

somaya10 commented 5 years ago

👍 in need of this feature!

bstoutenburgh commented 4 years ago

:+1: especially with Cluster Autoscaler moving from a helm chart to an addon.

hkantare commented 4 years ago

The support for addons is released in latest v1.2.0 https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v1.12.0 Docs :https://cloud.ibm.com/docs/terraform?topic=terraform-container-resources#container-addon

pauljegouic commented 4 years ago

@hkantare , not working on other resource_group !=Default

provider "ibm" {
    region = "eu-de"
    generation = 2
}

data "ibm_container_vpc_cluster" "cluster" {
  name  = "paul-dataplatform-cluster"
  resource_group_id = "40469f682f5a48ee8f5060da1959d111"
}

resource "ibm_container_addons" "addons" {
  cluster = data.ibm_container_vpc_cluster.cluster.name
  addons {
    name    = "cluster-autoscaler"
    version = "1.0.1"
  }
}

output "cluster" {
  value = data.ibm_container_vpc_cluster.cluster
}
➜  tmp2 terraform apply --auto-approve
data.ibm_container_vpc_cluster.cluster: Refreshing state...
ibm_container_addons.addons: Creating...

Error: Request failed with status code: 404, ServerErrorResponse: {"incidentID":"5d93a32861e3b7ab-CDG","code":"G0004","description":"The specified cluster could not be found. If applicable, make sure that you target the correct account and resource group.","type":"General","recoveryCLI":"To list the clusters you have access to, run 'ibmcloud ks cluster ls'. To list the resource groups that you have access to, run 'ibmcloud resource groups'. To target the resource group, run 'ibmcloud target -g \u003cresource_group\u003e'."}

  on main.tf line 12, in resource "ibm_container_addons" "addons":
  12: resource "ibm_container_addons" "addons" {

Please add support for property resource_group_id

pauljegouic commented 4 years ago

@kavya498 Please fix this feature

mailtokun commented 4 years ago

@hkantare , not working on other resource_group !=Default

provider "ibm" {
    region = "eu-de"
    generation = 2
}

data "ibm_container_vpc_cluster" "cluster" {
  name  = "paul-dataplatform-cluster"
  resource_group_id = "40469f682f5a48ee8f5060da1959d111"
}

resource "ibm_container_addons" "addons" {
  cluster = data.ibm_container_vpc_cluster.cluster.name
  addons {
    name    = "cluster-autoscaler"
    version = "1.0.1"
  }
}

output "cluster" {
  value = data.ibm_container_vpc_cluster.cluster
}
➜  tmp2 terraform apply --auto-approve
data.ibm_container_vpc_cluster.cluster: Refreshing state...
ibm_container_addons.addons: Creating...

Error: Request failed with status code: 404, ServerErrorResponse: {"incidentID":"5d93a32861e3b7ab-CDG","code":"G0004","description":"The specified cluster could not be found. If applicable, make sure that you target the correct account and resource group.","type":"General","recoveryCLI":"To list the clusters you have access to, run 'ibmcloud ks cluster ls'. To list the resource groups that you have access to, run 'ibmcloud resource groups'. To target the resource group, run 'ibmcloud target -g \u003cresource_group\u003e'."}

  on main.tf line 12, in resource "ibm_container_addons" "addons":
  12: resource "ibm_container_addons" "addons" {

Please add support for property resource_group_id

I got same error. Please support resource_group_id

mailtokun commented 4 years ago

opened an issue for tracking : https://github.com/IBM-Cloud/terraform-provider-ibm/issues/1920

hkantare commented 4 years ago

Fixed in latest release https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v1.13.0