Last active
October 6, 2022 18:44
-
-
Save misskecupbung/e6977478352f81037e8b22b7ff01d280 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud iam service-accounts create velero-backup-anandadwi --display-name "Velero SA" | |
SERVICE_ACCOUNT_EMAIL=$(gcloud iam service-accounts list --filter="displayName:Velero SA" --format 'value(email)') | |
gcloud iam service-accounts list | |
ROLE_PERMISSIONS=( | |
compute.disks.get | |
compute.disks.create | |
compute.disks.createSnapshot | |
compute.snapshots.get | |
compute.snapshots.create | |
compute.snapshots.useReadOnly | |
compute.snapshots.delete | |
compute.zones.get | |
) | |
gcloud iam roles create velero.server --project $PROJECT_ID --title "Velero SA" --permissions "$(IFS=","; echo "${ROLE_PERMISSIONS[*]}")" | |
gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:$SERVICE_ACCOUNT_EMAIL --role projects/$PROJECT_ID/roles/velero.server | |
gsutil iam ch serviceAccount:$SERVICE_ACCOUNT_EMAIL:objectAdmin gs://${BUCKET} | |
gcloud iam service-accounts keys create credentials-velero --iam-account $SERVICE_ACCOUNT_EMAIL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment