Fix GCP GKE Velero Backup Errors
When working with GCP GKE, you may encounter a configuration error that prevents your deployment from working. This guide explains the most common mistake with velero backup and shows the exact fix.
A Common Mistake
Trying to use Velero backup with GKE but not configuring the correct GCS bucket permissions, causing backup failures.
The incorrect command:
velero install --provider=gcp --plugins=velero/velero-plugin-for-gcp:v1.0 --bucket=my-backups --backup-location-config=region=us-central1
Error output:
Velero installed.
First backup:
velero backup create my-backup
Backup failed: error writing backup: googleapi: Error 403: The service account does not have permission to access the bucket. The Velero service account lacks storage.objectAdmin on the backup bucket.
The Correct Approach
The right way to configure velero backup in GCP GKE:
gsutil iam ch serviceAccount:velero-sa@my-project.iam.gserviceaccount.com:roles/storage.objectAdmin gs://my-backups && velero install --provider=gcp --plugins=velero/velero-plugin-for-gcp:v1.0 --bucket=my-backups --backup-location-config=region=us-central1 --sa-annotations=iam.gke.io/gcp-service-account=velero-sa@my-project.iam.gserviceaccount.com
Successful result:
Velero installed with correct permissions.
velero backup create my-backup
Backup completed successfully.
velero backup logs my-backup
No errors. Backup stored in gs://my-backups.
How to Prevent This
Grant the Velero SA roles/storage.objectAdmin on the backup bucket. Use Workload Identity to map KSA to GCP SA. Test backup with velero backup create test-backup --ttl=1h. Validate with velero restore create --from-backup=test-backup. Schedule recurring backups with velero schedule create.
FAQ
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro. Secure your cloud with DodaTech.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro