-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
255 lines (219 loc) · 7 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
######################
# provider
######################
variable "region" {
description = "(Deprecated from version 1.4.0) The region used to launch this module resources."
type = string
default = ""
}
variable "profile" {
description = "(Deprecated from version 1.4.0) The profile name as set in the shared credentials file. If not set, it will be sourced from the ALICLOUD_PROFILE environment variable."
type = string
default = ""
}
variable "shared_credentials_file" {
description = "(Deprecated from version 1.4.0) This is the path to the shared credentials file. If this is not set and a profile is specified, $HOME/.aliyun/config.json will be used."
type = string
default = ""
}
variable "skip_region_validation" {
description = "(Deprecated from version 1.4.0) Skip static validation of region ID. Used by users of alternative AlibabaCloud-like APIs or users w/ access to regions that are not public (yet)."
type = bool
default = false
}
######################
# Instance typs variables
######################
variable "cpu_core_count" {
description = "CPU core count is used to fetch instance types."
type = number
default = 1
}
variable "memory_size" {
description = "Memory size used to fetch instance types."
type = number
default = 2
}
variable "k8s_number" {
description = "The number of kubernetes cluster."
type = number
default = 1
}
######################
# VPC variables
######################
variable "vpc_name" {
description = "The vpc name used to create a new vpc when 'vpc_id' is not specified. Default to variable `example_name`"
type = string
default = ""
}
variable "create_vpc" {
description = "Boolean. If you have a vpc already, use that one, else make this true and one will be created."
type = bool
default = false
}
variable "vpc_id" {
description = "Existing vpc id used to create several vswitches and other resources."
type = string
default = ""
}
variable "example_name" {
description = "The name as prefix used to create resources."
type = string
default = "tf-example-kubernetes"
}
variable "vpc_cidr" {
description = "The cidr block used to launch a new vpc when 'vpc_id' is not specified."
type = string
default = "10.0.0.0/8"
}
######################
# VSwitch variables
######################
variable "vswitch_name_prefix" {
type = string
description = "The vswitch name prefix used to create several new vswitches. Default to variable 'example_name'."
default = ""
}
variable "number_format" {
description = "The number format used to output."
type = string
default = "%02d"
}
variable "vswitch_ids" {
description = "List of existing vswitch id."
type = list(string)
default = []
}
variable "vswitch_cidrs" {
description = "List of cidr blocks used to create several new vswitches when 'vswitch_ids' is not specified."
type = list(string)
default = ["10.1.0.0/16", "10.2.0.0/16", "10.3.0.0/16"]
}
variable "k8s_name_prefix" {
description = "The name prefix used to create several kubernetes clusters. Default to variable `example_name`"
type = string
default = ""
}
variable "new_nat_gateway" {
type = bool
description = "Whether to create a new nat gateway. In this template, a new nat gateway will create a nat gateway, eip and server snat entries."
default = true
}
variable "master_instance_types" {
description = "The ecs instance types used to launch master nodes."
type = list(string)
default = []
}
variable "worker_instance_types" {
description = "The ecs instance types used to launch worker nodes."
type = list(string)
default = []
}
variable "node_cidr_mask" {
type = number
description = "The node cidr block to specific how many pods can run on single node. Valid values: [24-28]."
default = 24
}
variable "enable_ssh" {
description = "Enable login to the node through SSH."
type = bool
default = false
}
variable "cpu_policy" {
type = string
description = "kubelet cpu policy. Valid values: 'none','static'. Default to 'none'."
default = "none"
}
variable "proxy_mode" {
description = "Proxy mode is option of kube-proxy. Valid values: 'ipvs','iptables'. Default to 'iptables'."
type = string
default = "iptables"
}
variable "master_password" {
description = "The password of master ECS instance."
type = string
default = "Just4Test"
}
variable "k8s_worker_number" {
description = "The number of worker nodes in kubernetes cluster."
type = number
default = 2
}
# k8s_pod_cidr is only for flannel network
variable "k8s_pod_cidr" {
description = "The kubernetes pod cidr block. It cannot be equals to vpc's or vswitch's and cannot be in them."
type = string
default = "172.20.0.0/16"
}
variable "k8s_service_cidr" {
description = "The kubernetes service cidr block. It cannot be equals to vpc's or vswitch's or pod's and cannot be in them."
type = string
default = "172.21.0.0/20"
}
variable "k8s_version" {
description = "The version of the kubernetes version."
type = string
default = ""
}
variable "cluster_addons" {
description = "Addon components in kubernetes cluster"
type = list(object({
name = string
config = string
}))
default = []
}
######################
# node pool variables
######################
variable "worker_password" {
description = "The password of worker ECS instance."
type = list(string)
default = ["Just4Test"]
}
variable "install_cloud_monitor" {
description = "Install cloud monitor agent on ECS."
type = bool
default = true
}
variable "instance_charge_type" {
description = "The charge type of instance. Choices are 'PostPaid' and 'PrePaid'."
type = string
default = "PostPaid"
}
variable "subscription" {
description = "A mapping of fields for Prepaid ECS instances created. "
type = map(string)
default = {
period = 1
period_unit = "Month"
auto_renew = false
auto_renew_period = 1
}
}
variable "system_disk_category" {
description = "The system disk category used to launch one or more worker ecs instances."
type = string
default = "cloud_efficiency"
}
variable "system_disk_size" {
description = "The system disk size used to launch one or more worker ecs instances."
type = number
default = 40
}
variable "data_disks" {
description = "Additional data disks to attach to the scaled ECS instance."
type = list(map(string))
default = []
}
variable "disk_category" {
description = "The system disk category used to launch one or more worker ecs instances."
type = string
default = "cloud_efficiency"
}
variable "disk_size" {
description = "The system disk size used to launch one or more worker ecs instances."
type = number
default = 40
}