forked from kyma-project/cloud-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: AwsNfsVolumeBackup and AwsNfsBackupSchedule CRs
- Loading branch information
1 parent
c2c130b
commit 88cb2cc
Showing
8 changed files
with
253 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# AwsNfsVolumeBackup Custom Resource | ||
|
||
The `awsnfsvolumebackup.cloud-resources.kyma-project.io` namespaced custom resource (CR) describes the AWS EFS Filesystem backup. | ||
While the AWS EFS Filesystem backup is created in the underlying cloud provider subscription, it needs its source AWS | ||
EFS Filesystem instance to be available. But upon its creation, it can be used independently of the source instance. | ||
|
||
For a given AWS EFS Filesystem, backups are incremental. This reduces latency on backup creation. | ||
To learn more, read [EFS Filesystem Backup Creation](https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html). | ||
|
||
## Specification <!-- {docsify-ignore} --> | ||
This table lists the parameters of the given resource together with their descriptions: | ||
|
||
**Spec:** | ||
|
||
| Parameter | Type | Description | | ||
|-----------------------------|---------------------|-------------------------------------------------------------------------------------------------------------------------------| | ||
| **source** | object | Required. Specifies the source of the backup. | | ||
| **source.volume** | object | Required. Reference of the existing source AwsNfsVolume that is backed up. | | ||
| **source.volume.name** | string | Required. Name of the source AwsNfsVolume. | | ||
| **source.volume.namespace** | string | Optional. Namespace of the source AwsNfsVolume. Defaults to the namespace of the AwsNfsVolumeBackup resource if not provided. | | ||
|
||
**Status:** | ||
|
||
| Parameter | Type | Description | | ||
|-----------------------------------|------------|-------------------------------------------------------------------------------------------------------------------------------------| | ||
| **state** | string | Signifies the current state of **CustomObject**. Its value can be either `Ready`, `Processing`, `Error`, `Warning`, or `Deleting`. | | ||
| **conditions** | \[\]object | Represents the current state of the CR's conditions. | | ||
| **conditions.lastTransitionTime** | string | Defines the date of the last condition status change. | | ||
| **conditions.message** | string | Provides more details about the condition status change. | | ||
| **conditions.reason** | string | Defines the reason for the condition status change. | | ||
| **conditions.status** (required) | string | Represents the status of the condition. The value is either `True`, `False`, or `Unknown`. | | ||
| **conditions.type** | string | Provides a short description of the condition. | | ||
|
||
|
||
## Sample Custom Resource <!-- {docsify-ignore} --> | ||
|
||
See an exemplary AwsNfsVolumeBackup custom resource: | ||
|
||
```yaml | ||
apiVersion: cloud-resources.kyma-project.io/v1beta1 | ||
kind: AwsNfsVolumeBackup | ||
metadata: | ||
name: my-backup | ||
spec: | ||
source: | ||
volume: | ||
name: my-vol | ||
location: us-west1 | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# AwsNfsBackupSchedule Custom Resource | ||
|
||
The `awsnfsbackupschedule.cloud-resources.kyma-project.io` custom resource (CR) represents the user-defined schedule for creating a backup | ||
of the `AwsNfsVolume` instances at regular intervals. The CR performs the following actions: | ||
- Creates the backups by creating the `awsnfsvolumebackup.cloud-resources.kyma-project.io` resources at the specified interval. | ||
- Enables you to specify days and times in the form of CRON expressions to automatically create the backups. | ||
- Automatically deletes the backups when the backup reaches the configured maximum retention days value. | ||
- Enables you to temporarily suspend or resume the backup creation/deletion. | ||
|
||
## Specification <!-- {docsify-ignore} --> | ||
This table lists the parameters of the given resource together with their descriptions: | ||
|
||
**Spec:** | ||
|
||
| Parameter | Type | Description | | ||
|-----------------------------|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| **nfsVolumeRef** | object | Required. AwsNfsVolume reference. | | ||
| **nfsVolumeRef.name** | string | Required. Name of the existing AwsNfsVolume. | | ||
| **nfsVolumeRef.namespace** | string | Optional. The namespace of the existing AwsNfsVolume. Defaults to the namespace of the AwsNfsBackupSchedule resource if not provided. | | ||
| **schedule** | string | Optional. CRON type expression for the schedule. When this value is empty or not specified, this schedule runs only once at the specified start time. See also [Schedule Syntax](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#schedule-syntax). | | ||
| **prefix** | string | Optional. Prefix for the name of the created `AwsNfsVolumeBackup` resources. Defaults to name of this schedule. | | ||
| **startTime** | metav1.Time | Optional. Start time for the schedule. Value cannot be from the past. When not specified, the schedule becomes effective immediately. | | ||
| **endTime** | metav1.Time | Optional. End time for the schedule. Value cannot be from the past or before the `startTime`. When not specified, the schedule runs indefinitely. | | ||
| **maxRetentionDays** | int | Optional. Maximum number of days to retain the backup resources. If not specified, the backups are retained indefinitely. If `deleteCascade` is `true` for this schedule, then all the backups will be deleted when the schedule is deleted irrespective of this configuration value. | | ||
| **suspend** | boolean | Optional. Specifies whether or not to suspend the schedule temporarily. Defaults to `false`. | | ||
| **deleteCascade** | boolean | Optional. Specifies whether to cascade delete the backup resources when this schedule is deleted. Defaults to `false`. | | ||
|
||
**Status:** | ||
|
||
| Parameter | Type | Description | | ||
|-----------------------------------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| **state** (required) | string | Signifies the current state of **CustomObject**. Contains one of the following states: `Processing`, `Pending`, `Suspended`, `Active`, `Done` or `Error`. | | ||
| **conditions** | \[\]object | Represents the current state of the CR's conditions. | | ||
| **conditions.lastTransitionTime** | string | Defines the date of the last condition status change. | | ||
| **conditions.message** | string | Provides more details about the condition status change. | | ||
| **conditions.reason** | string | Defines the reason for the condition status change. | | ||
| **conditions.status** (required) | string | Represents the status of the condition. The value is either `True`, `False`, or `Unknown`. | | ||
| **conditions.type** | string | Provides a short description of the condition. | | ||
| **nextRunTimes** | \[\]string | Provides the preview of the times when the next backups will be created. | | ||
| **nextDeleteTimes** | map\[string\]string | Provides the backup objects and their expected deletion time (calculated based on `maxRetentionDays`). | | ||
| **lastCreateRun** | string | Provides the time when the last backup was created. | | ||
| **lastCreatedBackup** | objectRef | Provides the object reference of the last created backup. | | ||
| **lastDeleteRun** | string | Provides the time when the last backup was deleted. | | ||
| **lastDeletedBackups** | \[\]objectRef | Provides the object references of the last deleted backups. | | ||
| **schedule** | string | Provides the cron expression of the current active schedule. | | ||
| **backupIndex** | int | Provides the current index of the backup created by this schedule. | | ||
| **backupCount** | int | Provides the the number of backups currently present in the system. | | ||
|
||
## Sample Custom Resource <!-- {docsify-ignore} --> | ||
|
||
See an example AwsNfsBackupSchedule custom resource: | ||
|
||
```yaml | ||
apiVersion: cloud-resources.kyma-project.io/v1beta1 | ||
kind: AwsNfsBackupSchedule | ||
metadata: | ||
name: aws-nfs-backup-schedule | ||
namespace: kyma-dev | ||
spec: | ||
nfsVolumeRef: | ||
name: aws-nfs-sample-01 | ||
namespace: kyma-dev | ||
schedule: "0 0 * * *" | ||
prefix: aws-nfs-daily-backup | ||
startTime: 2024-11-01T00:00:00Z | ||
endTime: 2025-12-31T00:00:00Z | ||
maxRetentionDays: 365 | ||
suspend: false | ||
deleteCascade: 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Backup RWX Volumes in AWS | ||
|
||
This tutorial explains how to create backups for ReadWriteMany (RWX) volumes in Google Cloud Platform (AWS). | ||
|
||
## Preparation <!-- {docsify-ignore} --> | ||
|
||
You have created a AwsNfsVolume. Follow [Use RWX Volumes in AWS](./01-20-aws-nfs-volume.md) to learn more. | ||
|
||
[!NOTE] | ||
All the examples below assume that the AwsNfsVolume is named `my-vol` and is in the same namespace as the AwsNfsVolumeBackup resource. | ||
|
||
## Steps <!-- {docsify-ignore} --> | ||
|
||
1. Export the namespace as an environment variable. Run: | ||
|
||
```shell | ||
export NAMESPACE={NAMESPACE_NAME} | ||
``` | ||
|
||
2. Create an AwsNfsVolumeBackup resource. | ||
|
||
```shell | ||
cat <<EOF | kubectl -n $NAMESPACE apply -f - | ||
apiVersion: cloud-resources.kyma-project.io/v1beta1 | ||
kind: AwsNfsVolumeBackup | ||
metadata: | ||
name: my-backup | ||
spec: | ||
source: | ||
volume: | ||
name: my-vol | ||
EOF | ||
``` | ||
3. Wait for the AwsNfsVolumeBackup to be in the `Ready` state. | ||
```shell | ||
kubectl -n $NAMESPACE wait --for=condition=Ready awsnfsvolumebackup/my-backup --timeout=300s | ||
``` | ||
Once the AwsNfsVolumeBackup is created, you should see the following message: | ||
``` | ||
awsnfsvolumebackup.cloud-resources.kyma-project.io/my-backup condition met | ||
``` | ||
4. Observe the location of the created backup. | ||
```shell | ||
kubectl -n $NAMESPACE get awsnfsvolumebackup my-backup -o jsonpath='{.status.location}{"\n"}' | ||
``` | ||
5. Clean up: | ||
* Remove the created awsnfsvolumebackup: | ||
```shell | ||
kubectl delete -n $NAMESPACE awsnfsvolumebackup my-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Create Scheduled Automatic RWX Volume Backups in Google Cloud | ||
|
||
This tutorial explains how to create scheduled automatic backups for ReadWriteMany (RWX) volumes in Google Cloud (AWS). | ||
|
||
## Prerequisites <!-- {docsify-ignore} --> | ||
|
||
* You have created a AwsNfsVolume. Follow [Use RWX Volumes in AWS](./01-20-aws-nfs-volume.md) to learn more. | ||
|
||
> [!NOTE] | ||
> All the examples below assume that the AwsNfsVolume is named `my-vol` and is in the same namespace as the AwsNfsBackupSchedule resource. | ||
## Steps <!-- {docsify-ignore} --> | ||
|
||
1. Export the namespace as an environment variable. Run: | ||
|
||
```shell | ||
export NAMESPACE={NAMESPACE_NAME} | ||
``` | ||
|
||
2. Create a AwsNfsBackupSchedule resource. | ||
|
||
```shell | ||
cat <<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 | ||
deleteCascade: true | ||
EOF | ||
``` | ||
3. Wait for the AwsNfsVolumeBackup to be in the `Active` state. | ||
```shell | ||
kubectl -n $NAMESPACE wait --for=jsonpath='{.status.state}'=Active awsnfsbackupschedule/my-backup-schedule --timeout=300s | ||
``` | ||
Once the AwsNfsVolumeBackup is created, you should see the following message: | ||
``` | ||
awsnfsbackupschedule.cloud-resources.kyma-project.io/my-backup-schedule condition met | ||
``` | ||
4. Observe the nextRunTimes for creating the backups. | ||
```shell | ||
kubectl -n $NAMESPACE get awsnfsbackupschedule my-backup-schedule -o jsonpath='{.status.nextRunTimes}{"\n"}' | ||
``` | ||
5. Wait till the time specified in the nextRunTimes (in the previous step) and see that the AwsNfsVolumeBackup objects get created. | ||
```shell | ||
kubectl -n $NAMESPACE get awsnfsvolumebackup -l cloud-resources.kyma-project.io/scheduleName=my-backup-schedule | ||
``` | ||
6. Clean up: | ||
* Remove the created schedule and the backups: | ||
```shell | ||
kubectl delete -n $NAMESPACE awsnfsbackupschedule my-backup-schedule | ||
``` |
Oops, something went wrong.