Skip to content

Commit 65e4cca

Browse files
committed
support setting kubernetes version
1 parent ad58066 commit 65e4cca

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

examples/basic/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ variable "profile" {
22
default = "default"
33
}
44
variable "region" {
5-
default = "cn-zhangjiakou"
5+
default = "cn-hangzhou"
66
}
77
variable "zone_id" {
8-
default = "cn-zhangjiakou-a"
8+
default = "cn-hangzhou-e"
99
}
1010
variable "vpc_cidr" {
1111
default = "10.1.0.0/21"
1212
}
1313
variable "availability_zones" {
14-
default = ["cn-zhangjiakou-a", "cn-zhangjiakou-b", "cn-zhangjiakou-c"]
14+
default = ["cn-hangzhou-e", "cn-hangzhou-f", "cn-hangzhou-g"]
1515
}
1616

1717
provider "alicloud" {

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "alicloud_cs_managed_kubernetes" "this" {
1818
service_cidr = var.k8s_service_cidr
1919
slb_internet_enabled = true
2020
install_cloud_monitor = true
21+
version = var.kubernetes_version
2122
worker_instance_types = var.worker_instance_types
2223
worker_number = var.worker_number
2324
dynamic "addons" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ variable "memory_size" {
7777
default = 2
7878
}
7979

80+
variable "kubernetes_version" {
81+
description = "Desired Kubernetes version"
82+
type = string
83+
default = ""
84+
}
85+
8086
variable "worker_instance_types" {
8187
description = "The ecs instance type used to launch worker nodes. If not set, data source `alicloud_instance_types` will return one based on `cpu_core_count` and `memory_size`."
8288
type = list(string)

0 commit comments

Comments
 (0)