-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
492 lines (414 loc) · 17.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
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
# Copyright 2023 StreamNative, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
variable "add_cluster_firewall_rules" {
default = false
description = "Creates additional firewall rules on the cluster."
type = bool
}
variable "add_master_webhook_firewall_rules" {
default = false
description = "Create master_webhook firewall rules for ports defined in firewall_inbound_ports."
type = bool
}
variable "add_shadow_firewall_rules" {
default = false
description = "Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled)."
type = bool
}
variable "authenticator_security_group" {
default = null
description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com"
type = string
}
variable "cluster_autoscaling_config" {
default = {
enabled = false
max_cpu_cores = null
min_cpu_cores = null
max_memory_gb = null
min_memory_gb = null
gpu_resources = []
auto_repair = true
auto_upgrade = false
autoscaling_profile = "BALANCED"
}
description = "Cluster autoscaling configuration for node auto-provisioning. This is disabled for our configuration, since we typically want to scale existing node pools rather than add new ones to the cluster"
type = object({
enabled = bool
min_cpu_cores = number
max_cpu_cores = number
min_memory_gb = number
max_memory_gb = number
gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))
auto_repair = bool
auto_upgrade = bool
autoscaling_profile = string
})
}
variable "cluster_http_load_balancing" {
default = true
description = "Enable the HTTP load balancing addon for the cluster. Defaults to \"true\""
type = bool
}
variable "cluster_name" {
description = "The name of your GKE cluster."
type = string
}
variable "cluster_network_policy" {
default = true
description = "Enable the network policy addon for the cluster. Defaults to \"true\", and uses CALICO as the provider"
type = bool
}
variable "create_service_account" {
default = true
description = "Creates a service account for the cluster. Defaults to \"true\"."
type = bool
}
variable "database_encryption_key_name" {
default = ""
description = "Name of the KMS key to encrypt Kubernetes secrets at rest in etcd"
type = string
}
variable "datapath_provider" {
default = "DATAPATH_PROVIDER_UNSPECIFIED"
description = "the datapath provider to use, in the future, the default of this should be ADVANCED_DATAPATH"
type = string
}
variable "default_max_pods_per_node" {
description = "the number of pods per node, defaults to GKE default of 110, but in smaller CIDRs we want to tune this"
type = number
default = 110
}
variable "enable_database_encryption" {
default = false
description = "Enables etcd encryption via Google KMS."
type = bool
}
variable "enable_func_pool" {
default = true
description = "Enable an additional dedicated pool for Pulsar Functions. Enabled by default."
type = bool
}
variable "enable_private_gke" {
default = false
description = "Enables private GKE cluster, where nodes are not publicly accessible. Defaults to \"false\"."
type = bool
}
// TODO: deprecate this variable
variable "enable_resource_creation" {
default = true
description = "When enabled, all dependencies, like service accounts, buckets, etc will be created. When disabled, they will note. Use in combination with `enable_<app>` to manage these outside this module"
type = bool
}
variable "firewall_inbound_ports" {
type = list(string)
description = "List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied."
// we add 5443 for OLM
default = ["5443", "8443", "9443", "15017"]
}
variable "func_pool_autoscaling" {
default = true
description = "Enable autoscaling of the Pulsar Functions pool. Defaults to \"true\"."
type = bool
}
variable "func_pool_autoscaling_initial_count" {
default = 0
description = "The initial number of nodes in the Pulsar Functions pool, per zone, when autoscaling is enabled. Defaults to 0."
type = number
}
variable "func_pool_autoscaling_min_size" {
default = 0
description = "The minimum size of the Pulsar Functions pool AutoScaling group. Defaults to 0."
type = number
}
variable "func_pool_autoscaling_max_size" {
default = 3
description = "The maximum size of the Pulsar Functions pool Autoscaling group. Defaults to 3."
type = number
}
variable "func_pool_auto_repair" {
default = true
description = "Enable auto-repair for the Pulsar Functions pool."
type = bool
}
variable "func_pool_auto_upgrade" {
default = true
description = "Enable auto-upgrade for the Pulsar Functions pool."
type = bool
}
variable "func_pool_count" {
default = 1
description = "The number of worker nodes in the Pulsar Functions pool. This is only used if func_pool_autoscaling is set to false. Defaults to 1."
type = number
}
variable "func_pool_disk_size" {
default = 100
description = "Disk size in GB for worker nodes in the Pulsar Functions pool. Defaults to 100."
type = number
}
variable "func_pool_disk_type" {
default = "pd-standard"
description = "The type disk attached to worker nodes in the Pulsar Functions pool. Defaults to \"pd-standard\"."
type = string
}
variable "func_pool_image_type" {
default = "COS_CONTAINERD"
description = "The image type to use for worker nodes in the Pulsar Functions pool. Defaults to \"COS\" (cointainer-optimized OS with docker)."
type = string
}
variable "func_pool_locations" {
default = ""
description = "A string of comma seperated values (upstream requirement) of zones for the Pulsar Functions pool, e.g. \"us-central1-b,us-central1-c\" etc. Nodes must be in the same region as the cluster. Defaults to three random zones in the region specified for the cluster via the \"cluster_location\" input, or the zones provided through the \"node_pool_locations\" input (if it is defined)."
type = string
}
variable "func_pool_machine_type" {
default = "n2-standard-4"
description = "The machine type to use for worker nodes in the Pulsar Functions pool. Defaults to \"n2-standard-4\"."
type = string
}
variable "func_pool_max_pods_per_node" {
description = "the number of pods per node"
type = number
default = 110
}
variable "func_pool_name" {
default = "func-pool"
description = "The name of the Pulsar Functions pool. Defaults to \"default-node-pool\"."
type = string
}
variable "func_pool_service_account" {
default = ""
description = "The service account email address to use for the Pulsar Functions pool. If create_service_account is set to true, it will use the the output from the module."
type = string
}
variable "func_pool_ssd_count" {
default = 0
description = "The number of SSDs to attach to each node in the Pulsar Functions pool. Defaults to 0."
type = number
}
variable "func_pool_version" {
default = ""
description = "The version of Kubernetes to use for the Pulsar Functions pool. If the input \"release_channel\" is not defined, defaults to \"kubernetes_version\" used for the cluster. Should only be defined while \"func_pool_auto_upgrade\" is also set to \"false\"."
type = string
}
variable "google_service_account" {
default = ""
description = "when set, don't create GSAs and instead use the this service account for all apps"
type = string
}
variable "kubernetes_version" {
default = "latest"
description = "The version of Kubernetes to use for the cluster. Defaults to \"latest\", which uses the latest available version for GKE in the region specified."
type = string
}
variable "logging_service" {
default = "logging.googleapis.com/kubernetes"
description = "The logging service to use for the cluster. Defaults to \"logging.googleapis.com/kubernetes\"."
type = string
}
variable "logging_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, WORKLOADS. Empty list is default GKE configuration."
default = []
}
variable "monitoring_enabled_components" {
type = list(string)
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER. Empty list is default GKE configuration."
default = []
}
variable "maintenance_exclusions" {
default = []
description = "A list of objects used to define exceptions to the maintenance window, when non-emergency maintenance should not occur. Can have up to three exclusions. Refer to the offical Terraform docs on the \"google_container_cluster\" resource for object schema."
type = list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))
}
variable "maintenance_window" {
default = "05:00"
description = "The start time (in RFC3339 format) for the GKE to perform maintenance operations. Defaults to \"05:00\"."
type = string
}
variable "master_authorized_networks" {
default = []
description = "A list of objects used to define authorized networks. If none are provided, the default is to disallow external access. See the parent module for more details. https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/latest"
type = list(object({ cidr_block = string, display_name = string }))
}
variable "gcp_public_cidrs_access_enabled" {
default = false
description = "Enable access from GCP public CIDRs. Defaults to false."
type = bool
}
variable "node_pool_autoscaling" {
default = true
description = "Enable autoscaling of the default node pool. Defaults to \"true\"."
type = bool
}
variable "node_pool_autoscaling_initial_count" {
default = 1
description = "The initial number of nodes per zone in the default node pool, PER ZONE, when autoscaling is enabled. Defaults to 1."
type = number
}
variable "node_pool_autoscaling_min_size" {
default = 1
description = "The minimum size of the default node pool AutoScaling group. Defaults to 1."
type = number
}
variable "node_pool_autoscaling_max_size" {
default = 5
description = "The maximum size of the default node pool Autoscaling group. Defaults to 5."
type = number
}
variable "node_pool_auto_repair" {
default = true
description = "Enable auto-repair for the default node pool."
type = bool
}
variable "node_pool_auto_upgrade" {
default = true
description = "Enable auto-upgrade for the default node pool."
type = bool
}
variable "node_pool_count" {
default = 3
description = "The number of worker nodes in the default node pool. This is only used if node_pool_autoscaling is set to false. Defaults to 3."
type = number
}
variable "node_pool_disk_size" {
default = 100
description = "Disk size in GB for worker nodes in the default node pool. Defaults to 100."
type = number
}
variable "node_pool_disk_type" {
default = "pd-standard"
description = "The type disk attached to worker nodes in the default node pool. Defaults to \"pd-standard\"."
type = string
}
variable "node_pool_image_type" {
default = "COS_CONTAINERD"
description = "The image type to use for worker nodes in the default node pool. Defaults to \"COS\" (cointainer-optimized OS with docker)."
type = string
}
variable "node_pool_locations" {
default = ""
description = "A string of comma seperated values (upstream requirement) of zones for the location of the default node pool, e.g. \"us-central1-b,us-central1-c\" etc. Nodes must be in the region as the cluster. Defaults to three random zones in the region chosen for the cluster"
type = string
}
variable "node_pool_machine_type" {
default = "n2-standard-8"
description = "The machine type to use for worker nodes in the default node pool. Defaults to \"n2-standard-8\"."
type = string
}
variable "node_pool_max_pods_per_node" {
description = "the number of pods per node"
type = number
default = 110
}
variable "node_pool_name" {
default = "default-node-pool"
description = "The name of the default node pool. Defaults to \"sn-node-pool\"."
type = string
}
variable "node_pool_secure_boot" {
default = false
description = "enable the node pool secure boot setting"
type = bool
}
variable "node_pool_service_account" {
default = ""
description = "The service account email address to use for the default node pool. If create_service_account is set to true, it will use the the output from the module."
type = string
}
variable "node_pool_ssd_count" {
default = 0
description = "The number of SSDs to attach to each node in the default node pool"
type = number
}
variable "node_pool_version" {
default = ""
description = "The version of Kubernetes to use for the default node pool. If the input \"release_channel\" is not defined, defaults to \"kubernetes_version\" used for the cluster. Should only be defined while \"node_pool_auto_upgrade\" is also set to \"false\"."
type = string
}
variable "project_id" {
description = "The project ID to use for the cluster. Defaults to the current GCP project."
type = string
}
variable "release_channel" {
default = "STABLE"
description = "The Kubernetes release channel to use for the cluster. Accepted values are \"UNSPECIFIED\", \"RAPID\", \"REGULAR\" and \"STABLE\". Defaults to \"UNSPECIFIED\"."
type = string
}
variable "region" {
description = "The GCP region where the GKE cluster will be deployed. This module only supports creation of a regional cluster"
type = string
}
variable "secondary_ip_range_pods" {
default = null
description = "The name of the secondary range to use for the pods in the cluster. If no secondary range for the pod network is provided, GKE will create a /14 CIDR within the subnetwork provided by the \"vpc_subnet\" input"
type = string
}
variable "secondary_ip_range_pods_cidr" {
default = null
description = "The cidr of the secondary range, required when using cillium"
type = string
}
variable "secondary_ip_range_services" {
default = null
description = "The name of the secondary range to use for services in the cluster. If no secondary range for the services network is provided, GKE will create a /20 CIDR within the subnetwork provided by the \"vpc_subnet\" input"
type = string
}
variable "suffix" {
default = ""
description = "A unique string that is used to distinguish cluster resources, where name length constraints are imposed by GKE. Defaults to an empty string."
type = string
validation {
condition = length(var.suffix) < 12
error_message = "Suffix must be less than 12 characters."
}
}
variable "storage_class_default_ssd" {
default = false
description = "determines if the default storage class should be with ssd"
type = bool
}
variable "vpc_subnet" {
description = "The name of the VPC subnetwork to use by the cluster nodes. Can be set to \"default\" if the default VPC is enabled in the project, and GKE will choose the subnetwork based on the \"region\" input"
type = string
}
variable "vpc_network" {
description = "The name of the VPC network to use for the cluster. Can be set to \"default\" if the default VPC is enabled in the project"
type = string
}
variable "network_project_id" {
default = ""
description = "If using a different project, the id of the project"
type = string
}
variable "enable_private_nodes" {
type = bool
description = "Whether nodes have internal IP addresses only."
default = false
}
variable "master_ipv4_cidr_block" {
type = string
description = "The IP range in CIDR notation to use for the hosted master network. Only used for private clusters"
default = "10.0.0.0/28"
}
variable "deletion_protection" {
type = bool
description = "Whether or not to allow Terraform to destroy the cluster."
default = true
}
variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster, this cannot be disabled once it has been enabled."
default = false
}