Skip to content

Commit fc5a510

Browse files
authored
Merge pull request #7862 from upodroid/ppcle64-cluster
add ppc64le cluster to prow
2 parents e6f1a10 + d95cf8b commit fc5a510

22 files changed

+1295
-816
lines changed

infra/gcp/terraform/k8s-infra-prow/buckets.tf

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,15 @@ module "prow_bucket" {
9090
name = "kubernetes-ci-logs"
9191
project_id = module.project.project_id
9292
location = "us-central1"
93-
94-
# TODO: BenTheElder, what lifecycle policy do we have on the previous bucket
95-
# lifecycle_rules = [{
96-
# action = {
97-
# type = "Delete"
98-
# }
99-
# condition = {
100-
# age = 90 # 90d
101-
# with_state = "ANY"
102-
# }
103-
# }]
93+
lifecycle_rules = [{
94+
action = {
95+
type = "Delete"
96+
}
97+
condition = {
98+
age = 90 # 90d
99+
with_state = "ANY"
100+
}
101+
}]
104102

105103
iam_members = [
106104
{

infra/gcp/terraform/k8s-infra-prow/iam.tf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,38 @@ resource "google_pubsub_topic_iam_binding" "read_binding" {
138138
"serviceAccount:[email protected]",
139139
]
140140
}
141+
142+
# https://cloud.google.com/iam/docs/workload-identity-federation-with-kubernetes#kubernetes
143+
# This is a community owned K8s Cluster inside IBM Cloud, have a look at the infra/ibm/terraform folder for more details
144+
resource "google_iam_workload_identity_pool" "ibm_clusters" {
145+
project = module.project.project_id
146+
workload_identity_pool_id = "ibm-clusters"
147+
}
148+
149+
data "http" "ppc64le_issuer" {
150+
url = "https://73725434-jp-osa.lb.appdomain.cloud:6443/.well-known/openid-configuration"
151+
insecure = true
152+
}
153+
154+
data "http" "ppc64le_jwks" {
155+
url = "https://73725434-jp-osa.lb.appdomain.cloud:6443/openid/v1/jwks"
156+
insecure = true
157+
}
158+
159+
resource "google_iam_workload_identity_pool_provider" "ppc64le" {
160+
workload_identity_pool_id = google_iam_workload_identity_pool.ibm_clusters.workload_identity_pool_id
161+
project = module.project.project_id
162+
workload_identity_pool_provider_id = "ppc64le"
163+
164+
attribute_mapping = {
165+
"google.subject" = "\"ns/\" + assertion['kubernetes.io']['namespace'] + \"/sa/\" + assertion['kubernetes.io']['serviceaccount']['name']"
166+
"attribute.namespace" = "assertion['kubernetes.io']['namespace']"
167+
"attribute.service_account_name" = "assertion['kubernetes.io']['serviceaccount']['name']"
168+
"attribute.pod" = "assertion['kubernetes.io']['pod']['name']"
169+
}
170+
oidc {
171+
allowed_audiences = ["sts.googleapis.com"]
172+
issuer_uri = jsondecode(data.http.ppc64le_issuer.response_body)["issuer"]
173+
jwks_json = data.http.ppc64le_jwks.response_body
174+
}
175+
}

infra/gcp/terraform/k8s-infra-prow/provider.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ terraform {
2525
required_providers {
2626
google = {
2727
source = "hashicorp/google"
28-
version = "~> 5.25.0"
28+
version = "~> 5.45.2"
2929
}
3030
google-beta = {
3131
source = "hashicorp/google-beta"
32-
version = "~> 5.25.0"
32+
version = "~> 5.45.2"
3333
}
3434
}
3535
}

infra/gcp/terraform/k8s-infra-prow/vpc.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
module "vpc" {
1818
source = "terraform-google-modules/network/google"
19-
version = "~> 9"
19+
version = "~> 9.3"
2020

2121
project_id = module.project.project_id
2222
network_name = "prow"

0 commit comments

Comments
 (0)