The AtlasBackupSchedule custom resource configures a backup
schedule that you can apply to your
AtlasDeployment Custom Resource. When you
create the AtlasBackupSchedule custom
resource, Atlas Kubernetes Operator tries to create or update a backup schedule.
Important
Custom Resources No Longer Delete Objects by Default
Atlas Kubernetes Operator uses custom resource configuration files to manage your Atlas configuration, but as of Atlas Kubernetes Operator 2.0, custom resources you delete in Kubernetes are no longer (by default) deleted in Atlas. Instead, Atlas Kubernetes Operator simply stops managing those resources in Atlas. For example, if you delete an
AtlasProjectCustom Resource in Kubernetes, by default the Atlas Kubernetes Operator no longer automatically deletes the corresponding project from Atlas. This change in behavior is intended to help prevent accidental or unexpected deletions. To learn more, including how to revert this behavior to the default used prior to Atlas Kubernetes Operator 2.0, see New Default: Deletion Protection in Atlas Kubernetes Operator 2.0.Similarly, Atlas Kubernetes Operator does not delete teams from Atlas if you remove them from an Atlas project in Kubernetes with the Atlas Kubernetes Operator.
Explicitly define your desired configuration details in order to avoid implicitly using default Atlas configuration values. In some cases, inheriting Atlas defaults may result in a reconciliation loop which can prevent your custom resource from achieving a
READYstate. For example, explicitly defining your desired autoscaling behavior in yourAtlasDeploymentcustom resource, as shown in the included example, ensures that a static instance size in your custom resource is not being repeatedly applied to an Atlas deployment which has autoscaling enabled.autoScaling: diskGB: enabled: true compute: enabled: true scaleDownEnabled: true minInstanceSize: M30 maxInstanceSize: M40
Atlas Kubernetes Operator does one of the following actions using the Atlas Cloud Backup Schedule API Resource:
Creates a new backup schedule.
Updates an existing backup schedule.
If you remove the AtlasBackupSchedule resource from your Kubernetes
cluster, Atlas stops creating backups for your cluster.
Note
You must do all of the following to back up a cluster:
Create a backup policy
Create a backup schedule and set the spec.policy.name field to the name of the configured backup policy.
Set the spec.backupRef.name field in the
AtlasDeploymentCustom Resource to the name of the configured backup schedule.
To learn more, see Back Up Your Atlas Cluster.
You can specify one backup schedule per cluster, but you can use the same backup schedule for multiple clusters.
Example
The following example shows an AtlasBackupSchedule custom resource
configured to take snapshots at 10:10 UTC and restore up to two days:
apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupSchedule metadata: name: atlas-default-backupschedule spec: autoExportEnabled: true copySettings: - cloudProvider: AWS frequencies: - HOURLY regionName: US_EAST_1 shouldCopyOplogs: true referenceHourOfDay: 10 referenceMinuteOfHour: 10 restoreWindowDays: 2 policy: name: atlas-default-backuppolicy namespace: mongodb-atlas-system
Parameters
AtlasBackupSchedule
AtlasBackupSchedule is the Schema for the atlasbackupschedules API.
Name | Type | Description | Required |
|---|---|---|---|
| string | atlas.mongodb.com/v1 | true |
| string |
| true |
| object | Refer to the Kubernetes | true |
| object |
| false |
| object |
| false |
AtlasBackupSchedule.spec
AtlasBackupScheduleSpec defines the target state of AtlasBackupSchedule.
Name | Type | Description | Required |
|---|---|---|---|
| object | A reference (name & namespace) for backup | true |
| boolean | Specify true to enable automatic export of cloud backup snapshots to the | false |
| []object | Copy backups to other regions for increased resiliency and faster restores. | false |
| object | Export policy for automatically exporting cloud backup snapshots to | false |
| integer |
| false |
| integer |
| false |
| integer | Number of days back in time you can restore to with Continuous Cloud Backup accuracy. Must be a positive, non-zero integer. Applies to continuous cloud backups only. Format: int64 Default: 1 | false |
| boolean | Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously. | false |
| boolean | Specify true to use organization and project names instead of organization and project UUIDs in the path for the metadata files that Atlas uploads to your | false |
AtlasBackupSchedule.spec.policy
A reference (name & namespace) for backup policy in the desired updated backup policy.
Name | Type | Description | Required |
|---|---|---|---|
| string | Name of the Kubernetes Resource | true |
| string | Namespace of the Kubernetes Resource | false |
AtlasBackupSchedule.spec.copySettings
Name | Type | Description | Required |
|---|---|---|---|
| enum | Identifies the cloud provider that stores the snapshot copy.
Enum: | false |
| []string | List that describes which types of snapshots to copy. | false |
| string | Target region to copy snapshots belonging to | false |
| boolean | Flag that indicates whether to copy the oplogs to the target region. | false |
AtlasBackupSchedule.spec.export
Export policy for automatically exporting cloud backup snapshots to AWS bucket.
Name | Type | Description | Required |
|---|---|---|---|
| string | Unique Atlas identifier of the | true |
| enum | Human-readable label that indicates the rate at which the export policy item occurs. Enum: monthly Default: monthly | true |
AtlasBackupSchedule.status
BackupScheduleStatus defines the observed state of AtlasBackupSchedule.
Name | Type | Description | Required |
|---|---|---|---|
| []object | Conditions is the list of statuses showing the current state of the Atlas Custom Resource | true |
| []string | List of the human-readable names of all deployments utilizing this backup schedule. | false |
| integer |
| false |
AtlasBackupSchedule.status.conditions
Condition describes the state of an Atlas Custom Resource at a certain point.
Name | Type | Description | Required |
|---|---|---|---|
| string | Status of the condition; one of True, False, Unknown. | true |
| string | Type of Atlas Custom Resource condition. | true |
| string | Last time the condition transitioned from one status to another.
Represented in | false |
| string | A | false |
| string | The | false |