-
Notifications
You must be signed in to change notification settings - Fork 46
/
variables.tf
246 lines (214 loc) · 7.22 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
# Environment
########################################################################
variable "env_name" {
type = string
description = "The stage of the development lifecycle for the k8s cluster. Example: `prod`, `dev`, `qa`, `stage`, `test`"
default = "test"
}
variable "location" {
type = string
description = "The city or region where the cluster is provisioned"
default = null
}
variable "cluster_number" {
type = string
description = "The instance count for the k8s cluster, to differentiate it from other clusters. Example: `00`, `01`"
default = "01"
}
variable "cluster_domain" {
type = string
description = "The cluster domain name"
default = "local"
}
locals {
cluster_name = var.location != null ? "k8s-${var.env_name}-${var.location}-${var.cluster_number}" : "k8s-${var.env_name}-${var.cluster_number}"
cluster_fqdn = "${local.cluster_name}.${var.cluster_domain}"
}
variable "use_legacy_naming_convention" {
type = bool
description = "Whether to use legacy naming convention for the VM and cluster name. If your cluster was provisioned using version <= 3.x, set it to `true`"
default = false
}
# Proxmox VE
########################################################################
variable "pm_api_url" {
type = string
description = "The base URL for Proxmox VE API. See https://pve.proxmox.com/wiki/Proxmox_VE_API#API_URL"
}
variable "pm_api_token_id" {
type = string
description = "The token ID to access Proxmox VE API."
}
variable "pm_api_token_secret" {
type = string
description = "The UUID/secret of the token defined in the variable `pm_api_token_id`."
sensitive = true
}
variable "pm_tls_insecure" {
type = bool
description = "Disable TLS verification while connecting to the Proxmox VE API server."
}
variable "pm_host" {
type = string
description = "The name of Proxmox node where the VM is placed."
}
variable "pm_parallel" {
type = number
description = "The number of simultaneous Proxmox processes. E.g: creating resources."
default = 2
}
variable "pm_timeout" {
type = number
description = "Timeout value (seconds) for proxmox API calls."
default = 600
}
# Common infrastructure
########################################################################
variable "internal_net_name" {
type = string
description = "Name of the internal network bridge"
default = "vmbr1"
}
variable "internal_net_subnet_cidr" {
type = string
description = "CIDR of the internal network"
default = "10.0.1.0/24"
}
variable "ssh_private_key" {
type = string
description = "SSH private key in base64, will be used by Terraform client to connect to the Kubespray VM after provisioning. We can set its sensitivity to false; otherwise, the output of the Kubespray script will be hidden."
sensitive = false
}
variable "ssh_public_keys" {
type = string
description = "SSH public keys in base64"
sensitive = false
}
variable "vm_user" {
type = string
description = "The default user for all VMs"
default = "ubuntu"
}
variable "vm_sockets" {
type = number
description = "Number of the CPU socket to allocate to the VMs"
default = 1
}
variable "vm_max_vcpus" {
type = number
description = "The maximum CPU cores available per CPU socket to allocate to the VM"
default = 2
}
variable "vm_cpu_type" {
type = string
description = "The type of CPU to emulate in the Guest"
default = "host"
}
variable "vm_os_disk_storage" {
type = string
description = "Default storage pool where OS VM disk is placed"
}
variable "add_worker_node_data_disk" {
type = bool
description = "Whether to add a data disk to each worker node of the cluster"
default = false
}
variable "worker_node_data_disk_storage" {
type = string
description = "The storage pool where the data disk is placed"
default = ""
}
variable "worker_node_data_disk_size" {
type = string
description = "The size of worker node data disk in Gigabyte"
default = 10
}
variable "vm_ubuntu_tmpl_name" {
type = string
description = "Name of Cloud-init template Ubuntu VM"
default = "ubuntu-2404"
}
variable "bastion_ssh_ip" {
type = string
description = "IP of the bastion host, could be either public IP or local network IP of the bastion host"
default = ""
}
variable "bastion_ssh_user" {
type = string
description = "The user to authenticate to the bastion host"
default = "ubuntu"
}
variable "bastion_ssh_port" {
type = number
description = "The SSH port number on the bastion host"
default = 22
}
# Kuberentes VM specifications for Kubernetes nodes
########################################################################
variable "vm_k8s_control_plane" {
type = object({ node_count = number, vcpus = number, memory = number, disk_size = number })
description = "Control Plane VM specification"
default = { node_count = 1, vcpus = 2, memory = 1536, disk_size = 20 }
}
variable "vm_k8s_worker" {
type = object({ node_count = number, vcpus = number, memory = number, disk_size = number })
description = "Worker VM specification"
default = { node_count = 2, vcpus = 2, memory = 2048, disk_size = 20 }
}
# Kubernetes settings
########################################################################
variable "create_kubespray_host" {
type = bool
description = "Whether to provision the Kubespray as a VM"
default = true
}
variable "kubespray_image" {
type = string
description = "The Docker image to deploy Kubespray"
default = "quay.io/kubespray/kubespray:v2.25.0"
}
variable "kube_version" {
type = string
description = "Kubernetes version"
default = "v1.29.5"
}
variable "kube_network_plugin" {
type = string
description = "The network plugin to be installed on your cluster. Example: `cilium`, `calico`, `kube-ovn`, `weave` or `flannel`"
default = "calico"
}
variable "enable_nodelocaldns" {
type = bool
description = "Whether to enable nodelocal dns cache on your cluster"
default = false
}
variable "podsecuritypolicy_enabled" {
type = bool
description = "Whether to enable pod security policy on your cluster (RBAC must be enabled either by having 'RBAC' in authorization_modes or kubeadm enabled)"
default = false
}
variable "persistent_volumes_enabled" {
type = bool
description = "Whether to add Persistent Volumes Storage Class for corresponding cloud provider (supported: in-tree OpenStack, Cinder CSI, AWS EBS CSI, Azure Disk CSI, GCP Persistent Disk CSI)"
default = false
}
variable "helm_enabled" {
type = bool
description = "Whether to enable Helm on your cluster"
default = false
}
variable "ingress_nginx_enabled" {
type = bool
description = "Whether to enable Nginx ingress on your cluster"
default = false
}
variable "argocd_enabled" {
type = bool
description = "Whether to enable ArgoCD on your cluster"
default = false
}
variable "argocd_version" {
type = string
description = "The ArgoCD version to be installed"
default = "v2.11.4"
}