aliyun / terraform-provider-alicloud

Terraform AliCloud provider
https://www.terraform.io/docs/providers/alicloud/
Mozilla Public License 2.0
590 stars 553 forks source link

Addon to disable nginx-ingress-controller in alicloud_cs_managed_kubernetes_clusters has no effect #2431

Open owaisaamir opened 4 years ago

owaisaamir commented 4 years ago

Addon to disable nginx-ingress-controller in alicloud_cs_managed_kubernetes_clusters has no effect.

Terraform Version

$ terraform -v
Terraform v0.12.21
+ provider.alicloud v1.80.0

Affected Resource(s)

Terraform Configuration Files

resource "alicloud_vpc" "vpc" {
  name       = "vpc-name"
  cidr_block = "10.10.0.0/16"
}

resource "alicloud_vswitch" "vswitch" {
  vpc_id            = alicloud_vpc.vpc.id
  name              = "vswitch-name"
  availability_zone = "cn-beijing-a"
  cidr_block        = "10.10.1.0/24"
}

data "alicloud_images" "os_image" {
  owners     = "system"
  name_regex = "^centos_7_7"
}

resource "alicloud_key_pair" "public_key" {
  key_name   = "public-key"
  public_key = "ABCXYZ"
}

resource "alicloud_cs_managed_kubernetes" "kubernetes_cluster" {

  name     = "TestManagedCLuster"
  version  = "1.16.6-aliyun.1"
  image_id = data.alicloud_images.os_image.ids[0]

  key_name = alicloud_key_pair.public_key.key_name

  worker_number         = 2
  worker_instance_types = ["ecs.sn2ne.2xlarge"]
  worker_vswitch_ids    = [alicloud_vswitch.vswitch.id]
  worker_disk_category  = "cloud_ssd"
  worker_disk_size      = 128

  pod_cidr       = "10.20.1.0/24"
  service_cidr   = "10.30.1.0/24"
  node_cidr_mask = 24

  addons {
    name = "flannel"
  }

  addons {
    name     = "nginx-ingress-controller"
    disabled = true
  }
}

Expected Behavior

What should have happened?

  1. Managed kubernetes cluster is created without nginx-ingress-controller
  2. No nginx-ingress service should be created.

Actual Behavior

What actually happened?

  1. Managed kubernetes cluster is created with nginx-ingress-controller
  2. nginx-ingress service is created.

Steps to Reproduce

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

  1. terraform apply
  2. terraform destroy
shxdxwraze commented 4 years ago

Make disabled boolean

 {
    "name"     = "nginx-ingress-controller",
    "config"   = "",
    "disabled": true,
  }

Anyway this option works only on the first run if you will change it wouldn't have any effect.