The AtlasBackupCompliancePolicy custom resource configures a Backup Compliance Policy that applies to the AtlasProject Custom Resource to protect your backup data. When you create the AtlasBackupCompliancePolicy custom resource, Atlas Kubernetes Operator tries to create or update a Backup Compliance Policy.
Atlas Kubernetes Operator does one of the following actions using the Atlas Backup Compliance Policy API Resource:
创建新的备份合规策略。
更新现有备份合规性策略。
重要
请参阅“禁止的操作和注意事项” 。 备份合规策略作为最低备份策略应用于项目中的所有集群。 备份合规策略可保护所有现有快照。 备份合规策略可防止任何用户(无论角色如何)在现有快照过期之前修改或删除它们。 对此备份合规性策略所做的更改仅应用于未来的快照。 如果启用备份合规策略,则备份合规策略会限制您降低备份存储成本的能力。 您无法通过调整保留或删除备份来降低备份存储成本。
例子
以下示例显示了一个BackupCompliancePolicy自定义资源。 要学习;了解详情,请参阅配置备份合规策略。
apiVersion: atlas.mongodb.com/v1 kind: AtlasBackupCompliancePolicy metadata: name: my-backup-compliance-policy namespace: mongodb-atlas-system spec: authorizedEmail: john.doe@example.com authorizedUserFirstName: John authorizedUserLastName: Doe copyProtectionEnabled: false encryptionAtRestEnabled: false onDemandPolicy: retentionUnit: weeks retentionValue: 3 overwriteBackupPolicies: false pointInTimeEnabled: true restoreWindowDays: 42 scheduledPolicyItems: - frequencyInterval: 2 frequencyType: daily retentionUnit: days retentionValue: 7
参数
本部分介绍一些可用的关键BackupCompliancePolicy自定义资源参数。 有关可用参数的完整列表,请参阅Atlas更新或启用备份合规性策略设置API 。 请参阅这些描述、可用示例和API文档,自定义您的规范。
spec.authorizedEmail类型:字符串
必需
授权证券或法定代表人的电子邮件解决。
重要
无效或不正确的电子邮件地址会阻止您修改或启用此备份合规性策略,直到您通过 MongoDB 支持予以更正。
spec.copyProtectionEnabled类型:布尔值
Optional
Flag that indicates whether to keep all snapshots when removing additional snapshot regions. This parameter defaults to
false.注意
You can prevent cluster users from deleting backups copied to other regions even if you change this parameter to
false. To learn more, see Copy Snapshots to Additional Regions.
spec.encryptionAtRestEnabled类型:布尔值
Optional
指示是否要求使用客户数密钥管理对所有集群进行静态加密的标志。 此参数默认为
false。注意
To enable this option, you must Enable Encryption at Rest for all current clusters. You can't enable this option on paused clusters that don't have Encryption at Rest enabled.
spec.onDemandPolicy.frequencyInterval类型:数字
必需
Number that indicates the desired frequency of the policy item specified by
spec.onDemandPolicy.frequencyType. A value of1specifies the first instance of the correspondingspec.onDemandPolicy.frequencyType.例子
在月度备份合规策略中,
1表示月度快照发生在该月的第一天。在每周备份合规策略中,
1表示每周快照发生在星期一。
此设置接受以下频率值:
每小时:
1、2、4、6、8和12。每日:
1。每周:
1到7,其中1为星期一,7为星期日。每月:
1到28和40,其中1是该月的第一天,40是该月的最后一天。
spec.onDemandPolicy.frequencyType类型:字符串
必需
string ,表示与策略项关联的频率。 接受的值为:
hourly、daily、weekly或monthly。注意
您不能在 onDemandPolicy 上指定多个
hourly和daily备份策略。
spec.onDemandPolicy.retentionUnit类型:字符串
必需
String that indicates the scope of the policy item. Together with
spec.onDemandPolicy.retentionValue, these settings define the length of time to retain snapshots. Accepted values are:days,weeks, ormonths.
spec.onDemandPolicy.retentionValue类型:字符串
必需
String that indicates the value to associate with
spec.onDemandPolicy.retentionUnit. Together withspec.onDemandPolicy.retentionUnit, these settings define the length of time to retain snapshots.
spec.overwriteBackupPolicies类型:布尔值
必需
标志,用于指示是否升级项目中的所有备份策略,而无论
AtlasBackupPolicy自定义资源中的指定内容如何。重要
如果您将此参数设立为
true, Atlas都会升级项目中的所有备份策略,无论AtlasBackupPolicy自定义资源中指定了什么内容。 Atlas覆盖AtlasBackupPolicy自定义资源,并将该自定义资源的状态更新为Ready: False。 您必须手动更新AtlasBackupPolicy自定义资源,以与备份合规策略保持一致。如果将此参数设立为
false,则如果现有备份策略不满足备份合规性策略,则创建备份合规性策略将失败。
spec.restoreWindowDays类型:数字
可选的
Number of days in the restore window for point in time restore. If you set
spec.pitEnabledtotrue, you must specify this parameter.重要
You can't configure a restore window that is longer than the Hourly Snapshot Retention Time. After you save this Backup Compliance Policy, you can't change this setting without MongoDB support. To change this setting, the security or legal representative specified for the Backup Compliance Policy must request support and complete an extensive verification process.
spec.scheduledPolicyItems.frequencyInterval类型:数字
必需
Number that indicates the desired frequency of the policy item specified by
spec.scheduledPolicyItems.frequencyType. A value of1specifies the first instance of the correspondingspec.scheduledPolicyItems.frequencyType.例子
在月度备份合规策略中,
1表示月度快照发生在该月的第一天。在每周备份合规策略中,
1表示每周快照发生在星期一。
此设置接受以下频率值:
每小时:
1、2、4、6、8和12。每日:
1。每周:
1到7,其中1为星期一,7为星期日。每月:
1到28和40,其中1是该月的第一天,40是该月的最后一天。
spec.scheduledPolicyItems.frequencyType类型:字符串
必需
string ,表示与策略项关联的频率。 接受的值为:
hourly、daily、weekly或monthly。注意
您不能指定多个
hourly和daily备份策略 ScheduledPolicyItems。
spec.scheduledPolicyItems.retentionUnit类型:字符串
必需
String that indicates the scope of the policy item. Together with
spec.scheduledPolicyItems.retentionValue, these settings define the length of time to retain snapshots. Accepted values are:days,weeks, ormonths.
spec.scheduledPolicyItems.retentionValue类型:字符串
必需
String that indicates the value to associate with
spec.scheduledPolicyItems.retentionUnit. Together withspec.scheduledPolicyItems.retentionUnit, these settings define the length of time to retain snapshots.