MongoDB.local SF, Jan 15: See the speaker lineup & ship your AI vision faster. Use WEB50 to save 50%
Find out more >
Docs Menu
Docs Home
/ /
/ / /

AtlasBackupSchedule Custom Resource

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 AtlasProject Custom 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 READY state. For example, explicitly defining your desired autoscaling behavior in your AtlasDeployment custom 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:

  1. Create a backup policy

  2. Create a backup schedule and set the spec.policy.name field to the name of the configured backup policy.

  3. Set the spec.backupRef.name field in the AtlasDeployment Custom 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.

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

AtlasBackupSchedule is the Schema for the atlasbackupschedules API.

Name
Type
Description
Required

apiVersion

string

atlas.mongodb.com/v1

true

kind

string

AtlasBackupSchedule

true

metadata

object

Refer to the Kubernetes API documentation for the fields of the metadata field.

true

spec

object

AtlasBackupScheduleSpec defines the target state of AtlasBackupSchedule.

false

status

object

BackupScheduleStatus defines the observed state of AtlasBackupSchedule.

false

AtlasBackupScheduleSpec defines the target state of AtlasBackupSchedule.

Name
Type
Description
Required

policy

object

A reference (name & namespace) for backup policy in the desired updated backup policy.

true

autoExportEnabled

boolean

Specify true to enable automatic export of cloud backup snapshots to the AWS bucket. You must also define the export policy using export. If omitted, defaults to false. Default: false

false

copySettings

[]object

Copy backups to other regions for increased resiliency and faster restores.

false

export

object

Export policy for automatically exporting cloud backup snapshots to AWS bucket.

false

referenceHourOfDay

integer

UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items Format: int64 Minimum: 0 Maximum: 23

false

referenceMinuteOfHour

integer

UTC Minutes after ReferenceHourOfDay that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive. Format: int64 Minimum: 0 Maximum: 59

false

restoreWindowDays

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

updateSnapshots

boolean

Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.

false

useOrgAndGroupNamesInExportPrefix

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 S3 bucket after it finishes exporting the snapshots

false

A reference (name & namespace) for backup policy in the desired updated backup policy.

Name
Type
Description
Required

name

string

Name of the Kubernetes Resource

true

namespace

string

Namespace of the Kubernetes Resource

false

Name
Type
Description
Required

cloudProvider

enum

Identifies the cloud provider that stores the snapshot copy. Enum: AWS, GCP, AZURE Default: AWS

false

frequencies

[]string

List that describes which types of snapshots to copy.

false

regionName

string

Target region to copy snapshots belonging to replicationSpecId to.

false

shouldCopyOplogs

boolean

Flag that indicates whether to copy the oplogs to the target region.

false

Export policy for automatically exporting cloud backup snapshots to AWS bucket.

Name
Type
Description
Required

exportBucketId

string

Unique Atlas identifier of the AWS bucket which was granted access to export backup snapshot.

true

frequencyType

enum

Human-readable label that indicates the rate at which the export policy item occurs. Enum: monthly Default: monthly

true

BackupScheduleStatus defines the observed state of AtlasBackupSchedule.

Name
Type
Description
Required

conditions

[]object

Conditions is the list of statuses showing the current state of the Atlas Custom Resource

true

deploymentID

[]string

List of the human-readable names of all deployments utilizing this backup schedule.

false

observedGeneration

integer

ObservedGeneration indicates the generation of the resource specification of which the Atlas Operator is aware. The Atlas Operator updates this field to the value of 'metadata.generation' as soon as it starts reconciliation of the resource. Format: int64

false

Condition describes the state of an Atlas Custom Resource at a certain point.

Name
Type
Description
Required

status

string

Status of the condition; one of True, False, Unknown.

true

type

string

Type of Atlas Custom Resource condition.

true

lastTransitionTime

string

Last time the condition transitioned from one status to another. Represented in ISO 8601 format. Format: date-time

false

message

string

A message providing details about the transition.

false

reason

string

The reason for the condition's last transition.

false

Back

AtlasBackupPolicy

On this page