-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode_pool.tf
More file actions
80 lines (67 loc) · 2.02 KB
/
Copy pathnode_pool.tf
File metadata and controls
80 lines (67 loc) · 2.02 KB
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
resource "google_container_node_pool" "node_pool" {
depends_on = [google_container_cluster.cluster]
for_each = var.node_pools
name = each.key
location = var.location
cluster = var.name
initial_node_count = each.value.min_node_count
max_pods_per_node = var.max_pods_per_node
dynamic "autoscaling" {
for_each = each.value.max_node_count > each.value.min_node_count ? [1] : []
content {
min_node_count = each.value.min_node_count
max_node_count = each.value.max_node_count
}
}
management {
auto_repair = "true"
auto_upgrade = "true"
}
node_config {
resource_labels = {
"goog-gke-node-pool-provisioning-model" = "spot"
}
tags = []
kubelet_config {
cpu_cfs_quota = false
pod_pids_limit = 0
cpu_manager_policy = "none"
}
image_type = "COS_containerd"
machine_type = each.value.machine_type
disk_size_gb = each.value.disk_size_gb
disk_type = each.value.disk_type
preemptible = each.value.preemptible
metadata = {
"disable-legacy-endpoints" = "true"
}
oauth_scopes = concat(var.default_oauth_scopes, var.extra_oauth_scopes)
workload_metadata_config {
mode = "GKE_METADATA"
}
dynamic "guest_accelerator" {
for_each = each.value.guest_accelerator != null ? [each.value.guest_accelerator] : []
content {
type = guest_accelerator.value.type
count = guest_accelerator.value.count
dynamic "gpu_sharing_config" {
for_each = guest_accelerator.value.gpu_sharing_config != null ? [guest_accelerator.value.gpu_sharing_config] : []
content {
gpu_sharing_strategy = gpu_sharing_config.value.gpu_sharing_strategy
max_shared_clients_per_gpu = gpu_sharing_config.value.max_shared_clients_per_gpu
}
}
}
}
}
lifecycle {
ignore_changes = [
initial_node_count, node_config["resource_labels"]
]
}
timeouts {
create = "30m"
update = "30m"
delete = "30m"
}
}