Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override boot-disk type and size for v5e node #1041

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tools/kubernetes/terraform/examples/v5e/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@ tpu_node_pools = [{
machine_type = "ct5lp-hightpu-4t"
topology = "16x16"
policy = "sb-compact-1"
disk_type = "pd-balanced"
disk_size_gb = 50
}, {
zone = "us-east5-b"
node_count = 64
machine_type = "ct5lp-hightpu-4t"
topology = "16x16"
policy = "sb-compact-1"
disk_type = "pd-balanced"
disk_size_gb = 50
}, {
zone = "us-east5-b"
node_count = 64
machine_type = "ct5lp-hightpu-4t"
topology = "16x16"
policy = "sb-compact-1"
disk_type = "pd-balanced"
disk_size_gb = 50
}, {
zone = "us-east5-b"
node_count = 64
machine_type = "ct5lp-hightpu-4t"
topology = "16x16"
policy = "sb-compact-1"
}]
disk_type = "pd-balanced"
disk_size_gb = 50
}]
maintenance_interval = "PERIODIC"
14 changes: 8 additions & 6 deletions tools/kubernetes/terraform/module/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ resource "google_container_cluster" "tpu_cluster" {
release_channel {
channel = "UNSPECIFIED"
}

network = google_compute_network.vpc.name
subnetwork = google_compute_subnetwork.subnet.name
logging_service = "logging.googleapis.com/kubernetes"
Expand All @@ -81,7 +81,7 @@ resource "google_container_node_pool" "multihost_tpu" {
cluster = google_container_cluster.tpu_cluster.name

initial_node_count = var.tpu_node_pools[count.index].node_count

management {
auto_upgrade = false
}
Expand All @@ -104,16 +104,18 @@ resource "google_container_node_pool" "multihost_tpu" {
gcfs_config {
enabled = true
}
image_type = "COS_CONTAINERD"

image_type = "COS_CONTAINERD"
machine_type = var.tpu_node_pools[count.index].machine_type
disk_type = var.tpu_node_pools[count.index].disk_type
disk_size_gb = var.tpu_node_pools[count.index].disk_size_gb
tags = ["gke-node"]
metadata = {
disable-legacy-endpoints = "true"
}
}
placement_policy {
type = "COMPACT"
policy_name = var.tpu_node_pools[count.index].policy
type = "COMPACT"
policy_name = var.tpu_node_pools[count.index].policy
}
}
4 changes: 3 additions & 1 deletion tools/kubernetes/terraform/module/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ variable "tpu_node_pools" {
machine_type = string,
topology = string,
policy = string,
disk_type = string,
disk_size_gb = number,
}))
}

variable "maintenance_interval" {
default = "AS_NEEDED"
default = "AS_NEEDED"
description = "maintenance interval for TPU machines."
}