-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
223 lines (192 loc) · 6.43 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
variable "name" {
description = "Specifies the CCE node pool name"
type = string
nullable = false
}
variable "name_postfix" {
description = "Specifies the CCE node pool name postfix"
type = string
default = null
}
variable "region" {
description = "Specifies the region in which to create the CCE node pool resource, if omitted, the provider-level region will be used"
type = string
default = null
}
variable "cluster_id" {
description = "Specifies the CCE cluster ID"
type = string
nullable = false
}
variable "initial_node_count" {
description = "Specifies the initial number of expected nodes in the node pool"
type = number
default = 2
}
variable "flavor_id" {
description = "Specifies the flavor ID"
type = string
default = "s6.xlarge.2"
}
variable "type" {
description = "Specifies the node pool type"
type = string
default = "vm"
validation {
condition = contains(["vm", "ElasticBMS"], var.type)
error_message = "Possible values are: 'vm' and 'ElasticBMS'."
}
}
variable "availability_zone" {
description = "Specifies the name of the available partition (AZ)"
type = string
default = null
}
variable "os" {
description = "Specifies the operating system of the node"
type = string
default = "EulerOS 2.9"
}
variable "key_pair" {
description = "Specifies the key pair name when logging in to select the key pair mode"
type = string
nullable = false
}
variable "subnet_id" {
description = "Specifies the ID of the subnet to which the NIC belongs"
type = string
nullable = false
}
variable "max_pods" {
description = "Specifies the maximum number of instances a node is allowed to create"
type = number
default = null
}
variable "ecs_group_id" {
description = "pecifies the ECS group ID, if specified, the node will be created under the cloud server group"
type = string
default = null
}
variable "preinstall" {
description = "Specifies the script to be executed before installation, the input value can be a Base64 encoded string or not"
type = string
default = null
}
variable "postinstall" {
description = "Specifies the script to be executed after installation, the input value can be a Base64 encoded string or not"
type = string
default = null
}
variable "extend_param" {
description = <<DES
Specifies the extended parameter. The available keys are as follows:
* `agency_name`: The agency name to provide temporary credentials for CCE node to access other cloud services;
* `alpha.cce/NodeImageID`: The custom image ID used to create the BMS nodes;
* `dockerBaseSize`: The available disk space of a single docker container on the node in device mapper mode;
* `DockerLVMConfigOverride`: Specifies the data disk configurations of Docker.
DES
type = map(string)
default = {}
}
variable "scall_enable" {
description = <<DES
Specifies whether to enable auto scaling. If Autoscaler is enabled, install the autoscaler add-on to use the
auto scaling feature.
DES
type = bool
default = false
}
variable "min_node_count" {
description = "Specifies the minimum number of nodes allowed, if auto scaling is enabled"
type = number
default = 1
}
variable "max_node_count" {
description = "Specifies the maximum number of nodes allowed, if auto scaling is enabled"
type = number
default = 10
}
variable "scale_down_cooldown_time" {
description = "Specifies the time interval between two scaling operations, in minutes"
type = number
default = null
}
variable "priority" {
description = "Specifies the weight of the node pool, a node pool with a higher weight has a higher priority during scaling"
type = number
default = null
}
variable "security_groups" {
description = "Specifies the list of custom security group IDs for the node pool"
type = list(string)
default = null
}
variable "pod_security_groups" {
description = "Specifies the list of security group IDs for the pod, only supported in CCE Turbo clusters"
type = list(string)
default = null
}
variable "labels" {
description = "Specifies the tags of a Kubernetes node, key/value pair format"
type = map(string)
default = {}
}
variable "runtime" {
description = "Specifies the runtime of the CCE node pool"
type = string
default = "containerd"
validation {
condition = contains(["docker", "containerd"], var.runtime)
error_message = "Possible values are: 'docker' and 'containerd'."
}
}
variable "taints" {
description = <<DES
Specifies the taints configuration of the nodes to set anti-affinity
* `key` - A key must contain 1 to 63 characters starting with a letter or digit, only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed;
* `value` - A value must start with a letter or digit and can contain a maximum of 63 characters, including letters, digits, hyphens (-), underscores (_), and periods (.);
* `effect` - Available options are NoSchedule, PreferNoSchedule, and NoExecute.
DES
type = set(object({
effect = string
key = string
value = string
}))
default = []
}
variable "root_volume" {
description = <<DES
Specifies the configuration of the system disk:
* `size`- Specifies the disk size in GB, root volume size must between 40 and 1024;
* `volumetype` - Specifies the disk type;
* `extend_params` - Specifies the disk expansion parameters.
DES
type = object({
size = optional(number, 40)
volumetype = optional(string, "SAS")
extend_params = optional(map(string))
})
}
variable "data_volume" {
description = <<DES
Specifies the configuration of the data disks:
* `size`- Specifies the disk size in GB, data volume size must between 100 and 32768;
* `volumetype` - Specifies the disk type;
* `extend_params` - Specifies the disk expansion parameters.
DES
type = object({
size = optional(number, 100)
volumetype = optional(string, "SAS")
extend_params = optional(map(string))
})
}
variable "kms_key_id" {
description = "Specifies the KMS key ID, this is used to encrypt the volume"
type = string
default = null
}
variable "tags" {
description = "Specifies the key/value pairs to associate with the resources"
type = map(string)
default = {}
}