alicloud_cs_kubernetes_addon_metadata

更新时间:

This data source provides metadata of kubernetes cluster addons.

-> NOTE: Available in 1.166.0+.

Example Usage

variable "name" {
  default = "terraform-example"
}

data "alicloud_zones" "default" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "default" {
  vpc_name   = var.name
  cidr_block = "10.4.0.0/16"
}

resource "alicloud_vswitch" "default" {
  vswitch_name = var.name
  cidr_block   = "10.4.0.0/24"
  vpc_id       = alicloud_vpc.default.id
  zone_id      = data.alicloud_zones.default.zones.0.id
}

resource "alicloud_cs_managed_kubernetes" "default" {
  name_prefix          = var.name
  cluster_spec         = "ack.pro.small"
  worker_vswitch_ids   = [alicloud_vswitch.default.id]
  new_nat_gateway      = false
  pod_cidr             = cidrsubnet("10.0.0.0/8", 8, 36)
  service_cidr         = cidrsubnet("172.16.0.0/16", 4, 7)
  slb_internet_enabled = true
}

data "alicloud_cs_kubernetes_addon_metadata" "default" {
  cluster_id = local.cluster_id
  name       = "nginx-ingress-controller"
  version    = "v1.1.2-aliyun.2"
}

locals {
  cluster_id = alicloud_cs_managed_kubernetes.default.id
}

// Output addon configuration that can be customized
output "addon_config_schema" {
  value = data.alicloud_cs_kubernetes_addon_metadata.default.config_schema
}

Argument Reference

The following arguments are supported.

  • cluster_id - (Required) The id of kubernetes cluster.
  • name - (Required) The name of the cluster addon. You can get a list of available addons that the cluster can install by using data source alicloud_cs_kubernetes_addons.
  • version - (Required) The version of the cluster addon.

Attributes Reference

The following attributes are exported in addition to the arguments listed above:

  • config_schema - The addon configuration that can be customized. The returned format is the standard json schema. If return empty, it means that the addon does not support custom configuration yet.