Skip to content

Commit d38bac0

Browse files
committed
Add GCS bucket for external TestGrid configurations
Add a GCS bucket so we can migrate testgrid dashboards from Google to the Kubernetes infrastructure Ref: - #8973 Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
1 parent f76d571 commit d38bac0

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

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

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ module "gcb_bucket" {
4646

4747
// Create gs://k8s-testgrid-config to store K8s TestGrid config.
4848
module "testgrid_config_bucket" {
49-
source = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
50-
version = "~> 5"
49+
source = "github.com/terraform-google-modules/terraform-google-cloud-storage//modules/simple_bucket?ref=v11.1.2"
5150

5251
name = "k8s-testgrid-config"
5352
project_id = module.project.project_id
@@ -82,6 +81,36 @@ module "testgrid_config_bucket" {
8281
]
8382
}
8483

84+
// Create gs://k8s-testgrid-config-external to store TestGrid configs.
85+
// - testgrid.prow.k8s.io (community-operated, K8s project configs only)
86+
// See: https://github.com/kubernetes/k8s.io/issues/8973
87+
module "testgrid_config_external_bucket" {
88+
source = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
89+
version = "~> 5"
90+
91+
name = "k8s-testgrid-config-external"
92+
project_id = module.project.project_id
93+
location = "us-central1"
94+
95+
iam_members = [
96+
{
97+
// Let the upload job write to this bucket.
98+
role = "roles/storage.objectAdmin"
99+
member = "serviceAccount:k8s-testgrid-config-updater@k8s-infra-prow-build-trusted.iam.gserviceaccount.com"
100+
},
101+
{
102+
// Let K8s TestGrid canary read configs from this bucket.
103+
role = "roles/storage.objectViewer"
104+
member = "serviceAccount:testgrid-canary@k8s-testgrid.iam.gserviceaccount.com"
105+
},
106+
{
107+
// Let K8s TestGrid production read configs from this bucket.
108+
role = "roles/storage.objectViewer"
109+
member = "serviceAccount:updater@k8s-testgrid.iam.gserviceaccount.com"
110+
}
111+
]
112+
}
113+
85114
// Create gs://k8s-ci-logs to store logs from Prow jobs.
86115
module "prow_bucket" {
87116
source = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"

0 commit comments

Comments
 (0)