-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpools.tf
53 lines (46 loc) · 1.68 KB
/
pools.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
resource "google_container_node_pool" "node-pools" {
for_each = var.node_pools
depends_on = [google_container_cluster.default]
name = each.key
project = var.project_id
location = var.zone
cluster = var.gke_cluster_name
initial_node_count = each.value.initial_node_count
autoscaling {
min_node_count = lookup(each.value, "min_node_count", 1)
max_node_count = lookup(each.value, "max_node_count", 2)
}
management {
auto_repair = lookup(each.value, "auto_repair", true)
auto_upgrade = lookup(each.value, "auto_upgrade", true)
}
node_config {
machine_type = lookup(each.value, "machine_type", var.default_machine_type)
disk_size_gb = lookup(each.value, "disk_size_gb", 10)
disk_type = lookup(each.value, "disk_type", "pd-standard")
spot = lookup(each.value, "spot", false)
service_account = lookup(each.value, "service_account", "")
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/trace.append",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/servicecontrol",
]
workload_metadata_config {
mode = "GKE_METADATA"
}
tags = each.value.tags
dynamic "taint" {
for_each = {
for obj in each.value.taints : "${obj.key}_${obj.value}_${obj.effect}" => obj
}
content {
effect = taint.value.effect
key = taint.value.key
value = taint.value.value
}
}
}
}