-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
471 lines (395 loc) · 13.2 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
// region azure/aks
variable "resource_group_name" {
type = string
description = "The resource group name to be imported"
}
variable "aks_cluster_name" {
type = string
description = "The name for the AKS resources created in the specified Azure Resource Group. This variable overwrites the 'prefix' var (The 'prefix' var will still be applied to the dns_prefix if it is set)"
default = null
}
variable "cluster_log_analytics_workspace_name" {
type = string
description = "The name of the Analytics workspace"
default = null
}
variable "prefix" {
type = string
description = "The prefix for the resources created in the specified Azure Resource Group"
default = "ocean"
}
variable "client_id" {
type = string
description = "The Client ID (appId) for the Service Principal used for the AKS deployment"
default = ""
}
variable "client_secret" {
type = string
description = "The Client Secret (password) for the Service Principal used for the AKS deployment"
default = ""
}
variable "admin_username" {
type = string
description = "The username of the local administrator to be created on the Kubernetes cluster"
default = "azureuser"
}
variable "agents_size" {
type = string
description = "The default virtual machine size for the Kubernetes agents"
default = "Standard_D2s_v3"
}
variable "log_analytics_workspace_sku" {
type = string
description = "The SKU (pricing level) of the Log Analytics workspace. For new subscriptions the SKU should be set to PerGB2018"
default = "PerGB2018"
}
variable "log_retention_in_days" {
type = number
description = "The retention period for the logs in days"
default = 30
}
variable "agents_count" {
type = number
description = "The number of Agents that should exist in the Agent Pool. Please set `agents_count` `null` while `enable_auto_scaling` is `true` to avoid possible `agents_count` changes"
default = 1
}
variable "public_ssh_key" {
type = string
description = "A custom ssh key to control access to the AKS cluster"
default = ""
}
variable "tags" {
type = map(string)
description = "Any tags that should be present on the Virtual Network resources"
default = {}
}
variable "enable_log_analytics_workspace" {
type = bool
description = "Enable the creation of azurerm_log_analytics_workspace and azurerm_log_analytics_solution or not"
default = true
}
variable "vnet_subnet_id" {
type = string
description = "The ID of a Subnet where the Kubernetes Node Pool should exist. Changing this forces a new resource to be created"
default = null
}
variable "os_disk_size_gb" {
type = number
description = "Disk size of nodes in GBs"
default = 50
}
variable "os_disk_type" {
type = string
description = "Disk type of nodes"
default = "Standard_LRS"
}
variable "private_cluster_enabled" {
type = bool
description = "If true cluster API server will be exposed only on internal IP address and available only in cluster vnet"
default = false
}
variable "enable_kube_dashboard" {
type = bool
description = "Enable Kubernetes Dashboard"
default = false
}
variable "enable_http_application_routing" {
type = bool
description = "Enable HTTP Application Routing Addon (forces recreation)"
default = false
}
variable "enable_azure_policy" {
type = bool
description = "Enable Azure Policy Addon"
default = false
}
variable "sku_tier" {
type = string
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free and Paid"
default = "Free"
}
variable "enable_role_based_access_control" {
type = bool
description = "Enable Role Based Access Control"
default = false
}
variable "rbac_aad_managed" {
type = bool
description = "Is the Azure Active Directory integration Managed, meaning that Azure will create/manage the Service Principal used for integration"
default = false
}
variable "rbac_aad_admin_group_object_ids" {
type = list(string)
description = "Object ID of groups with admin access"
default = null
}
variable "rbac_aad_client_app_id" {
type = string
description = "The Client ID of an Azure Active Directory Application"
default = null
}
variable "rbac_aad_server_app_id" {
type = string
description = "The Server ID of an Azure Active Directory Application"
default = null
}
variable "rbac_aad_server_app_secret" {
type = string
description = "The Server Secret of an Azure Active Directory Application"
default = null
}
variable "network_plugin" {
type = string
description = "Network plugin to use for networking"
default = "azure"
}
variable "network_policy" {
type = string
description = "Sets up network policy to be used with Azure CNI. Network policy allows us to control the traffic flow between pods. Currently supported values are calico and azure. Changing this forces a new resource to be created"
default = null
}
variable "net_profile_dns_service_ip" {
type = string
description = "IP address within the Kubernetes service address range that will be used by cluster service discovery (kube-dns). Changing this forces a new resource to be created"
default = null
}
variable "net_profile_docker_bridge_cidr" {
type = string
description = "IP address (in CIDR notation) used as the Docker bridge IP address on nodes. Changing this forces a new resource to be created"
default = null
}
variable "net_profile_outbound_type" {
type = string
description = "The outbound (egress) routing method which should be used for this Kubernetes Cluster. Possible values are loadBalancer and userDefinedRouting. Defaults to loadBalancer"
default = "loadBalancer"
}
variable "net_profile_pod_cidr" {
type = string
description = "The CIDR to use for pod IP addresses. This field can only be set when network_plugin is set to kubenet. Changing this forces a new resource to be created"
default = null
}
variable "net_profile_service_cidr" {
type = string
description = "The Network Range used by the Kubernetes service. Changing this forces a new resource to be created"
default = null
}
variable "kubernetes_version" {
type = string
description = "Specify which Kubernetes release to use. The default used is the latest Kubernetes version available in the region"
default = null
}
variable "orchestrator_version" {
type = string
description = "Specify which Kubernetes release to use for the orchestration layer. The default used is the latest Kubernetes version available in the region"
default = null
}
variable "enable_auto_scaling" {
type = bool
description = "Enable AKS node pool autoscaling"
default = false
}
variable "agents_max_count" {
type = number
description = "Maximum number of nodes in a pool"
default = null
}
variable "agents_min_count" {
type = number
description = "Minimum number of nodes in a pool"
default = null
}
variable "agents_pool_name" {
type = string
description = "The default Azure AKS agentpool (nodepool) name"
default = "nodepool"
}
variable "enable_node_public_ip" {
type = bool
description = "Should nodes in this Node Pool have a Public IP Address? Defaults to false"
default = false
}
variable "agents_availability_zones" {
type = list(string)
description = "A list of Availability Zones across which the Node Pool should be spread. Changing this forces a new resource to be created"
default = null
}
variable "agents_type" {
type = string
description = "The type of Node Pool which should be created. Possible values are AvailabilitySet and VirtualMachineScaleSets. Defaults to VirtualMachineScaleSets"
default = "VirtualMachineScaleSets"
}
variable "agents_max_pods" {
type = number
description = "The maximum number of pods that can run on each agent. Changing this forces a new resource to be created"
default = null
}
variable "identity_type" {
type = string
description = "The type of identity used for the managed cluster. Conflict with `client_id` and `client_secret`. Possible values are `SystemAssigned` and `UserAssigned`. If `UserAssigned` is set, a `user_assigned_identity_id` must be set as well"
default = "SystemAssigned"
}
variable "user_assigned_identity_id" {
type = string
description = "The ID of a user assigned identity"
default = null
}
variable "user_assigned_identity_name" {
type = string
description = "The name of a user assigned identity"
default = null
}
// endregion
// region spotinst/ocean-aks
variable "spotinst_token" {
type = string
description = "Spot Personal Access token"
}
variable "spotinst_account" {
type = string
description = "Spot account ID"
}
variable "create_aks" {
type = bool
description = "Controls whether AKS cluster should be created (it affects all Azure resources)"
default = true
}
variable "create_ocean" {
type = bool
description = "Controls whether Ocean should be created (it affects all Ocean resources)"
default = true
}
variable "acd_identifier" {
type = string
description = "A unique identifier used by the Ocean AKS Connector when importing an AKS cluster"
default = null
}
variable "cluster_identifier" {
type = string
description = "Cluster identifier"
default = null
}
variable "node_pools" {
type = list(map(string))
description = "List of maps containing node pools to be imported as Ocean Virtual Node Groups"
default = [
{
name = "nodepool", // default system node pool
},
]
}
variable "node_pools_labels" {
type = map(map(string))
description = "Map of maps containing node labels by node pool name"
default = {
all = {}
nodepool = {}
}
}
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 = {
all = []
nodepool = []
}
}
variable "node_pools_tags" {
type = map(map(string))
description = "Map of maps containing node tags by node pool name"
default = {
all = {}
nodepool = {}
}
}
variable "node_pools_headrooms" {
type = map(map(string))
description = "Map of maps containing headroom configuration by node pool name"
default = {
all = {},
nodepool = {},
}
}
variable "kubelet_assign_role" {
type = string
description = "Name of a built-in role to assign to the Kubelet identity"
default = "Contributor"
}
// endregion
// region spotinst/ocean-controller
variable "create_controller" {
type = bool
description = "Controls whether the Ocean Controller should be deployed (it affects all Kubernetes resources)"
default = true
}
variable "controller_image_pull_policy" {
type = string
description = "Image pull policy (one of: Always, Never, IfNotPresent)"
default = "IfNotPresent"
}
variable "controller_base_url" {
type = string
description = "Base URL to be used by the HTTP client"
default = ""
}
variable "controller_proxy_url" {
type = string
description = "Proxy server URL to communicate through"
default = ""
}
variable "controller_enable_csr_approval" {
type = bool
description = "Enable the CSR approval feature"
default = false
}
variable "controller_disable_auto_update" {
type = bool
description = "Disable the auto-update feature"
default = false
}
variable "controller_image_pull_secrets" {
type = list(string)
description = "List of references to secrets in the same namespace to use for pulling the image"
default = []
}
variable "controller_resources_limits" {
type = map(any)
description = "Definition of the maximum amount of compute resources allowed"
default = null
// default = {
// cpu = "0.5"
// memory = "512Mi"
// }
}
variable "controller_resources_requests" {
type = map(any)
description = "Definition of the minimum amount of compute resources required"
default = null
// default = {
// cpu = "0.5"
// memory = "512Mi"
// }
}
variable "controller_tolerations" {
type = list(any)
description = "List of additional `toleration` objects, see: https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/pod#toleration"
default = [
{
key = "node.kubernetes.io/not-ready"
effect = "NoExecute"
operator = "Exists"
toleration_seconds = 150
},
{
key = "node.kubernetes.io/unreachable"
effect = "NoExecute"
operator = "Exists"
toleration_seconds = 150
},
]
}
variable "controller_aks_connector_enabled" {
type = bool
description = "Controls whether the Ocean AKS Connector should be deployed (requires a valid `acd_identifier`)"
default = true
}
// endregion