Skip to content

Commit

Permalink
Add a subscription to gs://kubernetes-ci-logs.
Browse files Browse the repository at this point in the history
There's an existing PubSub topic for GCS changes to
gs://kubernetes-ci-logs (in k8s-infra-prow). Attempt to add a new
subscription to this in kubernetes-public so Kettle can use updates from
the new logs bucket.

(Note: I don't have permissions to run terraform here, so I haven't
verified that these additions are valid.)
  • Loading branch information
michelle192837 committed Oct 4, 2024
1 parent 4ef41d1 commit 30b8ae3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions infra/gcp/terraform/kubernetes-public/k8s-kettle.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,26 @@ resource "google_pubsub_subscription_iam_binding" "subscription_binding" {
"serviceAccount:${module.aaa_kettle_sa.email}"
]
}

// Create a subscription in this project to the kubernetes-ci-logs-updates topic in k8s-infra-prow.
data "google_pubsub_topic" "kubernetes_ci_logs_topic" {
name = "kubernetes-ci-logs-updates"
project = "k8s-infra-prow"
}

resource "google_pubsub_subscription" "kettle_ci_logs_subscription" {
name = "k8s-infra-kettle"
topic = data.kubernetes_ci_logs_topic.name
project = data.google_project.project.project_id

filter = "attributes.eventType = \"OBJECT_FINALIZE\""
}

resource "google_pubsub_subscription_iam_binding" "ci_logs_subscription_binding" {
project = data.google_project.project.project_id
subscription = google_pubsub_subscription.kettle_ci_logs_subscription.name
role = "roles/pubsub.editor"
members = [
"serviceAccount:${module.aaa_kettle_sa.email}"
]
}

0 comments on commit 30b8ae3

Please sign in to comment.