-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-pools.tf
40 lines (32 loc) · 1.17 KB
/
node-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
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_service_account
resource "google_service_account" "kubernetes" {
account_id = "kubernetes"
}
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool
resource "google_container_node_pool" "main" {
name = local.values.kubernetes.nodePool.name
cluster = google_container_cluster.primary.id
node_count = local.values.kubernetes.nodePool.nodeCount
management {
auto_repair = true
auto_upgrade = true
}
autoscaling {
min_node_count = local.values.kubernetes.nodePool.autoscaling.min
max_node_count = local.values.kubernetes.nodePool.autoscaling.max
}
node_config {
preemptible = false
machine_type = local.values.kubernetes.nodePool.machineType
disk_size_gb = local.values.kubernetes.nodePool.diskSizeGb
disk_type = "pd-ssd"
labels = {
environment = local.values.kubernetes.environment
}
tags = ["${local.values.kubernetes.name}-node"]
service_account = google_service_account.kubernetes.email
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}