注意
此功能不适用于以下任何部署:
M0集群M2/M5集群Flex 集群
注意
Atlas已弃用 M2 和 M5 集群以及无服务器实例。截至 20251 月, Atlas已将所有 M2 和 M5 集群迁移到 Flex 集群。对于无服务器实例, Atlas会根据使用情况决定将实例迁移到免费集群、Flex 集群还是专用集群,然后自动迁移所有无服务器实例。
自 1 月 222026 起,对 M2、M5 和无服务器实例的支持已结束。与这些已弃用的集群类型相关的 API 不再可用,只有针对 Flex 集群的 API 仍然存在。
自 20253 月起,不再支持无服务器实例上的私有端点。从Atlas Kubernetes Operator配置中删除所有 M2、M5 和无服务器实例功能。
If your workloads require Private Endpoints or Continuous Backup, switch to Atlas Dedicated Clusters. To learn more, see Migration to Flex Clusters and the Atlas Flex Migration Guide.
Atlas Kubernetes Operator supports cloud backup for your Atlas clusters. Cloud backup uses the native snapshot capabilities of your cloud provider to support full-copy snapshots and localized snapshot storage.
要使用 Atlas Kubernetes Operator 托管云备份,您可以指定和更新以下自定义资源:
自定义资源 | 用途 |
|---|---|
定义备份策略,包括备份频率和快照保留时长。 | |
定义备份安排,包括 Atlas 备份数据库部署的时间、可以恢复的时间倒回天数以及备份策略。 | |
定义集群的特征。必须将backupRef.name字段设立为已配置备份安排的名称,才能为集群启用云备份。 此外,要配置连续备份,您必须将 pitEnabled 设立为 |
每次更改任何支持的资源时,Atlas Kubernetes Operator都会创建或更新相应的 Atlas 配置。
Considerations
查看以下注意事项:
您可以为每个备份计划指定一个备份策略。
您可以为每个集群指定一个备份计划,但也可以为多个集群使用相同的备份计划。
Atlas determines the order of nodes to snapshot based on your cluster configuration. To learn more, see Cloud Backups.
Atlas Kubernetes Operator supports automatic snapshot distribution. You can configure this with the
spec.copySettingfield in theAtlasBackupScheduleCustom Resource.
注意
If you have a Backup Compliance Policy enabled, you can't modify the backup policy for an individual cluster below the minimum requirements set in the Backup Compliance Policy. You can modify the cluster-level backup policy at any time. Atlas augments any preexisting cluster-level policies to meet the minimum requirements of the Backup Compliance Policy. All new clusters use the Backup Compliance Policy. If you reduce the frequency of a backup schedule, the change applies only to future backups. Any existing oplog remains for the original window. The minimum requirements of the Backup Compliance Policy apply. You can configure extra snapshot retention. You can also view backup details for all M10+ dedicated clusters including deleted clusters with retained snapshots. To learn more, see View Backup Details for Dedicated Clusters.
限制
Certain limitations apply to cloud backup. To learn more, see Back Up Your Cluster.
先决条件
要为 Atlas Kubernetes Operator 托管的集群启用云备份,您必须:
拥有一个正在运行的 Kubernetes 集群,其中部署了 Atlas Kubernetes Operator。
确保您的IP解决位于组织的API访问权限列表中。
步骤
请按照以下步骤为 Atlas Kubernetes 操作符托管的集群启用云备份:
创建备份策略。
要了解有关备份策略参数的更多信息,请参阅AtlasBackupPolicy自定义资源。
示例:
cat <<EOF | kubectl apply -f - apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupPolicy metadata: name: "atlas-default-backuppolicy" spec: items: frequencyType: "weekly" frequencyInterval: 1 retentionUnit: "days" retentionValue: 7 EOF
创建备份安排。
在 spec.policy.name 字段中,指定 AtlasBackupPolicy 自定义资源中的 metadata.name 以应用备份策略。
要了解有关备份安排的其他参数的详情,请参阅AtlasBackupSchedule自定义资源。
示例:
cat <<EOF | kubectl apply -f - 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 EOF
将备份安排应用于集群。
在AtlasDeployment 自定义资源 的 spec.backupRef.name 字段中,指定metadata.name AtlasBackupSchedule自定义资源 中的 ,以将备份安排应用集群。
示例:
cat <<EOF | kubectl apply -f - apiVersion: atlas.mongodb.com/v1 kind: AtlasDeployment metadata: name: my-atlas-cluster spec: backupRef: name: atlas-default-backupschedule namespace: mongodb-atlas-system EOF