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

Update svc_acct.md #3730

Merged
merged 1 commit into from
May 2, 2024
Merged
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
7 changes: 6 additions & 1 deletion content/en/v3/admin/platforms/google/svc_acct.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ This doc will demonstrate how to set up a Google service account that can be use

### Service account privileges
In order to build your GKE environment with Terraform using a service account, the following are the service accounts minimal role requirements:
* roles/artifactregistry.admin
* roles/container.admin
* roles/editor
* roles/iam.serviceAccountAdmin
* roles/iam.serviceAccountKeyAdmin
* roles/resourcemanager.projectIamAdmin
* roles/storage.admin
> 💡 Existing service accounts (MY_GCP_SA) under your project (MYPROJECT) requiring `roles/artifactory.admin` use command:
> `gcloud projects add-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/artifactregistry.admin`

If the service account needs to access a separate project to manage an apex domain then an additional role setting is required for the separate project.
* roles/dns.admin
Expand All @@ -41,7 +44,8 @@ With an IAM Name defined, create the service account and assign the roles:
``` bash
MYPROJECT=`gcloud config get-value project`
MY_GCP_SA=${IAMNAME}@${MYPROJECT}.iam.gserviceaccount.com
gcloud iam service-accounts create ${IAMNAME} --description "My SA" --display-name "${IAMNAME}" --project ${MYPROJECT}
gcloud iam service-accounts create ${IAMNAME} --description "My SA" --display-name "${IAMNAME}" --project ${MYPROJECT}
gcloud projects add-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/artifactregistry.admin
gcloud projects add-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/container.admin
gcloud projects add-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/storage.admin
gcloud projects add-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/editor
Expand Down Expand Up @@ -78,6 +82,7 @@ gcloud auth activate-service-account ${MY_GCP_SA} --key-file ~/${IAMNAME}_key.${
### Clean up
The following Google CLI commands will remove the roles and service account.
``` bash
gcloud projects remove-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/artifactregistry.admin
gcloud projects remove-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/container.admin
gcloud projects remove-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/storage.admin
gcloud projects remove-iam-policy-binding ${MYPROJECT} --member serviceAccount:${MY_GCP_SA} --role roles/editor
Expand Down