Creating Scheduled Automatic NFS Volume Backups in Amazon Web Services ​
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 Amazon Web Services (AWS).
Prerequisites ​
- You have the Cloud Manager module added.
- You have created an AwsNfsVolume. See Use Network File System in Amazon Web Services.
NOTE
All the examples below assume that the AwsNfsVolume is named my-vol and is in the same namespace as the AwsNfsBackupSchedule resource.
Steps ​
Export the namespace as an environment variable. Run:
shellexport NAMESPACE={NAMESPACE_NAME}Create an AwsNfsBackupSchedule resource.
shellcat <<EOF | kubectl -n $NAMESPACE apply -f - apiVersion: cloud-resources.kyma-project.io/v1beta1 kind: AwsNfsBackupSchedule 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 AwsNfsVolumeBackup to be in the
Activestate.shellkubectl -n $NAMESPACE wait --for=jsonpath='{.status.state}'=Active awsnfsbackupschedule/my-backup-schedule --timeout=300sOnce the AwsNfsVolumeBackup is created, you should see the following message:
consoleawsnfsbackupschedule.cloud-resources.kyma-project.io/my-backup-schedule condition metObserve the nextRunTimes for creating the backups.
shellkubectl -n $NAMESPACE get awsnfsbackupschedule my-backup-schedule -o jsonpath='{.status.nextRunTimes}{"\n"}'Wait till the time specified in the nextRunTimes (in the previous step) passes and see that the AwsNfsVolumeBackup objects get created.
shellkubectl -n $NAMESPACE get awsnfsvolumebackup -l cloud-resources.kyma-project.io/scheduleName=my-backup-schedule
Next Steps ​
To clean up, follow these steps:
Export the namespace as an environment variable. Run:
shellexport NAMESPACE={NAMESPACE_NAME}Remove the created schedule and the backups:
shellkubectl delete -n $NAMESPACE awsnfsbackupschedule my-backup-schedule