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
velero backup create wp-backup --include-namespace wordpress | |
velero backup get | |
velero backup describe wp-backup |
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
velero install --provider gcp --plugins velero/velero-plugin-for-gcp:v1.5.0 --bucket velero-backup --secret-file ./credentials-velero --use-volume-snapshots=true |
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
wget -c https://github.com/vmware-tanzu/velero/releases/download/v1.9.2/<RELEASE-TARBALL-NAME>.tar.gz | |
tar -xvf <RELEASE-TARBALL-NAME>.tar.gz | |
sudo cp <RELEASE-TARBALL-NAME>/velero /usr/bin/ |
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 |
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
BUCKET=velero-backup-anandadwi | |
gsutil mb gs://$BUCKET/ | |
# verify | |
gsutil ls |
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
export RESTORE="manual-restore1" | |
gcloud alpha container backup-restore restores create $RESTORE \ | |
--project=$PROJECT_ID \ | |
--location=$GCP_REGION \ | |
--restore-plan=$RESTORE_PLAN \ | |
--backup=projects/$PROJECT_ID/locations/$LOCATION/backupPlans/$BACKUP_PLAN/backups/$BACKUP \ | |
--wait-for-completion |
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
export RESTORE_LOCATION="us-central1" | |
export RESTORE_PLAN="gke-central1-b-restore" | |
export CLUSTER2="projects/$PROJECT_ID/locations/$GCP_REGION/clusters/$CLUSTER_NAME2" | |
export CLUSTER_RESOURCE_CONFLICT_POLICY="use-backup-version" | |
export NAMESPACED_RESOURCE_RESTORE_MODE="delete-and-restore" | |
export VOLUME_DATA_RESTORE_POLICY="restore-volume-data-from-backup" |
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
export CLUSTER_NAME2="gke-central1-b" | |
gcloud beta container clusters create $CLUSTER_NAME2 \ | |
--project=$PROJECT_ID \ | |
--region=$LOCATION \ | |
--addons=BackupRestore \ | |
--num-nodes=1 \ | |
--enable-autoupgrade --no-enable-basic-auth \ | |
--no-issue-client-certificate --enable-ip-alias \ | |
--metadata disable-legacy-endpoints=true \ | |
--workload-pool=$IDNS |
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
export BACKUP=manual-backup1 | |
gcloud alpha container backup-restore backups create $BACKUP \ | |
--project=$PROJECT_ID \ | |
--location=$LOCATION \ | |
--backup-plan=$BACKUP_PLAN \ | |
--wait-for-completion |
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 alpha container backup-restore backup-plans create $BACKUP_PLAN \ | |
--project=$PROJECT_ID \ | |
--location=$LOCATION \ | |
--cluster=$CLUSTER \ | |
--all-namespaces \ | |
--include-secrets \ | |
--include-volume-data \ | |
--cron-schedule="0 * * * *" \ | |
--backup-retain-days=$RETAIN_DAYS \ | |
--locked |