-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgke.tf
64 lines (53 loc) · 1.66 KB
/
gke.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
resource "google_container_cluster" "primary" {
name = var.cluster_name
location = var.region
node_locations = [var.zone]
# We can't create a cluster with no node pool defined, but we want to only use
# separately managed node pools. So we create the smallest possible default
# node pool and immediately delete it.
remove_default_node_pool = true
initial_node_count = 1
network = google_compute_network.vpc.name
subnetwork = google_compute_subnetwork.subnet.name
}
resource "google_container_node_pool" "gpu_pool" {
name = google_container_cluster.primary.name
location = var.region
cluster = google_container_cluster.primary.name
node_count = 1
autoscaling {
total_min_node_count = "1"
total_max_node_count = "1"
}
management {
auto_repair = "true"
auto_upgrade = "true"
}
node_config {
oauth_scopes = [
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/trace.append",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/servicecontrol",
]
labels = {
env = var.project_id
}
guest_accelerator {
type = var.gpu_type
count = 1
gpu_driver_installation_config {
gpu_driver_version = var.gpu_driver_version
}
}
image_type = "cos_containerd"
machine_type = var.machine_type
tags = ["gke-node", "${var.project_id}-gke"]
disk_size_gb = "500"
metadata = {
disable-legacy-endpoints = "true"
}
}
}