Skip to content

Commit b0c7db7

Browse files
committed
Update cluster as regional and update ip_cidr_range.
1 parent 9c0df3b commit b0c7db7

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
variable "project_id" {}
22
variable "resource_name_prefix" {}
33
variable "region" {}
4-
variable "location" {}
54
variable "tpu_node_pools" {}
65
variable "maintenance_interval" {}
76

@@ -11,7 +10,6 @@ module "tpu-gke" {
1110
project_id = var.project_id
1211
resource_name_prefix = var.resource_name_prefix
1312
region = var.region
14-
location = var.location
1513
tpu_node_pools = var.tpu_node_pools
1614
maintenance_interval = var.maintenance_interval
1715
}

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
project_id = "project-id"
1+
project_id = "project_id"
22
resource_name_prefix = "tpu-v5e-test"
33
region = "us-east5"
4-
location = "us-east5-b"
54
tpu_node_pools = [{
5+
zone = "us-east5-b"
6+
node_count = 64
7+
machine_type = "ct5lp-hightpu-4t"
8+
topology = "16x16"
9+
policy = "sb-compact-1"
10+
}, {
11+
zone = "us-east5-b"
12+
node_count = 64
13+
machine_type = "ct5lp-hightpu-4t"
14+
topology = "16x16"
15+
policy = "sb-compact-1"
16+
}, {
17+
zone = "us-east5-b"
18+
node_count = 64
19+
machine_type = "ct5lp-hightpu-4t"
20+
topology = "16x16"
21+
policy = "sb-compact-1"
22+
}, {
623
zone = "us-east5-b"
724
node_count = 64
825
machine_type = "ct5lp-hightpu-4t"

tools/kubernetes/terraform/module/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# GKE cluster
1818
data "google_container_engine_versions" "gke_version" {
19-
location = var.location
19+
location = var.region
2020
version_prefix = "1.27."
2121
}
2222

@@ -36,12 +36,12 @@ resource "google_compute_subnetwork" "subnet" {
3636
name = "${var.resource_name_prefix}-subnet"
3737
region = var.region
3838
network = google_compute_network.vpc.name
39-
ip_cidr_range = "10.10.0.0/24"
39+
ip_cidr_range = "10.10.0.0/19"
4040
}
4141

4242
resource "google_container_cluster" "tpu_cluster" {
4343
name = "${var.resource_name_prefix}-gke-cluster"
44-
location = var.location
44+
location = var.region
4545

4646
# We can't create a cluster with no node pool defined, but we want to only use
4747
# separately managed node pools. So we create the smallest possible default
@@ -70,7 +70,7 @@ resource "google_container_node_pool" "multihost_tpu" {
7070
name = "${google_container_cluster.tpu_cluster.name}-${count.index}"
7171
provider = google-beta
7272
project = var.project_id
73-
location = var.location
73+
location = var.region
7474
node_locations = [var.tpu_node_pools[count.index].zone]
7575
cluster = google_container_cluster.tpu_cluster.name
7676

tools/kubernetes/terraform/module/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ variable "region" {
2222
description = "region"
2323
}
2424

25-
variable "location" {
26-
description = "location"
27-
}
28-
2925
variable "resource_name_prefix" {
3026
default = ""
3127
description = "prefix for all the resouce naming"

0 commit comments

Comments
 (0)