This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvariables.tf
executable file
·144 lines (122 loc) · 4.33 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
variable "controlplane_nodes" {
description = "The list of Talos control plane nodes (either 1 or 3 nodes); the first node is used for initializing the cluster"
type = list(string)
default = []
validation {
condition = length(var.controlplane_nodes) == 1 || length(var.controlplane_nodes) == 3
error_message = "Number of control plane nodes must be either one, or three (HA cluster)."
}
}
variable "controlplane_specs" {
description = "The VirtualBox VM specs used for building Talos cluster's control plane nodes (default is 2 CPU, 2GB RAM, and 8GB disk)"
type = object({
cpus = number
ram_size = number
disk_size = number
})
default = {
cpus = 2
ram_size = 2048
disk_size = 8000
}
}
variable "worker_nodes" {
description = "The list of Talos worker nodes (minimum is 0 nodes); the maximum depends on availability of host resources"
type = list(string)
default = []
validation {
condition = length(var.worker_nodes) >= 0
error_message = "Number of worker nodes must be zero or more."
}
}
variable "worker_specs" {
description = "The VirtualBox VM specs used for building Talos cluster's worker nodes (default is 2 CPU, 2GB RAM, and 8GB disk)"
type = object({
cpus = number
ram_size = number
disk_size = number
})
default = {
cpus = 2
ram_size = 2048
disk_size = 8000
}
}
variable "talos_version" {
description = "The version of Talos OS, used for building the cluster; the version string should start with 'v'"
type = string
default = ""
validation {
condition = var.talos_version != "" && substr(var.talos_version, 0, 1) == "v"
error_message = "The specified Talos version is invalid."
}
}
variable "talos_cli_update" {
description = "Whether Talos CLI (talosctl) should be installed/updated or not, for the specified Talos version (default is true)"
type = bool
default = true
}
variable "kube_version" {
description = "The version of Kubernetes (e.g. 1.20); default is the latest version supported by the selected Talos version"
type = string
default = ""
}
variable "kube_cluster_name" {
description = "The Kubernetes cluster name (default is talos)"
type = string
default = "talos"
validation {
condition = var.kube_cluster_name != ""
error_message = "The Kubernetes cluster name must be identified."
}
}
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."
}
}
variable "controlplane_scheduling" {
description = "Whether the scheduling taint of the Talos cluster control plane nodes should be removed (default is false)"
type = bool
default = false
}
variable "apply_config_wait" {
description = "Whether Talos CLI's apply-config should be applied sequentially, by a number of seconds; can ease pressure on host resources (default is 0s)"
type = number
default = 0
validation {
condition = var.apply_config_wait >= 0
error_message = "The specified apply config wait time is invalid."
}
}
variable "os_installation_wait" {
description = "How long Terraform should wait for OS installation; it's host resources, network bandwidth, and image caching dependent (default is 4m)"
type = string
default = "4m"
validation {
condition = var.os_installation_wait != ""
error_message = "The specified OS installation wait time is invalid."
}
}
variable "conf_dir" {
description = "The directory used for storing Talos ISO and cluster build configuration files (default is /tmp)"
type = string
default = "/tmp"
validation {
condition = var.conf_dir != ""
error_message = "The Talos configuration directory must be identified."
}
}
variable "shell" {
description = "The qualified name of preferred shell (e.g. /bin/bash, /bin/zsh, /bin/sh...), to minimize risk of incompatibility (default is /bin/bash)"
type = string
default = "/bin/bash"
validation {
condition = var.shell != ""
error_message = "The shell, for exection of scripts, must be identified."
}
}