Skip to content

Commit

Permalink
Merge pull request #893 from bartsmykla/monitoring-svcacct
Browse files Browse the repository at this point in the history
Added k8s-infra-monitoring-viewer service account
  • Loading branch information
k8s-ci-robot authored May 26, 2020
2 parents a074558 + 45d4236 commit 5de3316
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions infra/gcp/ensure-main-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,28 @@ gcloud projects add-iam-policy-binding "${PROJECT}" \
--member "group:${DNS_GROUP}" \
--role roles/dns.admin

# Monitoring
MONITORING_SVCACCT_NAME="$(svc_acct_email "${PROJECT}" \
"k8s-infra-monitoring-viewer")"

color 6 "Ensuring the k8s-infra-monitoring-viewer serviceaccount exists"
ensure_service_account \
"${PROJECT}" \
"k8s-infra-monitoring-viewer" \
"k8s-infra monitoring viewer"

color 6 -n "Empowering k8s-infra-monitoring-viewer serviceaccount to be used on"
color 6 " the 'aaa' cluster inside the 'monitoring' namespace"
empower_ksa_to_svcacct \
"kubernetes-public.svc.id.goog[monitoring/k8s-infra-monitoring-viewer]" \
"${PROJECT}" \
"${MONITORING_SVCACCT_NAME}"

color 6 "Empowering service account ${MONITORING_SVCACCT_NAME}"
gcloud projects add-iam-policy-binding "${PROJECT}" \
--member "serviceAccount:${MONITORING_SVCACCT_NAME}" \
--role roles/monitoring.viewer

# Bootstrap DNS zones
ensure_dns_zone "${PROJECT}" "k8s-io" "k8s.io"
ensure_dns_zone "${PROJECT}" "kubernetes-io" "kubernetes.io"
Expand Down

0 comments on commit 5de3316

Please sign in to comment.