generated from notablehealth/terraform-google-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
276 lines (262 loc) · 11.3 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
#variable "validated" {
# description = "String variable with validation"
# type = string
# validation {
# condition = contains(
# ["one", "two", "three", "four"],
# var.validated
# )
# error_message = "Must be one of: one, two, three, four."
# }
#}
#variable "default_autoscaling type = bool default = true
#variable "default_autoscaling_location_policy type = string default = null
#variable "default_autoscaling_max_node_count type = number default = 100
#variable "default_autoscaling_min_node_count type = number default = 1
#variable "default_autoscaling_total_max_node_count type = number default = null
#variable "default_autoscaling_total_min_node_count type = number default = null
#variable "default_disk_size_gb type = number default = 100
#variable "default_disk_type type = string default = "pd-standard"
#variable "default_enable_confidential_nodes type = bool default = false
#variable "default_enable_fast_socket type = bool default = false
#variable "default_enable_gcfc type = bool default = false
#variable "default_enable_gvnic type = bool default = false
#variable "default_enable_integrity_monitoring type = bool default = true
#variable "default_enable_secure_boot type = bool default = false
#variable "default_gpu_driver_version type =
#variable "default_gpu_max_shared_clients_per_gpu type =
#variable "default_gpu_partition_size type = number default = null
#variable "default_gpu_sharing_strategy type =
#variable "default_guest_accelerator_count type = number default = 0
#variable "default_guest_accelerator_type type = string default = ""
#variable "default_image_type type = string default = "COS_CONTAINERD"
#variable "default_initial_node_count type = number default = 1
#variable "default_local_ssd_count type = number default = 0 # also 3 other variants
#variable "default_logging_variant type = string default = "DEFAULT"
#variable "default_machine_type type = string default = "e2-medium"
#variable "default_max_pods_per_node type =
#variable "default_min_cpu_platform type = string default = ""
#variable "default_placement_policy_name type =
#variable "default_placement_policy_tpu_topology type =
#variable "default_placement_policy_type type = string default = "COMPACT"
#variable "default_preemptible type = bool default = false
#variable "default_spot type = bool default = false
#variable "default_upgrade_bg_node_pool_soak_duration type = string
#variable "default_upgrade_bg_standard_rollout_policy_batch_node_count type = number
#variable "default_upgrade_bg_standard_rollout_policy_batch_percentage type = number
#variable "default_upgrade_bg_standard_rollout_policy_batch_soak_duration type = string
#variable "default_upgrade_max_surge type = number default = 1
#variable "default_upgrade_max_unavailable type = number default = 0
#variable "default_upgrade_strategy type = string default = "SURGE"
variable "cluster_name" {
description = "Name of the existing GKE cluster to add node pools too"
type = string
}
variable "cluster_location" {
description = "Location of the existing GKE cluster"
type = string
}
#variable "create_service_account" {
# description = "Defines if service account specified to run nodes should be created."
# type = bool
# default = true
#}
variable "default_auto_repair" {
description = "Default value for auto_repair in node pools"
type = bool
default = true
}
variable "default_auto_upgrade" {
description = "Default value for auto_upgrade in node pools"
type = bool
default = true
}
variable "disable_legacy_metadata_endpoints" {
type = bool
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."
default = true
}
#variable "kubernetes_version" {
# description = "The Kubernetes version for the nodes in this pool. Defaults to the cluster's version."
# type = string
# default = "latest"
#}
#variable "service_account" {
# description = "The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created. This service account should already exists and it will be used by the node pools. If you wish to only override the service account name, you can use service_account_name variable."
# type = string
# default = ""
#}
#variable "service_account_name" {
# description = "The name of the service account that will be created if create_service_account is true. If you wish to use an existing service account, use service_account variable."
# type = string
# default = ""
#}
variable "node_metadata" {
description = "Specifies how node metadata is exposed to the workload running on the node"
default = "GKE_METADATA"
type = string
validation {
condition = contains(["GKE_METADATA", "GCE_METADATA", "UNSPECIFIED", "GKE_METADATA_SERVER", "EXPOSE"], var.node_metadata)
error_message = "The node_metadata value must be one of GKE_METADATA, GCE_METADATA, UNSPECIFIED, GKE_METADATA_SERVER or EXPOSE."
}
}
variable "node_pools" {
description = "Map of node pool objects"
# key = node pool name
type = map(object({ # list(map(any))
#auto_upgrade = optional(bool)
autoscaling = optional(bool, true)
autoscaling_min_node_count = optional(number)
autoscaling_max_node_count = optional(number)
autoscaling_location_policy = optional(string)
autoscaling_total_min_node_count = optional(number)
autoscaling_total_max_node_count = optional(number)
initial_node_count = optional(number)
max_pods_per_node = optional(number)
#min_count = optional(number)
node_locations = optional(string, "")
version = optional(string)
management = optional(object({
auto_repair = optional(bool, true)
auto_upgrade = optional(bool, true)
}))
node_config = optional(object({
boot_disk_kms_key = optional(string)
disk_size_gb = optional(number)
disk_type = optional(string)
enable_gcfs = optional(bool, false)
enable_gvnic = optional(bool, false)
image_type = optional(string)
labels = optional(map(string))
local_ssd_count = optional(number)
logging_variant = optional(string)
machine_type = optional(string)
metadata = optional(map(string))
min_cpu_platform = optional(string)
oauth_scopes = optional(list(string))
preemptible = optional(bool)
resource_labels = optional(map(string))
service_account = optional(string)
spot = optional(bool)
tags = optional(list(string))
workload_metadata = optional(string)
guest_accelerator = optional(object({
type = optional(string)
count = optional(number)
gpu_partition_size = optional(number)
}))
linux_node_config = optional(object({
sysctls = optional(map(string))
}))
shielded_instance_config = optional(object({
enable_secure_boot = optional(bool)
enable_integrity_monitoring = optional(bool)
}))
taints = optional(list(object({
key = string
value = string
effect = string
})), [])
}))
#upgrade_strategy = optional(string)
#upgrade_max_surge = optional(number)
#upgrade_max_unavailable = optional(number)
#upgrade_bg_node_pool_soak_duration = optional(string)
#upgrade_bg_standard_rollout_policy_batch_soak_duration = optional(string)
#upgrade_bg_standard_rollout_policy_batch_percentage = optional(number)
#upgrade_bg_standard_rollout_policy_batch_node_count = optional(number)
upgrade_settings = optional(object({
strategy = optional(string)
max_surge = optional(number)
max_unavailable = optional(number)
blue_green_settings = optional(object({
node_pool_soak_duration = optional(string)
standard_rollout_policy = optional(object({
batch_soak_duration = optional(string)
batch_percentage = optional(number)
batch_node_count = optional(number)
}))
}))
}))
}))
#default = {}
}
variable "node_pools_labels" {
description = "Map of maps containing node labels by node-pool name"
type = map(map(any))
# Default is being set in variables_defaults.tf
default = {
all = {
terraform = true
}
}
}
variable "node_pools_resource_labels" {
description = "Map of maps containing resource labels by node-pool name"
type = map(map(string))
default = {
all = {}
}
}
variable "node_pools_metadata" {
description = "Map of maps containing node metadata by node-pool name"
type = map(map(string))
# Default is being set in variables_defaults.tf
default = {
all = {}
}
}
variable "node_pools_linux_node_configs_sysctls" {
description = "Map of maps containing linux node config sysctls by node-pool name"
type = map(map(string))
# Default is being set in variables_defaults.tf
default = {
all = {}
}
}
variable "node_pools_taints" {
description = "Map of lists containing node taints by node-pool name"
type = map(list(object({ key = string, value = string, effect = string })))
# Default is being set in variables_defaults.tf
default = {
all = []
}
}
variable "node_pools_tags" {
description = "Map of lists containing node network tags by node-pool name"
type = map(list(string))
# Default is being set in variables_defaults.tf
default = {
all = []
}
}
variable "node_pools_oauth_scopes" {
description = "Map of lists containing node oauth scopes by node-pool name"
type = map(list(string))
# Default is being set in variables_defaults.tf
default = {
all = ["https://www.googleapis.com/auth/cloud-platform"]
}
}
variable "project_id" {
description = "The ID of the project in which the resource belongs."
type = string
}
variable "release_channel" {
description = "The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`."
type = string
default = "REGULAR"
validation {
condition = contains(["UNSPECIFIED", "RAPID", "REGULAR", "STABLE"], var.release_channel)
error_message = "The release_channel value must be one of UNSPECIFIED, RAPID, REGULAR or STABLE."
}
}
variable "timeouts" {
description = "Timeout for cluster operations."
type = map(string)
default = {}
validation {
condition = !contains([for t in keys(var.timeouts) : contains(["create", "update", "delete"], t)], false)
error_message = "Only create, update, delete timeouts can be specified."
}
}