-
Notifications
You must be signed in to change notification settings - Fork 6
/
variables.tf
439 lines (400 loc) · 11.4 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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
variable "vsphere_datacenter" {
description = "In which datacenter the VM will be deployed"
type = string
default = ""
validation {
condition = var.vsphere_datacenter != ""
error_message = "You must specify the destination datacenter for the talos virtual machines."
}
}
variable "vsphere_resource_pool" {
description = "VM Resource Pool"
type = string
default = ""
validation {
condition = var.vsphere_resource_pool != ""
error_message = "You must specify the destination resource pool."
}
}
variable "vsphere_host" {
description = "The host to deploy to"
type = string
default = ""
validation {
condition = var.vsphere_host != ""
error_message = "You must specify the destination esxi host. Hopefully this requirement will be removed in a future release."
}
}
variable "vsphere_cluster" {
description = "In which cluster the VM will be deployed"
type = string
default = ""
validation {
condition = var.vsphere_cluster != ""
error_message = "You must specify the destination cluster."
}
}
variable "vsphere_datastore" {
description = "What is the name of the destination VM datastore"
type = string
default = ""
validation {
condition = var.vsphere_datastore != ""
error_message = "You must specify the destination datastore."
}
}
variable "vsphere_network" {
description = "What is the name of the VM Network?"
type = string
default = ""
validation {
condition = var.vsphere_network != ""
error_message = "You must specify the destination network."
}
}
# Talos settings
variable "talos_version" {
description = "The version of Talos OS, used for building the cluster; the version string should start with 'v'"
type = string
default = "v0.9.1"
validation {
condition = var.talos_version != "" && substr(var.talos_version, 0, 1) == "v"
error_message = "The specified Talos version is invalid."
}
}
variable "talos_cluster_endpoint" {
description = "The DNS or load balancer IP endpoint name IE talos.yourdomain.local"
type = string
default = ""
validation {
condition = var.talos_cluster_endpoint != ""
error_message = "You must provide an endpoint DNS name or IP."
}
}
variable "talos_cluster_endpoint_port" {
description = "The port for the cluster endpoint. Usually 6443 or 443 (behind loadbalancer)."
type = string
default = "6443"
validation {
condition = var.talos_cluster_endpoint_port != ""
error_message = "You must specify the endpoint port for the Talos cluster endpoint."
}
}
variable "talos_cluster_name" {
description = "The talosconfig cluster name used for context"
type = string
default = "talos"
validation {
condition = var.talos_cluster_name != ""
error_message = "The talos_cluster_name cannot be blank."
}
}
# Kubernetes settings
variable "kube_cluster_name" {
description = "The Kubernetes cluster name (default is cluster.local)"
type = string
default = "cluster.local"
validation {
condition = var.kube_cluster_name != ""
error_message = "The Kubernetes cluster name must be identified."
}
}
# TODO: Get rid of one of these
variable "kube_dns_domain" {
description = "The Kubernetes cluster DNS domain (default is cluster.local)"
type = string
default = "cluster.local"
validation {
condition = var.kube_dns_domain != ""
error_message = "The Kubernetes cluster DNS domain must be identified."
}
}
# Node config
variable "ova_disk_name" {
description = "The name of the OVA disk"
type = string
default = "disk-1000-0.vmdk"
validation {
condition = var.ova_disk_name != ""
error_message = "You must provide a disk name for the ova disk."
}
}
variable "controlplane_nodes" {
description = "Number of control plane nodes"
type = number
default = 1
validation {
condition = var.controlplane_nodes != 1 || var.controlplane_nodes != 3
error_message = "Number of control plane nodes must be either one, or three (HA cluster)."
}
}
variable "controlplane_name_prefix" {
description = "Name prefix for control plane servers (IE talos-cp)"
type = string
default = "talos-cp"
}
variable "controlplane_cpu" {
description = "Number of CPU for Controlplane systems"
type = number
default = 2
}
variable "controlplane_memory" {
description = "Memory in MB for Controlplane systems"
type = number
default = 2048
}
variable "controlplane_disk_name" {
description = "The name of the OVA disk"
type = string
default = "disk-1000-0.vmdk"
}
variable "controlplane_disk_size" {
description = "Size in GB of the control plane disk"
type = number
default = 8
}
# Worker systems
variable "worker_nodes" {
description = "Number of control plane servers"
type = number
default = 1
}
variable "worker_name_prefix" {
description = "Name prefix for control plane servers (IE talos-worker)"
type = string
default = "talos-worker"
}
variable "worker_cpu" {
description = "Number of CPU for worker nodes"
type = number
default = 2
}
variable "worker_memory" {
description = "Memory in MB for worker nodes"
type = number
default = 2048
}
variable "worker_disk_name" {
description = "The name of the OVA disk"
type = string
default = "disk-1000-0.vmdk"
}
variable "worker_disk_size" {
description = "Size in GB of the worker disk"
type = number
default = 8
}
variable "node_extra_disk" {
description = "Extra disk information"
type = list(object({
size = number
mountpoint = string
}))
default = []
}
variable "add_extra_node_disk" {
description = "Whether or not to add an additional disk."
type = bool
default = false
}
# Networking
variable "vsphere_nic_type" {
description = "NIC type (vmxnet3 or e1000)"
type = string
default = "e1000"
validation {
condition = var.vsphere_nic_type != "vmxnet3" || var.vsphere_nic_type != "e1000"
error_message = "Number of control plane nodes must be either one, or three (HA cluster)."
}
}
variable "ip_gateway" {
description = "The network gateway address IE: 192.168.1.1"
type = string
validation {
condition = var.ip_gateway != ""
error_message = "Must define network gateway."
}
}
variable "nameservers" {
description = "The nameservers for the node NICs"
type = list(string)
default = ["1.1.1.1"]
}
variable "dns_domain" {
description = "The DNS domain for the hostonly network; usually the domain host is part of"
type = string
default = ""
validation {
condition = var.dns_domain != ""
error_message = "The specified DNS domain is invalid, or is empty."
}
}
#TODO: find a better way to manage the network
variable "ip_address_base" {
description = "The base network/subnet IE: 192.168.1"
type = string
validation {
condition = var.ip_address_base != ""
error_message = "Must provide base network."
}
}
variable "ip_netmask" {
description = "The network mask in /cidr notation form IE: /24"
type = string
default = "/24"
validation {
condition = var.ip_netmask != ""
error_message = "You must provide an ip_netmask."
}
}
variable "controlplane_ip_address_start" {
description = "Don't overlap with worker_ip_address_start! The first control plane address IE: 100"
type = string
default = ""
validation {
condition = var.controlplane_ip_address_start != ""
error_message = "You must provide a starting IP address for the controlplane nodes."
}
}
variable "worker_ip_address_start" {
description = "Don't overlap with controlplane_ip_address_start! The first worker address IE: 150"
type = string
default = ""
validation {
condition = var.worker_ip_address_start != ""
error_message = "You must provide a starting IP address for the worker nodes."
}
}
variable "customize_network" {
description = "Whether or not to customize the node networks. Uses DHCP if set to false."
type = bool
default = true
}
variable "talos_config_path" {
description = <<EOT
The full or relative path to the talos config file
Full path: /home/user/talosconfig
Relative path: ./config/talosconfig or ./talosconfig
EOT
type = string
default = "./"
validation {
condition = var.talos_config_path != ""
error_message = "Talos config file path must be provided."
}
}
variable "talos_crt" {
description = "talos ca cert"
type = string
default = ""
validation {
condition = var.talos_crt != ""
error_message = "Talos crt must be provided."
}
}
variable "talos_key" {
description = "talos ca key"
type = string
default = ""
validation {
condition = var.talos_key != ""
error_message = "Talos key must be provided."
}
}
variable "talos_token" {
description = "Token used to join a system to the cluster"
type = string
default = ""
validation {
condition = var.talos_token != ""
error_message = "Talos token must be provided."
}
}
variable "kube_enc_key" {
description = "The key used for the encryption of secret data at rest"
type = string
default = ""
validation {
condition = var.kube_enc_key != ""
error_message = "Thekube_enc_key must be provided."
}
}
variable "kube_token" {
description = "The [bootstrap token](https://kubernetes.io/docs/reference/access-authn-authz/bootstrap-tokens/) used to join the cluster."
type = string
default = ""
validation {
condition = var.kube_token != ""
error_message = "Kube token must be provided."
}
}
variable "kube_crt" {
description = "The base64 encoded root certificate authority cert used by Kubernetes."
type = string
default = ""
validation {
condition = var.kube_crt != ""
error_message = "Kube crt must be provided."
}
}
variable "kube_key" {
description = "The base64 encoded root certificate authority key used by Kubernetes."
type = string
default = ""
validation {
condition = var.kube_key != ""
error_message = "Kube key must be provided."
}
}
variable "etcd_crt" {
description = "The `ca` is the root certificate authority of the PKI."
type = string
default = ""
validation {
condition = var.etcd_crt != ""
error_message = "ETCD crt must be provided."
}
}
variable "etcd_key" {
description = "The `ca` is the root certificate authority of the PKI."
type = string
default = ""
validation {
condition = var.etcd_key != ""
error_message = "ETCD key must be provided."
}
}
variable "admin_crt" {
description = "the admin crt for conecting to k8"
type = string
default = ""
validation {
condition = var.admin_crt != ""
error_message = "Talos crt must be provided."
}
}
variable "admin_key" {
description = "the admin key for connecting to k8"
type = string
default = ""
validation {
condition = var.admin_key != ""
error_message = "Admin key must be provided."
}
}
variable "allow_master_scheduling" {
description = "Allows running workload on master nodes."
type = string
default = "false"
}
# Kube Cluster settings
variable "custom_cni" {
description = "Customize CNI settings?"
type = bool
default = false
}
variable "cni_urls" {
description = "URLs for kube CNI settings"
type = list(string)
default = []
}