Skip to content
Merged
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
33 changes: 31 additions & 2 deletions infra/gcp/terraform/k8s-infra-prow/buckets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ module "gcb_bucket" {

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

name = "k8s-testgrid-config"
project_id = module.project.project_id
Expand Down Expand Up @@ -82,6 +81,36 @@ module "testgrid_config_bucket" {
]
}

// Create gs://k8s-testgrid-config-external to store TestGrid configs.
// - testgrid.prow.k8s.io (community-operated, K8s project configs only)
// See: https://github.com/kubernetes/k8s.io/issues/8973
module "testgrid_config_external_bucket" {
source = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
version = "~> 5"

name = "k8s-testgrid-config-external"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think it will be harder to get external projects to switch buckets initially than to switch buckets ourselves and eventually phase out the existing bucket, unless I'm missing something?

naming here suggests this bucket would be for other projects?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I just came up with something to not conflict with the current setup. I'm happy to change it for a better suggestion.

project_id = module.project.project_id
location = "us-central1"

iam_members = [
{
// Let the upload job write to this bucket.
role = "roles/storage.objectAdmin"
member = "serviceAccount:k8s-testgrid-config-updater@k8s-infra-prow-build-trusted.iam.gserviceaccount.com"
},
{
// Let K8s TestGrid canary read configs from this bucket.
role = "roles/storage.objectViewer"
member = "serviceAccount:[email protected]"
},
{
// Let K8s TestGrid production read configs from this bucket.
role = "roles/storage.objectViewer"
member = "serviceAccount:[email protected]"
}
]
}

// Create gs://k8s-ci-logs to store logs from Prow jobs.
module "prow_bucket" {
source = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
Expand Down