注意
此功能不适用于以下任何部署:
M0集群Flex 集群
注意
Atlas已弃用 M2 和 M5 集群以及无服务器实例。Atlas已将所有 M2 和 M5 集群迁移到 Flex 集群。对于无服务器实例,Atlas会根据您的使用情况将实例迁移到免费集群、Flex 集群或专用集群。
为了在一段时间内保持 API 的向后兼容性, Atlas将继续允许通过相同的 API(旧 API 和新 API)托管这些迁移的集群,包括在使用Atlas Kubernetes Operator时。 API 的向后兼容性将保持到 1 月 2026,届时旧的 API 将被删除,只有与 Flex 集群相关的 API 才会保留。
对无服务器实例上的私有端点的支持已于 2025 3 月结束。您必须在 3 月 2025 之前更新 Atlas Kubernetes Operator 配置,才能删除私有端点。您必须在1月2026之前从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 备份数据库部署的时间、可以恢复的时间倒回天数以及备份策略。 | |
定义集群的特征。 您必须将 此外,要配置连续备份,必须将 |
每次更改任何支持的资源时,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
将备份安排应用于集群。
spec.backupRef.nameAtlasDeployment在 资源 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