-
Notifications
You must be signed in to change notification settings - Fork 852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate k8s-triage, k8s-metrics to terraform, setup k8s-triage dataset #2461
Conversation
Ran |
this is a trial in using IAM to control access to dataset resources instead of the legacy access roles based off of https://cloud.google.com/bigquery/docs/access-control-basic-roles
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: spiffxp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @ameukam |
This file defines: | ||
- bigquery dataset for triage to store temp results | ||
- GCS bucket to serve go.k8s.io/triage results | ||
- IAM bindings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-pasta comments need updating
I also think we need to put boilerplate license in our tf files...
Out of excessive paranoia I'm backing up the buckets first:
|
/lgtm |
The buckets were created as STANDARD storage class in US, so let's not delete them unless we really need to. The bigquery dataset can't have `-` in its title The bigquery iam policy binding needs to include project in its fields, apparently it won't default to the project the dataset is in
In terms of manual stuff I had to do to get this to work, this was basically it...
The rest was It's maybe worth noting that after my first successful
|
/hold cancel |
Some manual cleanup...
|
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spotted 2 typos. Nothing serious!
resource "google_bigquery_dataset" "triage_dataset" { | ||
dataset_id = "k8s_triage" | ||
project = data.google_project.project.project_id | ||
description = "Dataset for kubernetes/test-infra/triage to store temprorary results" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post-merge nit:
description = "Dataset for kubernetes/test-infra/triage to store temprorary results" | |
description = "Dataset for kubernetes/test-infra/triage to store temporary results" |
] | ||
role = "roles/storage.admin" | ||
} | ||
// Preserve legacy storage bindings, give storage.admim members legacy bucket owner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post-merge nit:
// Preserve legacy storage bindings, give storage.admim members legacy bucket owner | |
// Preserve legacy storage bindings, give storage.admin members legacy bucket owner |
This broke https://testgrid.k8s.io/wg-k8s-infra-prow#metrics-bigquery #2548 should address |
Related:
Since converting go.k8s.io/triage to triage.k8s.io is going to be more involved than I thought, setup to migrate gs://k8s-gubernator/triage to gs://k8s-triage. The bucket is currently populated with whatever it contained a while ago (which is basically as fresh as it's going to get since kettle has been down this whole time)
The dependency test-infra PR sets up a job that runs in k8s-infra-prow-build-trusted to update gs://k8s-triage
While I initially did all the provisioning for this via ensure-main-project.sh, I have since updated the PR to do all of this via terraform. I migrated all of the setup code for gs://k8s-metrics while doing so.
This also adds a bigquery dataset
kubernetes-public:k8s-triage
for the ci-test-infra-triage-canary job to be able to write to. A future test-infra PR will configure the job to write to it instead of currently failing to write tok8s-gubernator:temp.triage
In setting up the dataset, I'm trying out use of IAM roles instead of basic access (ref: https://cloud.google.com/bigquery/docs/access-control-basic-roles)