Skip to content

Instantly share code, notes, and snippets.

@xuqingfeng
Created December 25, 2018 06:30
Show Gist options
  • Save xuqingfeng/e736171417491c7a9734361f6223d976 to your computer and use it in GitHub Desktop.
Save xuqingfeng/e736171417491c7a9734361f6223d976 to your computer and use it in GitHub Desktop.
AliYun ticket support
data "alicloud_instance_types" "1c1g" {
cpu_core_count = "1"
memory_size = "1"
}
resource "alicloud_cs_kubernetes" "k8s" {
name = "${var.k8s_name}"
count = "${var.k8s_number}"
vswitch_ids = ["${alicloud_vswitch.vswitch-app-az-a.id}", "${alicloud_vswitch.vswitch-app-az-b.id}", "${alicloud_vswitch.vswitch-app-az-c.id}"]
new_nat_gateway = false
master_instance_types = ["${data.alicloud_instance_types.1c1g.instance_types.0.id}", "${data.alicloud_instance_types.1c1g.instance_types.0.id}", "${data.alicloud_instance_types.1c1g.instance_types.0.id}"]
worker_instance_types = ["${data.alicloud_instance_types.1c1g.instance_types.0.id}", "${data.alicloud_instance_types.1c1g.instance_types.0.id}", "${data.alicloud_instance_types.1c1g.instance_types.0.id}"]
worker_numbers = "${var.k8s_worker_numbers}"
master_disk_category = "${var.k8s_master_disk_category}"
worker_disk_category = "${var.k8s_worker_disk_category}"
master_disk_size = "${var.k8s_master_disk_size}"
worker_disk_size = "${var.k8s_worker_disk_size}"
password = "${lookup(data.external.vault.result, "k8s_password")}"
pod_cidr = "${var.k8s_pod_cidr}"
service_cidr = "${var.k8s_service_cidr}"
enable_ssh = false
slb_internet_enabled = false
depends_on = ["alicloud_snat_entry.snats"]
}
variable k8s_name {
default = "***"
}
variable k8s_number {
default = 1
}
variable "k8s_worker_numbers" {
type = "list"
default = [1, 1, 1]
}
variable "k8s_master_disk_category" {
default = "cloud_efficiency"
}
variable "k8s_worker_disk_category" {
default = "cloud_efficiency"
}
variable "k8s_master_disk_size" {
default = 40
}
variable "k8s_worker_disk_size" {
default = 30
}
variable "k8s_pod_cidr" {
default = "172.16.0.0/16"
}
variable "k8s_service_cidr" {
default = "172.17.0.0/16"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment