Skip to content

Commit 9791eed

Browse files
authored
Merge pull request #1041 from kangminxie/kangminx/pd-ssd-01
2 parents 83ae02d + eefc3e5 commit 9791eed

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

tools/kubernetes/terraform/examples/v5e/terraform.tfvars

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@ tpu_node_pools = [{
77
machine_type = "ct5lp-hightpu-4t"
88
topology = "16x16"
99
policy = "sb-compact-1"
10+
disk_type = "pd-balanced"
11+
disk_size_gb = 50
1012
}, {
1113
zone = "us-east5-b"
1214
node_count = 64
1315
machine_type = "ct5lp-hightpu-4t"
1416
topology = "16x16"
1517
policy = "sb-compact-1"
18+
disk_type = "pd-balanced"
19+
disk_size_gb = 50
1620
}, {
1721
zone = "us-east5-b"
1822
node_count = 64
1923
machine_type = "ct5lp-hightpu-4t"
2024
topology = "16x16"
2125
policy = "sb-compact-1"
26+
disk_type = "pd-balanced"
27+
disk_size_gb = 50
2228
}, {
2329
zone = "us-east5-b"
2430
node_count = 64
2531
machine_type = "ct5lp-hightpu-4t"
2632
topology = "16x16"
2733
policy = "sb-compact-1"
28-
}]
34+
disk_type = "pd-balanced"
35+
disk_size_gb = 50
36+
}]
2937
maintenance_interval = "PERIODIC"

tools/kubernetes/terraform/module/main.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ resource "google_container_cluster" "tpu_cluster" {
5858
release_channel {
5959
channel = "UNSPECIFIED"
6060
}
61-
61+
6262
network = google_compute_network.vpc.name
6363
subnetwork = google_compute_subnetwork.subnet.name
6464
logging_service = "logging.googleapis.com/kubernetes"
@@ -81,7 +81,7 @@ resource "google_container_node_pool" "multihost_tpu" {
8181
cluster = google_container_cluster.tpu_cluster.name
8282

8383
initial_node_count = var.tpu_node_pools[count.index].node_count
84-
84+
8585
management {
8686
auto_upgrade = false
8787
}
@@ -104,16 +104,18 @@ resource "google_container_node_pool" "multihost_tpu" {
104104
gcfs_config {
105105
enabled = true
106106
}
107-
108-
image_type = "COS_CONTAINERD"
107+
108+
image_type = "COS_CONTAINERD"
109109
machine_type = var.tpu_node_pools[count.index].machine_type
110+
disk_type = var.tpu_node_pools[count.index].disk_type
111+
disk_size_gb = var.tpu_node_pools[count.index].disk_size_gb
110112
tags = ["gke-node"]
111113
metadata = {
112114
disable-legacy-endpoints = "true"
113115
}
114116
}
115117
placement_policy {
116-
type = "COMPACT"
117-
policy_name = var.tpu_node_pools[count.index].policy
118+
type = "COMPACT"
119+
policy_name = var.tpu_node_pools[count.index].policy
118120
}
119121
}

tools/kubernetes/terraform/module/variables.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ variable "tpu_node_pools" {
3535
machine_type = string,
3636
topology = string,
3737
policy = string,
38+
disk_type = string,
39+
disk_size_gb = number,
3840
}))
3941
}
4042

4143
variable "maintenance_interval" {
42-
default = "AS_NEEDED"
44+
default = "AS_NEEDED"
4345
description = "maintenance interval for TPU machines."
4446
}

0 commit comments

Comments
 (0)