-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path00-variables.tf
195 lines (167 loc) · 6.77 KB
/
00-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
variable "cluster_name" {
description = "Name of cluster"
type = string
}
variable "cluster_id" {
default = "1"
description = "The ID of the cluster."
type = number
}
variable "iam_instance_profile_control_plane" {
description = "IAM instance profile to attach to the control plane instances to give AWS CCM the sufficient rights to execute."
type = string
default = null
}
variable "iam_instance_profile_worker" {
description = "IAM instance profile to attach to the worker instances to give AWS CCM the sufficient rights to execute."
type = string
default = null
}
variable "metadata_options" {
description = "Metadata to attach to the instances."
type = map(string)
default = {
http_endpoint = "enabled"
http_tokens = "optional"
http_put_response_hop_limit = 1
}
}
variable "cluster_architecture" {
default = "amd64"
description = "Cluster architecture. Choose 'arm64' or 'amd64'. If you choose 'arm64', ensure to also override the control_plane.instance_type and worker_groups.instance_type with an ARM64-based instance type like 'm7g.large'."
type = string
validation {
condition = can(regex("^a(rm|md)64$", var.cluster_architecture))
error_message = "The cluster_architecture value must be a valid architecture. Allowed values are 'arm64' and 'amd64'."
}
}
variable "region" {
description = "The region in which to create the Talos Linux cluster."
type = string
}
variable "tags" {
description = "The set of tags to place on the cluster."
type = map(string)
}
variable "allocate_node_cidrs" {
default = true
description = "Whether to assign PodCIDRs to Node resources or not. Only needed in case Cilium runs in 'kubernetes' IPAM mode."
type = bool
}
variable "pod_cidr" {
default = "100.64.0.0/14"
description = "The CIDR to use for Pods. Only required in case allocate_node_cidrs is set to 'true'. Otherwise, simply configure it inside Cilium's Helm values."
type = string
}
variable "service_cidr" {
default = "100.68.0.0/16"
description = "The CIDR to use for services."
type = string
}
variable "disable_kube_proxy" {
default = true
description = "Whether to deploy Kube-Proxy or not. By default, KP shouldn't be deployed."
type = bool
}
variable "allow_workload_on_cp_nodes" {
default = false
description = "Allow workloads on CP nodes or not. Allowing it means Talos Linux default taints are removed from CP nodes which is typically required for single-node clusters. More details here: https://www.talos.dev/v1.5/talos-guides/howto/workers-on-controlplane/"
type = bool
}
variable "talos_version" {
default = "v1.9.1"
description = "Talos version to use for the cluster, if not set, the newest Talos version. Check https://github.com/siderolabs/talos/releases for available releases."
type = string
validation {
condition = can(regex("^v\\d+\\.\\d+\\.\\d+$", var.talos_version))
error_message = "The talos_version value must be a valid Talos patch version, starting with 'v'."
}
}
variable "kubernetes_version" {
default = ""
description = "Kubernetes version to use for the Talos cluster, if not set, the K8s version shipped with the selected Talos version will be used. Check https://www.talos.dev/latest/introduction/support-matrix/. For example '1.29.3'."
type = string
validation {
condition = can(regex("^\\d+\\.\\d+\\.\\d+$", var.kubernetes_version))
error_message = "The kubernetes_version value must be a valid Kubernetes patch version."
}
}
variable "controlplane_count" {
default = 3
description = "Defines how many controlplane nodes are deployed in the cluster."
type = number
}
variable "workers_count" {
default = 2
description = "Defines how many worker nodes are deployed in the cluster."
type = number
}
variable "control_plane" {
default = {}
description = "Info for control plane that will be created"
type = object({
instance_type = optional(string, "m5.large")
config_patch_files = optional(list(string), [])
tags = optional(map(string), {})
})
}
variable "worker_groups" {
default = [{
name = "default"
}]
description = "List of node worker node groups to create"
type = list(object({
name = string
instance_type = optional(string, "m5.large")
config_patch_files = optional(list(string), [])
tags = optional(map(string), {})
}))
}
variable "vpc_id" {
description = "ID of the VPC where to place the VMs."
type = string
}
variable "vpc_cidr" {
default = "10.0.0.0/16"
description = "The IPv4 CIDR block for the VPC."
type = string
}
variable "talos_api_allowed_cidr" {
default = "0.0.0.0/0"
description = "The CIDR from which to allow to access the Talos API"
type = string
}
variable "kubernetes_api_allowed_cidr" {
default = "0.0.0.0/0"
description = "The CIDR from which to allow to access the Kubernetes API"
type = string
}
variable "config_patch_files" {
default = []
description = "Path to talos config path files that applies to all nodes"
type = list(string)
}
variable "admission_plugins" {
description = "List of admission plugins to enable"
type = string
default = "MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ServiceAccount"
}
variable "enable_external_cloud_provider" {
default = false
description = "Whether to enable or disable externalCloudProvider support. See https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/."
type = bool
}
variable "deploy_external_cloud_provider_iam_policies" {
default = false
description = "Whether to auto-deploy the externalCloudProvider-required IAM policies. See https://cloud-provider-aws.sigs.k8s.io/prerequisites/."
type = bool
validation {
condition = (var.deploy_external_cloud_provider_iam_policies && var.enable_external_cloud_provider) || (!var.deploy_external_cloud_provider_iam_policies)
error_message = "externalCloudProvider support needs to be enabled when trying to deploy the externalCloudProvider-required IAM policies."
}
}
variable "external_cloud_provider_manifest" {
default = "https://raw.githubusercontent.com/isovalent/terraform-aws-talos/main/manifests/aws-cloud-controller.yaml"
description = "externalCloudProvider manifest to be applied if var.enable_external_cloud_provider is enabled. If you want to deploy it manually (e.g., via Helm chart), enable var.enable_external_cloud_provider but set this value to an empty string (\"\"). See https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/."
type = string
}