Skip to content

Commit

Permalink
fix: Add more APIs and role binding to the prerequisite #678 (#679)
Browse files Browse the repository at this point in the history
* Adding more APIs and role binding to the prerequisite #678

* Adding more rolebinding to existing PR

---------

Co-authored-by: Nim Jayawardena <[email protected]>
  • Loading branch information
shedyb and NimJay authored Jul 24, 2024
1 parent a1ffecf commit 639ac4b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions anthos-bm-gcp-bash/install_admin_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ gcloud services enable \
cloudresourcemanager.googleapis.com \
connectgateway.googleapis.com \
container.googleapis.com \
compute.googleapis.com \
gkeconnect.googleapis.com \
gkehub.googleapis.com \
gkeonprem.googleapis.com \
serviceusage.googleapis.com \
stackdriver.googleapis.com \
monitoring.googleapis.com \
logging.googleapis.com \
kubernetesmetadata.googleapis.com \
iam.googleapis.com \
opsconfigmonitoring.googleapis.com
# [END anthos_bm_gcp_bash_admin_enable_api]
printf "✅ Successfully enabled GCP Service APIs.\n\n"
Expand Down Expand Up @@ -156,6 +159,22 @@ gcloud projects add-iam-policy-binding "$PROJECT_ID" \
--member="serviceAccount:baremetal-gcr@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/opsconfigmonitoring.resourceMetadata.writer" \
--no-user-output-enabled

gcloud projects add-iam-policy-binding "$PROJECT_ID" \
--member="serviceAccount:baremetal-gcr@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/kubernetesmetadata.publisher" \
--no-user-output-enabled

gcloud projects add-iam-policy-binding "$PROJECT_ID" \
--member="serviceAccount:baremetal-gcr@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/monitoring.viewer" \
--no-user-output-enabled

gcloud projects add-iam-policy-binding "$PROJECT_ID" \
--member="serviceAccount:baremetal-gcr@$PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/serviceusage.serviceUsageViewer" \
--no-user-output-enabled

# [END anthos_bm_gcp_bash_admin_add_iam_role]
printf "✅ Successfully added the requires IAM roles to the Service Account.\n\n"

Expand Down

0 comments on commit 639ac4b

Please sign in to comment.