Skip to content
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

infra/gcp: Add bucket for kOps #2678

Merged
merged 1 commit into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions groups/restrictions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ restrictions:
allowedGroups:
- "^[email protected]$"
- "^[email protected]$"
- "^[email protected]$"
- "^[email protected]$"
- "^[email protected]$"
- "^[email protected]$"
Expand Down
9 changes: 9 additions & 0 deletions groups/sig-cluster-lifecycle/groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ groups:
# and is not intended to govern access to infrastructure
#

- email-id: [email protected]
name: k8s-infra-kops-maintainers
description: |
ACL for kOps maintainers
settings:
ReconcileMembers: "true"
members:
- [email protected]

- email-id: [email protected]
name: sig-cluster-lifecycle-cluster-api-alerts
description: |-
Expand Down
54 changes: 54 additions & 0 deletions infra/gcp/terraform/kubernetes-public/prowjob-buckets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This file defines all GCS buckets that prow jobs write to
*/

locals {
kops_ci_bucket_name = "k8s-infra-kops-ci-results" // Name of the bucket for kops ci jobs results (version markers, binaries, etc...)
scalability_tests_logs_bucket_name = "k8s-infra-scalability-tests-logs" // Name of the bucket for the scalability test results
scalability_golang_builds_bucket_name = "k8s-infra-scale-golang-builds" // Name of the bucket for the scalability golang builds
}
Expand Down Expand Up @@ -137,3 +138,56 @@ resource "google_storage_bucket_iam_policy" "scalability_golang_builds_policy" {
bucket = google_storage_bucket.scalability_golang_builds.name
policy_data = data.google_iam_policy.scalability_golang_builds_bindings.policy_data
}

// Bucket for kops CI jobs results
resource "google_storage_bucket" "kops_ci_bucket" {
project = data.google_project.project.project_id
name = local.kops_ci_bucket_name

uniform_bucket_level_access = true
}

data "google_iam_policy" "kops_ci_bucket_bindings" {
// Ensure k8s-infra-kops-maintainers has admin privileges
binding {
members = [
"group:[email protected]",
]
role = "roles/storage.admin"
}
// Maintain legacy admins privilegies
binding {
members = [
"group:[email protected]",
"projectEditor:${data.google_project.project.project_id}",
"projectOwner:${data.google_project.project.project_id}",
]
role = "roles/storage.legacyBucketOwner"
}
binding {
members = [
"projectViewer:${data.google_project.project.project_id}",
]
role = "roles/storage.legacyBucketReader"
}
// Ensure prow-build serviceaccount can write to bucket
binding {
role = "roles/storage.objectAdmin"
members = [
"serviceAccount:[email protected]",
]
}
// Ensure bucket is world readable
binding {
role = "roles/storage.objectViewer"
members = [
"allUsers"
]
}
}

// Authoritative iam-policy: replaces any existing policy attached to the bucket
resource "google_storage_bucket_iam_policy" "kops_ci_bucket_bindings" {
bucket = google_storage_bucket.kops_ci_bucket.name
policy_data = data.google_iam_policy.kops_ci_bucket_bindings.policy_data
}