-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
262 lines (220 loc) · 7.5 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
variable "name" {
description = "A prefix to the default cluster name"
default = "simple"
}
variable "project_id" {
description = "The project ID to host the cluster in (required)"
type = string
}
variable "region" {
description = "Region to deploy cluster"
type = string
default = "us-central1"
}
variable "cluster_resource_labels" {
description = "The GCE resource labels (a map of key/value pairs) to be applied to the cluster"
type = map(string)
default = {
owner = "owner_here"
environment = "environment"
}
}
variable "network" {
description = "The VPC network to host the cluster in (required)"
type = string
}
variable "ip_range_pods" {
description = "The VPC network to host the cluster in (required)"
type = string
default = "kubernetes-pods"
}
variable "ip_range_services" {
description = "The name of the secondary subnet range to use for services"
type = string
default = "kubernetes-services"
}
variable "subnetwork" {
description = "The subnetwork to host the cluster in (required)"
type = string
}
variable "regional" {
description = "Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!)"
type = bool
default = true
}
variable "zones" {
description = "The zones to host the cluster in (optional if regional cluster / required if zonal)"
type = list(string)
default = ["us-central1-a"]
}
variable "monitoring_service" {
description = "The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none"
type = string
default = "monitoring.googleapis.com/kubernetes"
}
variable "logging_service" {
description = "The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none"
type = string
default = "logging.googleapis.com/kubernetes"
}
variable "maintenance_start_time" {
description = "Time window start for maintenance operations in RFC3339 format"
type = string
default = "05:00"
}
variable "maintenance_end_time" {
description = "Time window end for maintenance operations in RFC3339 format"
type = string
default = "09:00"
}
variable "maintenance_recurrence" {
description = "RFC 5545 RRULE for when maintenance windows occur"
type = string
default = "FREQ=WEEKLY;BYDAY=WE"
}
variable "enable_intranode_visibility" {
description = "Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network"
type = bool
default = true
}
variable "create_service_account" {
description = "Defines if service account specified to run nodes should be created."
type = bool
default = true
}
variable "skip_provisioners" {
description = "Flag to skip local-exec provisioners"
type = bool
default = true
}
variable "default_max_pods_per_node" {
description = "The maximum number of pods to schedule per node"
default = 110
}
variable "http_load_balancing" {
description = "Enable httpload balancer addon"
type = bool
default = true
}
variable "horizontal_pod_autoscaling" {
description = "Enable horizontal pod autoscaling addon"
type = bool
default = true
}
variable "network_policy" {
description = "Enable network policy addon"
type = bool
default = true
}
variable "enable_private_nodes" {
default = true
}
variable "master_ipv4_cidr_block" {
default = "172.16.0.0/28"
}
variable "remove_default_node_pool" {
description = "Remove default node pool while setting up the cluster"
type = bool
default = true
}
variable "release_channel" {
type = string
description = "The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`."
default = "REGULAR"
}
variable "enable_resource_consumption_export" {
description = "Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export."
type = bool
default = false
}
variable "enable_shielded_nodes" {
description = "Enable Shielded Nodes features on all nodes in this cluster."
type = bool
default = true
}
variable "dns_cache" {
type = bool
description = "(Beta) The status of the NodeLocal DNSCache addon."
default = false
}
variable "gce_pd_csi_driver" {
description = "(Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."
type = bool
default = false
}
variable "cluster_telemetry_type" {
type = string
description = "Available options include ENABLED, DISABLED, and SYSTEM_ONLY"
default = null
}
variable "authenticator_security_group" {
type = string
description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected]"
default = "lsst.cloud"
}
variable "identity_namespace" {
description = "Workload Identity namespace. (Default value of `enabled` automatically sets project based namespace `[project_id].svc.id.goog`)"
type = string
default = "enabled"
}
variable "node_metadata" {
description = "Specifies how node metadata is exposed to the workload running on the node"
default = "GKE_METADATA_SERVER"
type = string
}
# ----------------------------------------
# NODE POOL VALUES
# ----------------------------------------
variable "node_pools" {
type = list(map(string))
description = "List of maps containing node pools"
default = [
{
name = "core-pool"
machine_type = "n2-standard-4"
node_locations = "us-central1-b"
node_count = 5
local_ssd_count = 0
auto_repair = true
auto_upgrade = true
preemptible = false
image_type = "cos_containerd"
enable_secure_boot = true
disk_size_gb = "200"
disk_type = "pd-ssd"
},
]
}
variable "node_pools_labels" {
type = map(map(string))
description = "Map of maps containing node labels by node-pool name."
default = {
all = {
owner = "owner_here"
environment = "environment_here"
}
}
}
variable "node_pools_taints" {
type = map(list(object({ key = string, value = string, effect = string })))
description = "Map of lists containing node taints by node-pool name"
default = {}
}
variable "cluster_autoscaling" {
type = object({
enabled = bool
autoscaling_profile = string
min_cpu_cores = number
max_cpu_cores = number
min_memory_gb = number
max_memory_gb = number
})
default = {
enabled = false
autoscaling_profile = "BALANCED"
min_cpu_cores = 0
max_cpu_cores = 0
min_memory_gb = 0
max_memory_gb = 0
}
}