Skip to content

Commit e1dca0a

Browse files
[π˜€π—½π—Ώ] changes to main this commit is based on
Created using spr 1.3.4 [skip ci]
1 parent 21a79a2 commit e1dca0a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

β€Žpremerge/gke_cluster/main.tfβ€Ž

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ resource "google_container_cluster" "llvm_premerge" {
1212
# for adding windows nodes to the cluster.
1313
networking_mode = "VPC_NATIVE"
1414
ip_allocation_policy {}
15+
16+
# Set the workload identity config so that we can authenticate with Google
17+
# Cloud APIs using workload identity federation as described in
18+
# https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity.
19+
workload_identity_config {
20+
workload_pool = "llvm-premerge-checks.svc.id.goog"
21+
}
1522
}
1623

1724
resource "google_container_node_pool" "llvm_premerge_linux_service" {
@@ -62,6 +69,12 @@ resource "google_container_node_pool" "llvm_premerge_linux" {
6269
resource_labels = {
6370
"goog-gke-node-pool-provisioning-model" = "on-demand"
6471
}
72+
73+
# Enable workload identity federation for this pool so that we can access
74+
# GCS buckets.
75+
workload_metadata_config {
76+
mode = "GKE_METADATA"
77+
}
6578
}
6679
}
6780

@@ -139,5 +152,27 @@ resource "google_container_node_pool" "llvm_premerge_windows_2022" {
139152
resource_labels = {
140153
"goog-gke-node-pool-provisioning-model" = "on-demand"
141154
}
155+
156+
# Enable workload identity federation for this pool so that we can access
157+
# GCS buckets.
158+
workload_metadata_config {
159+
mode = "GKE_METADATA"
160+
}
142161
}
143162
}
163+
164+
resource "google_storage_bucket" "object_cache_linux" {
165+
name = format("%s-object-cache-linux", var.cluster_name)
166+
location = var.region
167+
168+
uniform_bucket_level_access = true
169+
public_access_prevention = "enforced"
170+
}
171+
172+
resource "google_storage_bucket" "object_cache_windows" {
173+
name = format("%s-object-cache-windows", var.cluster_name)
174+
location = var.region
175+
176+
uniform_bucket_level_access = true
177+
public_access_prevention = "enforced"
178+
}

0 commit comments

Comments
Β (0)