-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra/gcp: setup k8s-project-triage special-case
Same steps as were done for k8s-project-metrics: - add a gs://k8s-project-triage bucket to kubernetes-public - give the google.com triage SA write access to this bucket - add a k8s-triage SA - give it roles/bigquery.user in k8s-infra-prow-build-trusted and kubernetes-public - give it write access to gs://k8s-project-triage While here, I removed the binding removal code for gs://k8s-metrics
- Loading branch information
Showing
3 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,14 @@ metadata: | |
iam.gke.io/gcp-service-account: [email protected] | ||
name: k8s-metrics | ||
namespace: test-pods | ||
--- | ||
kind: ServiceAccount | ||
apiVersion: v1 | ||
metadata: | ||
annotations: | ||
iam.gke.io/gcp-service-account: [email protected] | ||
name: k8s-triage | ||
namespace: test-pods | ||
|
||
# Infrastructure management service accounts | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -410,6 +410,29 @@ function ensure_prow_special_cases { | |
local owners="[email protected]" | ||
local old_service_account="[email protected]" | ||
|
||
ensure_public_gcs_bucket "${project}" "${bucket}" | ||
ensure_gcs_bucket_auto_deletion "${bucket}" "365" # match gs://k8s-metrics | ||
# GCS admins can admin all GCS buckets | ||
empower_gcs_admins "${project}" "${bucket}" | ||
# bucket owners can admin this bucket | ||
empower_group_to_admin_gcs_bucket "${owners}" "${bucket}" | ||
# k8s-infra-prow-build-trusted can write to this bucket | ||
principal="serviceAccount:$(svc_acct_email "k8s-infra-prow-build-trusted" "k8s-metrics")" | ||
ensure_gcs_role_binding "${bucket}" "${principal}" "objectAdmin" | ||
ensure_gcs_role_binding "${bucket}" "${principal}" "legacyBucketWriter" | ||
# TODO(spiffxp): this is a test to confirm we _can_ charge bigquery usage elsewhere | ||
# and might prove convenient since there are datasets in this project, | ||
# but this should probably not be the long-term home of usage billing | ||
# k8s-infra-prow-build-trusted can charge bigquery usage to this project | ||
ensure_project_role_binding "${project}" "${principal}" "roles/bigquery.user" | ||
) 2>&1 | indent | ||
|
||
color 6 "Special case: ensuring gs://k8s-project-triage exists" | ||
( | ||
local bucket="gs://k8s-project-triage" | ||
local owners="[email protected]" | ||
local old_service_account="[email protected]" | ||
|
||
ensure_public_gcs_bucket "${project}" "${bucket}" | ||
ensure_gcs_bucket_auto_deletion "${bucket}" "365" # match gs://k8s-metrics | ||
# GCS admins can admin all GCS buckets | ||
|
@@ -419,10 +442,10 @@ function ensure_prow_special_cases { | |
# TODO(spiffxp): remove once bindings have been removed | ||
# k8s-prow-builds can no longer write to this bucket | ||
principal="serviceAccount:${old_service_account}" | ||
ensure_removed_gcs_role_binding "${bucket}" "${principal}" "objectAdmin" | ||
ensure_removed_gcs_role_binding "${bucket}" "${principal}" "legacyBucketWriter" | ||
ensure_gcs_role_binding "${bucket}" "${principal}" "objectAdmin" | ||
ensure_gcs_role_binding "${bucket}" "${principal}" "legacyBucketWriter" | ||
# k8s-infra-prow-build-trusted can write to this bucket | ||
principal="serviceAccount:$(svc_acct_email "k8s-infra-prow-build-trusted" "k8s-metrics")" | ||
principal="serviceAccount:$(svc_acct_email "k8s-infra-prow-build-trusted" "k8s-triage")" | ||
ensure_gcs_role_binding "${bucket}" "${principal}" "objectAdmin" | ||
ensure_gcs_role_binding "${bucket}" "${principal}" "legacyBucketWriter" | ||
# TODO(spiffxp): this is a test to confirm we _can_ charge bigquery usage elsewhere | ||
|