-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvariables.tf
397 lines (371 loc) · 13.3 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
### Required Ocean VNG (Launch Spec) Configurations
variable "ocean_id" {
type = string
description = "Ocean ID"
}
variable "name" {
type = string
description = "Name for nodegroup (VNG)"
}
###################
## Optional VNG Configurations
variable "user_data" {
type = string
default = null
}
variable "image_id" {
type = string
default = null
description = "ID of the image used to launch the instances."
}
variable "iam_instance_profile" {
type = string
default = null
description = "The ARN or name of an IAM instance profile to associate with launched instances"
}
variable "security_groups" {
type = list(string)
default = null
description = "List of security groups"
}
variable "subnet_ids" {
type = list(string)
default = null
description = "List of subnets"
}
variable "instance_types" {
type = list(string)
default = null
description = "Specific instance types permitted by this VNG. For example, [\"m5.large\",\"m5.xlarge\"]"
}
variable "preferred_spot_types" {
type = list(string)
default = null
description = "A list of instance types. Takes the preferred types into consideration while maintaining a variety of machine types running for optimized distribution."
}
variable "preferred_od_types" {
type = list(string)
default = null
description = "A list of instance types. Takes the preferred types into consideration while maintaining a variety of machine types running for optimized distribution."
}
variable "root_volume_size" {
type = number
default = 30
description = "Size of root volume"
}
variable "tags" {
type = map(string)
default = null
description = "(Optional) Tags by default will be inherited from the ocean_aws resource. If set this will overwrite all tags and not add additional tags to those already configured."
}
variable "associate_public_ip_address" {
type = bool
default = null
description = "Configure public IP address allocation."
}
variable "restrict_scale_down" {
type = bool
default = null
description = "When set to True, nodes will be treated as if all pods running have the restrict-scale-down label. Therefore, Ocean will not scale nodes down unless empty."
}
## instance_metadata_options ##
# Ocean instance metadata options object for IMDSv2
variable "http_tokens" {
type = string
default = "optional"
description = "Determines if a signed token is required or not. Valid values: 'optional' or 'required'."
validation {
condition = contains(["optional", "required"], var.http_tokens)
error_message = "Valid values: 'optional' or 'required'."
}
}
variable "http_put_response_hop_limit" {
type = number
default = 1
description = "An integer from 1 through 64. The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further the instance metadata requests can travel."
validation {
condition = var.http_put_response_hop_limit >= 1 && var.http_put_response_hop_limit <= 64
error_message = "Valid values: integer value between 1 and 64."
}
}
###################
variable "labels" {
type = list(object({
key = string
value = string
}))
default = null
description = "NodeLabels / NodeSelectors"
}
variable "taints" {
type = list(object({
key = string
value = string
effect = string
}))
default = null
description = "taints / toleration"
}
## elastic_ip_pool ##
variable "elastic_ip_pool_tag_selector" {
type = map(string)
default = null
description = "Elastic IP tag key. The Virtual Node Group will consider all Elastic IPs tagged with this tag as a part of the Elastic IP pool to use."
}
###################
## Block Device Mappings ##
variable "block_device_mappings" {
description = "Block Device Mapping Object"
type = list(any)
default = []
}
variable "dynamic_volume_size" {
type = object({
base_size = number
resource = string
size_per_resource_unit = number
})
default = null
description = "dynamic_volume_size Object"
}
##################
## autoscale_headrooms_automatic ##
variable "auto_headroom_percentage" {
type = number
default = null
description = "Number between 0-200 to control the headroom % of the specific Virtual Node Group. Effective when cluster.autoScaler.headroom.automatic.is_enabled = true is set on the Ocean cluster."
}
##################
## autoscale_headrooms ##
variable "num_of_units" {
type = number
default = 0
description = "The number of units to retain as headroom, where each unit has the defined headroom CPU, memory and GPU."
}
variable "cpu_per_unit" {
type = number
default = null
description = "Optionally configure the number of CPUs to allocate for each headroom unit. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU."
}
variable "gpu_per_unit" {
type = number
default = null
description = "Optionally configure the number of GPUS to allocate for each headroom unit."
}
variable "memory_per_unit" {
type = number
default = null
description = "Optionally configure the amount of memory (MiB) to allocate for each headroom unit."
}
##################
## resource_limits ##
variable "max_instance_count" {
type = number
default = null
description = "(Optional) Set a maximum number of instances per Virtual Node Group. Can be null. If set, value must be greater than or equal to 0."
}
variable "min_instance_count" {
type = number
default = null
description = "(Optional) Set a minimum number of instances per Virtual Node Group. Can be null. If set, value must be greater than or equal to 0."
}
##################
## strategy ##
variable "spot_percentage" {
type = number
default = 100
description = "Percentage of VNG that will run on EC2 Spot instances and remaining will run on-demand"
}
variable "draining_timeout" {
type = number
default = 300
description = "The configurable amount of time that Ocean will wait for the draining process to complete before terminating an instance."
}
variable "utilize_commitments" {
type = bool
default = false
description = "When set as ‘true’, if savings plans commitments have available capacity, Ocean will utilize them alongside RIs (if exist) to maximize cost efficiency. If the value is set as 'null', it will automatically be inherited from the cluster level."
}
variable "utilize_reserved_instances" {
type = bool
default = true
description = "When set as ‘true’, if reserved instances exist, Ocean will utilize them before launching spot instances. If the value is set as 'null', it will automatically be inherited from the cluster level."
}
###################
## create_options ##
variable "initial_nodes" {
type = number
default = null
description = "When set to an integer greater than 0, a corresponding amount of nodes will be launched from the created virtual node group."
}
##################
## delete_options ##
variable "force_delete" {
type = bool
default = false
description = "When set to true, delete even if it is the last Virtual Node Group (also, the default Virtual Node Group must be configured with useAsTemplateOnly = true). Should be set at creation or update, but will be used only at deletion."
}
variable "delete_nodes" {
type = bool
default = false
description = "When set to true, all instances belonging to the deleted launch specification will be drained, detached, and terminated."
}
##################
## scheduling_shutdown_hours.tf ##
variable "scheduling_task" {
type = list(object({
is_enabled = bool
cron_expression = string
task_type = string
num_of_units = number
cpu_per_unit = number
gpu_per_unit = number
memory_per_unit = number
}))
default = null
description = "scheduling_task Object"
}
##################
## scheduling_tasks.tf ##
variable "scheduling_shutdown_hours" {
type = object({
time_windows = list(string)
is_enabled = bool
})
default = null
description = "scheduling_shutdown_hours Object"
}
##################
## update_policy ##
variable "should_roll" {
type = bool
default = false
description = "Enables the roll."
}
variable "batch_size_percentage" {
default = "20"
type = number
description = "Sets the percentage of the instances to deploy in each batch."
}
variable "respect_pdb" {
type = bool
default = null
description = "Default: false. During the roll, if the parameter is set to true we honor PDB during the instance replacement."
}
##################
## instance_types_filters ##
variable "instance_types_filters_max_gpu" {
default = null
type = number
description = "Maximum total number of GPUs."
}
variable "instance_types_filters_min_gpu" {
default = null
type = number
description = "Minimum total number of GPUs."
}
variable "instance_types_filters_max_memory_gib" {
default = null
type = number
description = "Maximum amount of Memory (GiB)."
}
variable "instance_types_filters_max_network_performance" {
default = null
type = number
description = "Maximum Bandwidth in Gib/s of network performance."
}
variable "instance_types_filters_max_vcpu" {
default = null
type = number
description = "Maximum number of vcpus available."
}
variable "instance_types_filters_min_enis" {
default = null
type = number
description = "Minimum number of network interfaces (ENIs)."
}
variable "instance_types_filters_min_memory_gib" {
default = null
type = number
description = "Minimum amount of Memory (GiB)."
}
variable "instance_types_filters_min_network_performance" {
default = null
type = number
description = "Minimum Bandwidth in Gib/s of network performance."
}
variable "instance_types_filters_min_vcpu" {
default = null
type = number
description = "Minimum number of vcpus available."
}
variable "instance_types_filters_exclude_metal" {
type = bool
default = null
description = "In case excludeMetal is set to true, metal types will not be available for scaling."
}
variable "instance_types_filters_is_ena_supported" {
type = bool
default = null
description = "Ena is supported or not."
}
variable "instance_types_filters_categories" {
type = list(string)
default = null
description = "The filtered instance types will belong to one of the categories types from this list. Valid values 'Accelerated_computing', 'Compute_optimized', 'General_purpose', 'Memory_optimized', 'Storage_optimized'"
}
variable "instance_types_filters_disk_types" {
type = list(string)
default = null
description = "The filtered instance types will have one of the disk type from this list. Valid values 'NVMe', 'EBS', 'SSD', 'HDD'"
}
variable "instance_types_filters_exclude_families" {
type = list(string)
default = null
description = "Types belonging to a family from the ExcludeFamilies will not be available for scaling (asterisk wildcard is also supported). For example, C* will exclude instance types from these families: c5, c4, c4a, etc."
}
variable "instance_types_filters_hypervisor" {
type = list(string)
default = null
description = "The filtered instance types will have a hypervisor type from this list. Valid values 'nitro', 'xen'"
}
variable "instance_types_filters_include_families" {
type = list(string)
default = null
description = "Types belonging to a family from the IncludeFamilies will be available for scaling (asterisk wildcard is also supported). For example, C* will include instance types from these families: c5, c4, c4a, etc."
}
variable "instance_types_filters_root_device_types" {
type = list(string)
default = null
description = "Minimum number of vcpus available. Valid values 'ebs', 'instance-store'"
}
variable "instance_types_filters_virtualization_types" {
type = list(string)
default = null
description = "The filtered instance types will support at least one of the virtualization types from this list. Valid values 'hvm', 'paravirtual'"
}
variable "instance_types_filters_enable" {
type = bool
default = null
description = "'instance_types_filters_enable' to be set to true to have instance_types_filters configured in the virtual node group."
}
variable "images" {
type = list(object({
image_id = string
}))
default = null
description = "Array of objects (Image object, containing the id of the image used to launch instances.)"
}
####################
## ephemeral_storage ##
variable "ephemeral_storage_device_name" {
type = string
default = null
description = "Specify an alternative device name from which ephemeral storage calculations should be derived. This parameter is used when the ephemeral storage should not utilize the root device. Provide the device name configured in the VNG's BDM or AMI's BDM that differs from the default root device."
}
##################
variable "reserved_enis" {
type = number
default = 0
description = "Specifies the count of ENIs to reserve per instance type for scaling purposes."
}