-
Notifications
You must be signed in to change notification settings - Fork 0
/
locals.tf
120 lines (119 loc) · 4.42 KB
/
locals.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
locals {
tags = merge(
{
"terraform-module" = "terraform-azure-truefoundry-cluster"
"terraform" = "true"
"cluster-name" = var.name
"truefoundry" = "managed"
},
var.tags
)
node_pools = merge({ for k, v in var.cpu_pools : "${v["name"]}sp" => {
name = "${v["name"]}sp"
node_count = null
max_count = v["max_count"]
min_count = v["min_count"]
os_disk_size_gb = 100
priority = "Spot"
vm_size = v["instance_type"]
enable_auto_scaling = true
custom_ca_trust_enabled = false
enable_host_encryption = true
enable_node_public_ip = false
eviction_policy = "Delete"
orchestrator_version = var.orchestrator_version
node_taints = [
"kubernetes.azure.com/scalesetpriority=spot:NoSchedule"
]
tags = local.tags
zones = []
vnet_subnet_id = var.subnet_id
max_pods = var.max_pods_per_node
} if v["enable_spot_pool"] },
{ for k, v in var.cpu_pools : v["name"] => {
name = v["name"]
node_count = null
max_count = v["max_count"]
min_count = v["min_count"]
os_disk_size_gb = 100
priority = "Regular"
vm_size = v["instance_type"]
enable_auto_scaling = true
custom_ca_trust_enabled = false
enable_host_encryption = true
enable_node_public_ip = false
orchestrator_version = var.orchestrator_version
node_taints = []
tags = local.tags
zones = []
vnet_subnet_id = var.subnet_id
max_pods = var.max_pods_per_node
} if v["enable_on_demand_pool"] },
{ for k, v in var.gpu_pools : "${v["name"]}sp" => {
name = "${v["name"]}sp"
node_count = null
max_count = v["max_count"]
min_count = v["min_count"]
os_disk_size_gb = 100
priority = "Spot"
vm_size = v["instance_type"]
enable_auto_scaling = true
custom_ca_trust_enabled = false
enable_host_encryption = true
enable_node_public_ip = false
eviction_policy = "Delete"
orchestrator_version = var.orchestrator_version
node_taints = [
"kubernetes.azure.com/scalesetpriority=spot:NoSchedule",
"nvidia.com/gpu=Present:NoSchedule"
]
tags = local.tags
zones = []
vnet_subnet_id = var.subnet_id
max_pods = var.max_pods_per_node
} if v["enable_spot_pool"] },
{ for k, v in var.gpu_pools : v["name"] => {
name = v["name"]
node_count = null
max_count = v["max_count"]
min_count = v["min_count"]
os_disk_size_gb = 100
priority = "Regular"
vm_size = v["instance_type"]
enable_auto_scaling = true
custom_ca_trust_enabled = false
enable_host_encryption = true
enable_node_public_ip = false
orchestrator_version = var.orchestrator_version
node_taints = [
"nvidia.com/gpu=Present:NoSchedule"
]
tags = local.tags
zones = []
vnet_subnet_id = var.subnet_id
max_pods = var.max_pods_per_node
} if v["enable_on_demand_pool"] },
var.control_plane ? { "tfycp" = {
name = "tfycp"
node_count = null
max_count = 4
min_count = 0
os_disk_size_gb = 100
priority = "Spot"
vm_size = var.control_plane_instance_type
enable_auto_scaling = true
custom_ca_trust_enabled = false
enable_host_encryption = true
enable_node_public_ip = false
eviction_policy = "Delete"
orchestrator_version = var.orchestrator_version
node_taints = [
"kubernetes.azure.com/scalesetpriority=spot:NoSchedule",
"class.truefoundry.io/component=control-plane:NoSchedule"
]
tags = local.tags
zones = []
vnet_subnet_id = var.subnet_id
max_pods = var.max_pods_per_node
} } : null)
}