-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvariables.tf
719 lines (674 loc) · 21 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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
variable "datacenter" {
description = "VMware datacenter name."
type = string
}
variable "datastores" {
description = "VMWare datastore(s) where all data for the virtual machine will be placed in."
type = list(string)
}
variable "hosts" {
description = "ESXi host(s) where the virtual machine will be created."
type = list(string)
}
variable "resource_pool" {
description = "VMWare resource pool where the virtual machine will be created."
type = string
}
variable "folder" {
description = "Folder to create the virtual machines in."
type = string
}
variable "remote_ovf_url" {
description = "URL to the remote Talos OS 1.0.x ovf/ova file."
type = string
}
variable "control_plane_count" {
description = "Number of 'controlplane' virtual machines."
type = number
default = 2
}
variable "worker_count" {
description = "Number of 'worker' virtual machines."
type = number
default = 0
}
variable "control_plane_num_cpus" {
description = "The total number of virtual processor cores to assign to 'controlplane' virtual machines."
type = number
default = 2
}
variable "worker_num_cpus" {
description = "The total number of virtual processor cores to assign to 'worker' virtual machines."
type = number
default = 4
}
variable "control_plane_memory" {
description = "The amount of RAM for 'controlplane' virtual machines, in Mb."
type = number
default = 2048
}
variable "worker_memory" {
description = "The amount of RAM for 'worker' virtual machines, in Mb."
type = number
default = 4096
}
variable "control_plane_disks" {
description = "A specification list for a virtual disk devices on 'controlplane' virtual machines. Use only first disk to Talos installation in 'machine_base_configuration' block."
type = list(object({
label = string
size = number
}))
}
variable "worker_disks" {
description = "A specification list for a virtual disk devices on 'worker' virtual machines. Use only first disk to Talos installation in 'machine_base_configuration' block."
type = list(object({
label = string
size = number
}))
default = []
}
variable "control_plane_network_interfaces" {
description = "A specification list for a virtual NIC on 'controlplane' virtual machines."
type = list(object({
name = string
}))
}
variable "worker_network_interfaces" {
description = "A specification list for a virtual NIC on 'worker' virtual machines."
type = list(object({
name = string
}))
default = []
}
variable "talos_base_configuration" {
description = "Talos OS top-level configuration. See https://www.talos.dev/v1.0/reference/configuration/#config."
type = object({
version = string
persist = bool
})
default = {
version = "v1alpha1"
persist = false
}
}
variable "machine_secrets" {
description = "Secret data that is used to create trust relationships between virtual machines (if not set will be generated automatically). See https://www.talos.dev/v1.0/reference/configuration/#machineconfig."
type = object({
token = optional(string)
ca = object({
crt = optional(string)
key = optional(string)
})
})
default = {
ca = {}
}
}
variable "talos_admin_pki" {
description = "Base64 encoded certificate (signed by machine_secrets.ca.crt) and key (in ED25519) to provide access to virtual machine trought talosctl (required if node type is 'controlplane' init node will be create; if not set will be generate automaticly)."
type = object({
crt = optional(string)
key = optional(string)
})
default = {}
}
variable "machine_base_configuration" {
description = "Basic configuration of all virtual machines. See https://www.talos.dev/v1.0/reference/configuration/#machineconfig."
type = object({
install = object({
disk = string
extraKernelArgs = optional(list(string))
image = string
bootloader = bool
wipe = bool
diskSelector = optional(object({
size = string
model = string
busPath = string
}))
extensions = optional(list(string))
})
kubelet = optional(object({
image = string
extraArgs = optional(map(string))
clusterDNS = optional(list(string))
extraMounts = optional(list(object({
destination = string
type = string
source = string
options = list(string)
})))
extraConfig = optional(map(string))
nodeIP = optional(object({
validSubnets = list(string)
}))
}))
time = optional(object({
disabled = bool
servers = optional(list(string))
bootTimeout = optional(string)
}))
features = optional(object({
rbac = optional(bool)
}))
})
}
variable "control_plane_machine_extra_configuration" {
description = "Extended configuration of 'controlplane' virtual machine. See https://www.talos.dev/v1.0/reference/configuration/#machineconfig."
type = object({
controlPlane = optional(object({
controllerManager = optional(object({
disabled = bool
}))
scheduler = optional(object({
disabled = bool
}))
}))
pods = optional(list(map(any)))
disks = optional(list(object({
device = string
partitions = list(object({
mountpoint = string
size = string
}))
})))
files = optional(list(object({
content = string
permissions = string
path = string
op = string
})))
env = optional(object({
GRPC_GO_LOG_VERBOSITY_LEVEL = optional(string)
GRPC_GO_LOG_SEVERITY_LEVEL = optional(string)
http_proxy = optional(string)
https_proxy = optional(string)
no_proxy = optional(bool)
}))
sysctls = optional(map(string))
sysfs = optional(map(string))
registries = optional(object({
mirrors = optional(map(object({
endpoints = list(string)
})))
config = optional(map(object({
tls = object({
insecureSkipVerify = bool
clientIdentity = optional(object({
crt = string
key = string
}))
ca = optional(string)
})
auth = optional(object({
username = optional(string)
password = optional(string)
auth = optional(string)
identityToken = optional(string)
}))
})))
}))
systemDiskEncryption = optional(map(object({
provider = string
keys = optional(list(object({
static = optional(object({
passphrase = string
}))
nodeID = optional(map(string))
slot = optional(number)
})))
cipher = optional(string)
keySize = optional(number)
blockSize = optional(number)
options = optional(list(string))
})))
udev = optional(object({
rules = list(string)
}))
logging = optional(object({
destinations = list(object({
endpoint = string
format = string
}))
}))
kernel = optional(object({
modules = list(object({
name = string
}))
}))
})
default = {}
}
variable "worker_machine_extra_configuration" {
description = "Extended configuration of 'worker' virtual machines. See https://www.talos.dev/v1.0/reference/configuration/#machineconfig."
type = object({
pods = optional(list(map(any)))
disks = optional(list(object({
device = string
partitions = list(object({
mountpoint = string
size = string
}))
})))
files = optional(list(object({
content = string
permissions = string
path = string
op = string
})))
env = optional(object({
GRPC_GO_LOG_VERBOSITY_LEVEL = optional(string)
GRPC_GO_LOG_SEVERITY_LEVEL = optional(string)
http_proxy = optional(string)
https_proxy = optional(string)
no_proxy = optional(bool)
}))
sysctls = optional(map(string))
sysfs = optional(map(string))
registries = optional(object({
mirrors = optional(map(object({
endpoints = list(string)
})))
config = optional(map(object({
tls = object({
insecureSkipVerify = bool
clientIdentity = optional(object({
crt = string
key = string
}))
ca = optional(string)
})
auth = optional(object({
username = optional(string)
password = optional(string)
auth = optional(string)
identityToken = optional(string)
}))
})))
}))
systemDiskEncryption = optional(map(object({
provider = string
keys = optional(list(object({
static = optional(object({
passphrase = string
}))
nodeID = optional(map(string))
slot = optional(number)
})))
cipher = optional(string)
keySize = optional(number)
blockSize = optional(number)
options = optional(list(string))
})))
udev = optional(object({
rules = list(string)
}))
logging = optional(object({
destinations = list(object({
endpoint = string
format = string
}))
}))
kernel = optional(object({
modules = list(object({
name = string
}))
}))
})
default = {}
}
variable "control_plane_machine_cert_sans" {
description = "A list of alternative names for *count* of 'controlplane' virtual machines. See https://www.talos.dev/v1.0/reference/configuration/#machineconfig."
type = list(list(string))
default = []
}
variable "worker_machine_cert_sans" {
description = "A list of alternative names for *count* of 'worker' virtual machines. See https://www.talos.dev/v1.0/reference/configuration/#machineconfig."
type = list(list(string))
default = []
}
variable "machine_network" {
description = "General network configuration of the virtual machine. 'hostname' and 'interfaces' parameters are described in separate inputs. See https://www.talos.dev/v1.0/reference/configuration/#networkconfig."
type = object({
nameservers = optional(list(string))
extraHostEntries = optional(list(object({
ip = string
aliases = list(string)
})))
kubespan = optional(object({
enabled = bool
}))
})
default = {}
}
variable "control_plane_machine_network_hostnames" {
description = "A list of hostnames for *count* of 'controlplane' virtual machines (if not set will be generated automatically). See https://www.talos.dev/v1.0/reference/configuration/#networkconfig."
type = list(string)
default = []
}
variable "worker_machine_network_hostnames" {
description = "A list of hostnames for *count* of 'worker' virtual machines (if not set will be generated automatically). See https://www.talos.dev/v1.0/reference/configuration/#networkconfig."
type = list(string)
default = []
}
variable "control_plane_machine_network_interfaces" {
description = "A list of network interfaces for *count* of 'controlplane' virtual machines (if not set DHCP will be used). Not less than one element with one static IP address required. See https://www.talos.dev/v1.0/reference/configuration/#device."
type = list(list(object({
interface = string
addresses = optional(list(string))
routes = optional(list(object({
network = string
gateway = optional(string)
source = optional(string)
metric = optional(number)
})))
vlans = optional(list(object({
addresses = list(string)
routes = optional(list(object({
network = string
gateway = optional(string)
source = optional(string)
metric = optional(number)
})))
dhcp = optional(bool)
vlanId = number
mtu = number
vip = optional(object({
ip = string
equinixMetal = optional(object({
apiToken = string
}))
hcloud = optional(object({
apiToken = string
}))
}))
})))
mtu = optional(number)
bond = optional(object({
interfaces = list(string)
mode = string
lacpRate = string
}))
dhcp = optional(bool)
ignore = optional(bool)
dummy = optional(bool)
dhcpOptions = optional(object({
routeMetric = number
ipv4 = optional(bool)
ipv6 = optional(bool)
}))
wireguard = optional(object({
privateKey = string
listenPort = number
firewallMark = number
peers = list(object({
publicKey = string
endpoint = string
persistentKeepaliveInterval = optional(string)
allowedIPs = list(string)
}))
}))
vip = optional(object({
ip = string
equinixMetal = optional(object({
apiToken = string
}))
hcloud = optional(object({
apiToken = string
}))
}))
})))
default = []
}
variable "worker_machine_network_interfaces" {
description = "A list of network interfaces for *count* of 'worker' virtual machines (if not set DHCP will be used). See https://www.talos.dev/v1.0/reference/configuration/#device."
type = list(list(object({
interface = string
addresses = optional(list(string))
routes = optional(list(object({
network = string
gateway = optional(string)
source = optional(string)
metric = optional(number)
})))
vlans = optional(list(object({
addresses = list(string)
routes = optional(list(object({
network = string
gateway = optional(string)
source = optional(string)
metric = optional(number)
})))
dhcp = optional(bool)
vlanId = number
mtu = number
vip = optional(object({
ip = string
equinixMetal = optional(object({
apiToken = string
}))
hcloud = optional(object({
apiToken = string
}))
}))
})))
mtu = optional(number)
bond = optional(object({
interfaces = list(string)
mode = string
lacpRate = string
}))
dhcp = optional(bool)
ignore = optional(bool)
dummy = optional(bool)
dhcpOptions = optional(object({
routeMetric = number
ipv4 = optional(bool)
ipv6 = optional(bool)
}))
wireguard = optional(object({
privateKey = string
listenPort = number
firewallMark = number
peers = list(object({
publicKey = string
endpoint = string
persistentKeepaliveInterval = optional(string)
allowedIPs = list(string)
}))
}))
vip = optional(object({
ip = string
equinixMetal = optional(object({
apiToken = string
}))
hcloud = optional(object({
apiToken = string
}))
}))
})))
default = []
}
variable "cluster_secrets" {
description = "Secret data that is used to establish trust relationships between Kubernetes cluster nodes. See https://www.talos.dev/v1.0/reference/configuration/#clusterconfig."
type = object({
id = optional(string)
secret = optional(string)
token = optional(string)
ca = object({
crt = optional(string)
key = optional(string)
})
})
default = {
ca = {}
}
}
variable "control_plane_cluster_secrets" {
description = "Secret data required to establish trust relationships between components used by 'controlplane' nodes in the Kubernetes cluster. See https://www.talos.dev/v1.0/reference/configuration/#clusterconfig."
type = object({
aescbcEncryptionSecret = optional(string)
aggregatorCA = object({
crt = optional(string)
key = optional(string)
})
serviceAccount = object({
key = optional(string)
})
etcd = object({
ca = object({
crt = optional(string)
key = optional(string)
})
})
})
default = {
aggregatorCA = {}
etcd = {
ca = {}
}
serviceAccount = {}
}
}
variable "cluster_name" {
description = "The name of the cluster. See https://www.talos.dev/v1.0/reference/configuration/#clusterconfig."
type = string
}
variable "cluster_control_plane" {
description = "Data to define the API endpoint address for joining a node to the Kubernetes cluster. Required if 'init' node is outside of this cluster. See https://www.talos.dev/v1.0/reference/configuration/#controlplaneconfig."
type = object({
endpoint = optional(string)
localAPIServerPort = optional(number)
})
default = {}
}
variable "cluster_discovery" {
description = "Data that sets up the discovery of nodes in the Kubernetes cluster. See https://www.talos.dev/v1.0/reference/configuration/#clusterdiscoveryconfig."
type = object({
enabled = bool
registries = optional(object({
kubernetes = optional(object({
disabled = bool
}))
service = optional(object({
disabled = bool
endpoint = string
}))
}))
})
default = {
enabled = true
}
}
variable "control_plane_cluster_configuration" {
description = "Data that configure the components of the 'controlplane' nodes in the Kubernetes cluster. See https://www.talos.dev/v1.0/reference/configuration/#clusterconfig."
type = object({
network = optional(object({
cni = optional(object({
name = string
urls = optional(list(string))
}))
dnsDomain = optional(string)
podSubnets = optional(list(string))
serviceSubnets = optional(list(string))
}))
apiServer = optional(object({
image = string
extraArgs = optional(map(string))
extraVolumes = optional(list(object({
hostPath = string
mountPath = string
readonly = bool
})))
env = optional(map(string))
certSANs = optional(list(string))
disablePodSecurityPolicy = optional(bool)
admissionControl = optional(list(object({
name = string
configuration = map(any)
})))
}))
controllerManager = optional(object({
image = string
extraArgs = optional(map(string))
extraVolumes = optional(list(object({
hostPath = string
mountPath = string
readonly = bool
})))
env = optional(map(string))
}))
proxy = optional(object({
disabled = bool
image = optional(string)
mode = optional(string)
extraArgs = optional(map(string))
}))
scheduler = optional(object({
image = string
extraArgs = optional(map(string))
extraVolumes = optional(list(object({
hostPath = string
mountPath = string
readonly = bool
})))
env = optional(map(string))
}))
etcd = optional(object({
image = optional(string)
extraArgs = optional(map(string))
subnet = optional(string)
}))
coreDNS = optional(object({
disabled = bool
image = optional(string)
}))
externalCloudProvider = optional(object({
enabled = bool
manifests = list(string)
}))
adminKubeconfig = optional(object({
certLifetime = string
}))
allowSchedulingOnMasters = optional(bool)
})
default = {}
}
variable "cluster_inline_manifests" {
description = "A list of Kuberenetes manifests whose content is represented as a string. These will get automatically deployed as part of the bootstrap. See https://www.talos.dev/v1.0/reference/configuration/#clusterconfig."
type = list(object({
name = string
contents = string
}))
default = []
}
variable "cluster_extra_manifests" {
description = "A list of 'URLs' that point to additional manifests. These will get automatically deployed as part of the bootstrap. See https://www.talos.dev/v1.0/reference/configuration/#clusterconfig."
type = list(string)
default = []
}
variable "cluster_extra_manifest_headers" {
description = "A map of key value pairs that will be added while fetching the 'cluster_extra_manifests'. See https://www.talos.dev/v1.0/reference/configuration/#clusterconfig."
type = map(string)
default = {}
}
variable "validity_period_hours" {
description = "The number of hours after initial issuing that ALL generated certificates become invalid."
type = number
default = 8760
}
variable "kubeconfig_path" {
description = "Path to save kubeconfig file (Include filename. If not set config will not be created)."
type = string
default = ""
}
variable "talosconfig_path" {
description = "Path to save talosconfig file (Include filename. If if not set config will not be created)."
type = string
default = ""
}
variable "vmtoolsd_extra_manifest" {
description = "A link to talos-vmtoolsd Kubernetes manifest."
type = string
default = "https://raw.githubusercontent.com/mologie/talos-vmtoolsd/release-0.3/deploy/0.3.yaml"
}