Creating Scheduled Automatic NFS Volume Backups in Google Cloud ​
WARNING
This is a beta feature available only per request for SAP-internal teams.
WARNING
Long-running or frequent schedules can create too many backups and may result in cloud provider quota issues. For more information on how to avoid such issues, see Scheduling Best Practices.
This tutorial explains how to create scheduled automatic backups for Network File System (NFS) volumes in Google Cloud.
Prerequisites ​
- You have the Cloud Manager module added.
- You have created a GcpNfsVolume. See Use Network File System in Google Cloud.
NOTE
All the examples below assume that the GcpNfsVolume is named my-vol and is in the same namespace as the GcpNfsBackupSchedule resource.
Steps ​
Export the namespace as an environment variable. Run:
shellexport NAMESPACE={NAMESPACE_NAME}Create a GcpNfsBackupSchedule resource.
shellcat <<EOF | kubectl -n $NAMESPACE apply -f - apiVersion: cloud-resources.kyma-project.io/v1beta1 kind: GcpNfsBackupSchedule metadata: name: my-backup-schedule spec: nfsVolumeRef: name: my-vol schedule: "0 * * * *" prefix: my-hourly-backup maxRetentionDays: 30 maxReadyBackups: 100 deleteCascade: true EOFWait for the GcpNfsVolumeBackup to be in the
Activestate.shellkubectl -n $NAMESPACE wait --for=jsonpath='{.status.state}'=Active gcpnfsbackupschedule/my-backup-schedule --timeout=300sOnce the GcpNfsVolumeBackup is created, you should see the following message:
consolegcpnfsbackupschedule.cloud-resources.kyma-project.io/my-backup-schedule condition metObserve the nextRunTimes for creating the backups.
shellkubectl -n $NAMESPACE get gcpnfsbackupschedule my-backup-schedule -o jsonpath='{.status.nextRunTimes}{"\n"}'Wait till the time specified in the nextRunTimes (in the previous step) and see that the GcpNfsVolumeBackup objects get created.
shellkubectl -n $NAMESPACE get gcpnfsvolumebackup -l cloud-resources.kyma-project.io/scheduleName=my-backup-schedule
Next Steps ​
To clean up, remove the created schedule and the backups:
kubectl delete -n $NAMESPACE gcpnfsbackupschedule my-backup-schedule