对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

AtlasProject 自定义资源

AtlasProject自定义资源在 Atlas 中配置项目。 当您创建AtlasProject资源时,Atlas Kubernetes Operator 会尝试在 Atlas 中创建新项目。

重要

自定义资源不再默认删除对象

  • 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.

    同样,如果您使用Atlas Kubernetes Operator从Kubernetes中的Atlas项目中删除团队,则Atlas Kubernetes Operator不会从Atlas中删除团队。

  • 显式定义所需的配置详细信息,以避免隐式使用默认Atlas配置值。 在某些情况下,继承Atlas默认值可能会导致协调循环,从而阻止自定义资源实现 READY 状态。 示例,在 AtlasDeployment 自定义资源中显式定义所需的自动伸缩行为(如所包含的示例所示)可确保自定义资源中的静态实例大小不会重复应用于已启用自动伸缩的Atlas部署。

    autoScaling:
    diskGB:
    enabled: true
    compute:
    enabled: true
    scaleDownEnabled: true
    minInstanceSize: M30
    maxInstanceSize: M40

Atlas Kubernetes Operator 执行以下操作之一:

  • 在连接密钥配置的组织中创建一个新项目。

  • 重复使用现有项目。 在这种情况下,Atlas Kubernetes Operator 会验证是否存在具有spec.name的项目。如果项目存在,Atlas Kubernetes Operator 会跳过创建过程。协调后,Atlas Kubernetes Operator 使用项目的 ID 更新status.id字段。

您可以使用 spec.connectionSecretRef.name 参数为AtlasProject 自定义资源设立连接密钥。此参数会覆盖默认的global 连接密钥。

默认下, Atlas Kubernetes Operator将连接密钥保存在与AtlasProject 自定义资源相同的命名空间中。要将密钥存储在其他命名空间中,请指定spec.connectionSecretRef.namespace 参数。

要连接到Atlas Administration API, Atlas Kubernetes Operator会从Atlas Kubernetes Operator密钥中读取组织ID和API密钥。

您还可以编辑AtlasProject自定义资源规范来配置以下选项:

如果您从 Kubernetes 集群中删除AtlasProject资源,Atlas Kubernetes Operator 将从 Atlas 中删除该项目。您必须事先删除项目中的所有集群。 否则,Atlas 会拒绝删除请求。

以下示例显示了AtlasProject自定义资源规范:

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test project
connectionSecretRef:
name: my-atlas-key
projectIpAccessList:
- cidrBlock: "203.0.113.0/24"
comment: "CIDR block for Application Server B - D"

以下示例显示了与 Prometheus 集成的AtlasProject自定义资源规范:

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: TestPrometheusIntegration
connectionSecretRef:
name: my-atlas-key
projectIpAccessList:
- cidrBlock: "0.0.0.0/1"
comment: "Everyone has access. For test purposes only."
- cidrBlock: "128.0.0.0/1"
comment: "Everyone has access. For test purposes only."
integrations:
- type: "PROMETHEUS"
enabled: "true"
username: "prometheus-user"
passwordRef:
name: "password-name"
namespace: "password-namespace"
scheme: "http"
serviceDiscovery: "http"

要了解更多信息,请参阅与第三方服务集成。

注意

Atlas Kubernetes Operator提供了一个示例Grafana仪表盘,您可以将其导入 Grafana 中。

The following example shows an AtlasProject custom resource specification that gives the green-leaf-team the Organization Owner role for this project. The team members are defined in the AtlasTeam custom resource.

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test project
teams:
- teamRef:
name: green-leaf-team
roles:
- ORGANIZATION_OWNER

要了解详情,请参阅配置团队。

以下示例显示了一个AtlasProject自定义资源规范,该规范将维护窗口设置为每周二上午 5:00,并禁用自动延迟:

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test project
projectIpAccessList:
- ipAddress: "192.0.2.15"
comment: "IP address for Application Server A"
maintenanceWindow:
dayOfWeek: 3
hourOfDay: 5
autoDefer: false

The following example shows an AtlasProject custom resource specification that disables the collection of database statistics in cluster metrics, data explorer, Performance Advisor, Realtime Performance Panel, and Schema Advisor.

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test project
projectIpAccessList:
- ipAddress: "192.0.2.15"
comment: "IP address for Application Server A"
settings:
isCollectDatabaseSpecificsStatisticsEnabled: false
isDataExplorerEnabled: false
isExtendedStorageSizesEnabled: false
isPerformanceAdvisorEnabled: false
isRealtimePerformancePanelEnabled: false
isSchemaAdvisorEnabled: false

以下示例显示了一个AtlasProject自定义资源规范,该规范配置了一个警报,该警报在 oplog 窗口达到少于一小时时触发:

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test Atlas Operator Project
connectionSecretRef:
name: my-atlas-key
alertConfigurations:
- eventTypeName: "REPLICATION_OPLOG_WINDOW_RUNNING_OUT",
enabled: true,
notifications:
- delayMin: 0
emailEnabled: true
intervalMin: 60
roles: [ "GROUP_OWNER" ]
smsEnabled: false
typeName: "GROUP"
threshold:
operator: "LESS_THAN",
threshold: "1",
units: "HOURS"
alertConfigurationSyncEnabled: true
withDefaultAlertsSettings: false

以下示例显示了一个AtlasProject自定义资源规范,该规范配置了通过 Slack 发送通知的警报:

apiVersion: atlas.mongodb.com/v1
kind: AtlasProject
metadata:
name: my-project
spec:
name: Test Atlas Operator Project
connectionSecretRef:
name: my-atlas-key
alertConfigurations:
- eventTypeName: "REPLICATION_OPLOG_WINDOW_RUNNING_OUT"
enabled: true
notifications:
- delayMin: 0
emailEnabled: true
intervalMin: 60
roles: [ "GROUP_OWNER" ]
smsEnabled: false
- typeName: "SLACK"
apiTokenRef:
name: key-name
namespace: key-namespace
threshold:
operator: "LESS_THAN"
threshold: "1"
units: "HOURS"
alertConfigurationSyncEnabled: true
withDefaultAlertsSettings: false

本部分介绍了AtlasProject自定义资源参数:

spec.name

类型:字符串

必需

在Atlas中创建或更新的项目的名称。名称长度不得超过 64 个字符。名称只能包含字母、数字、空格、破折号和下划线。创建项目后无法修改。

spec.alertConfigurations

类型:对象数组

Optional

List that contains alert configurations for this project.

If you use this setting, you must also set spec.alertConfigurationSyncEnabled to true for Atlas Kubernetes Operator to modify project alert configurations.

如果您省略此设置或将其留空,则 Atlas Kubernetes Operator 不会更改项目的警报配置。创建项目时,Atlas 会应用默认项目警报配置。

spec.alertConfigurations.eventTypeName

类型:字符串

必需

Atlas Triggers此警报配置描述的警报的事件。

要了解 Atlas Kubernetes Operator 接受的值,请参阅 MongoDB Atlas Administration API 文档中“在一个项目中创建一个警报配置”端点的请求正文模式。

spec.alertConfigurations.enabled

类型:布尔值

Optional

默认值:false

指示是否启用此警报配置的标志。 如果省略,则默认为false 。

spec.alertConfigurations.matchers

类型:对象数组

可选的

List of rules that determine whether Atlas checks an object for the alert configuration. You can filter using the matchers array if spec.alertConfigurations.eventTypeName specifies an event for a host, replica set, or sharded cluster.

spec.alertConfigurations.matchers.fieldName

类型:字符串

可选的

人类可读标签,用于标识 Atlas 检查的目标对象中的参数。 该参数必须匹配 Atlas 的所有规则,以检查警报配置。

Atlas Kubernetes Operator 接受以下值:

  • CLUSTER_NAME

  • HOSTNAME

  • HOSTNAME_AND_PORT

  • PORT

  • REPLICA_SET_NAME

  • SHARD_NAME

  • TYPE_NAME

Atlas Kubernetes Operator requires this setting if you include an object in the spec.alertConfigurations.matchers array.

spec.alertConfigurations.matchers.operator

类型:字符串

可选的

Comparison operator to apply when checking the current metric value against spec.alertConfigurations.matchers.value.

Atlas Kubernetes Operator 接受以下值:

  • EQUALS

  • CONTAINS

  • STARTS_WITH

  • ENDS_WITH

  • NOT_EQUALS

  • NOT_CONTAINS

  • REGEX

Atlas Kubernetes Operator requires this setting if you include an object in the spec.alertConfigurations.matchers array.

spec.alertConfigurations.matchers.value

类型:字符串

可选的

Value to match or exceed using the specified spec.alertConfigurations.matchers.operator.

Atlas Kubernetes Operator requires this setting if you include an object in the spec.alertConfigurations.matchers array.

spec.alertConfigurations.metricThreshold

类型:对象

可选的

指标的阈值,超过该阈值时会Atlas Triggers警报。

Atlas Kubernetes Operator requires this setting when spec.alertConfigurations.eventTypeName is OUTSIDE_METRIC_THRESHOLD.

spec.alertConfigurations.metricThreshold.metricName

类型:字符串

可选的

Human-readable label that identifies the metric against which Atlas checks the configured spec.alertConfigurations.metricThreshold.threshold.

要了解 Atlas Kubernetes Operator 接受的值,请参阅 MongoDB Atlas Administration API 文档中“在一个项目中创建一个警报配置”端点的请求正文模式。

Atlas Kubernetes Operator requires this setting if you include the spec.alertConfigurations.metricThreshold object.

spec.alertConfigurations.metricThreshold.mode

类型:字符串

Optional

默认值:AVERAGE

Atlas 会将当前指标值计算为平均值。

Atlas Kubernetes Operator 仅接受AVERAGE值。

spec.alertConfigurations.metricThreshold.operator

类型:字符串

可选的

检查当前指标值时要应用的比较操作符。

Atlas Kubernetes Operator 接受以下值:

  • GREATER_THAN

  • LESS_THAN

Atlas Kubernetes Operator requires this setting if you include the spec.alertConfigurations.metricThreshold object.

spec.alertConfigurations.metricThreshold.threshold

类型:整数

可选的

超过该值时会Atlas Triggers警报的指标值。

Atlas Kubernetes Operator requires this setting if you include the spec.alertConfigurations.metricThreshold object.

spec.alertConfigurations.metricThreshold.units

类型:字符串

可选的

用于Express数量的元素。该值可以是时间、存储容量等元素

Atlas Kubernetes Operator 接受以下值:

  • BITS

  • BYTES

  • DAYS

  • GIGABITS

  • GIGABYTES

  • HOURS

  • KILOBITS

  • KILOBYTES

  • MEGABITS

  • MEGABYTES

  • MILLISECONDS

  • MINUTES

  • PETABYTES

  • RAW

  • SECONDS

  • TERABYTES

Atlas Kubernetes Operator requires this setting if you include the spec.alertConfigurations.metricThreshold object.

spec.alertConfigurations.notifications

类型:数组

可选的

列表,描述 Atlas 为此警报配置描述的警报发送的通知。

spec.alertConfigurations.notifications.apiTokenRef.name

类型:字符串

可选的

不透明密钥的名称,其中包含单个password字段,其中包含Slack的API令牌。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials

如果您希望通过 Slack 收到通知,则必须指定此设置。

spec.alertConfigurations.notifications.apiTokenRef.namespace

类型:字符串

可选的

包含 Slack 的 API 令牌的命名空间。 如果您希望通过 Slack 收到通知,则必须指定此设置。

spec.alertConfigurations.notifications.channelName

类型:字符串

可选的

人类可读标签,用于标识 Atlas 向其发送警报通知的 Slack 渠道。

Atlas Kubernetes Operator requires this setting when you set spec.alertConfigurations.notifications.typeName to SLACK.

spec.alertConfigurations.notifications.datadogApiKeyRef.name

类型:字符串

可选的

password不透明密钥的名称,其中包含单个 字段以及 DataDog 的API密钥。如果您希望通过 DataDog 收到通知,则必须指定此设置。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.alertConfigurations.notifications.datadogApiKeyRef.namespace

类型:字符串

可选的

包含 Datadog API 密钥的命名空间。 如果您希望通过 Datadog 收到通知,则必须指定此设置。

spec.alertConfigurations.notifications.datadogRegion

类型:字符串

Optional

默认值:US

指示要使用的 API 统一资源定位器 (URL) 的 Datadog 地区。

Atlas Kubernetes Operator 接受以下值:

  • US

  • EU

spec.alertConfigurations.notifications.delayMins

类型:整数

Optional

默认值:0

Atlas 在检测到警报条件后到发送第一个通知之间的等待分钟数。

spec.alertConfigurations.notifications.emailAddress

类型:字符串

可选的

Atlas 发送警报通知的电子邮件地址。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to EMAIL.

Atlas Kubernetes Operator doesn't require this setting to send email notifications when you set spec.alertConfigurations.notifications.typeName to one of the following values:

  • GROUP

  • ORG

  • TEAM

  • USERS

To send emails to one Atlas user or group of users, set the spec.alertConfigurations.notifications.emailEnabled parameter.

spec.alertConfigurations.notifications.emailEnabled

类型:布尔值

可选的

指示 Atlas 是否发送电子邮件通知的标志。

Atlas Kubernetes Operator requires this setting when you set spec.alertConfigurations.notifications.typeName to one of the following values:

  • GROUP

  • ORG

  • TEAM

spec.alertConfigurations.notifications.intervalMin

类型:整数

Optional

连续通知之间的等待分钟数。 Atlas 会发送通知,直到有人确认未确认的警报。 Atlas Kubernetes Operator 接受大于或等于5的值。

PagerDuty、VictorOps 和 OpsGenie 通知不使用此字段。配置和托管每个服务中的通知间隔。

spec.alertConfigurations.notifications.microsoftTeamsWebhookUrl

类型:字符串

可选的

Atlas 通过 Microsoft Teams 发送此通知所需的 Microsoft Teams Webhook 统一资源定位器 (URL)。如果该 URL 随后无效,Atlas 会向项目所有者发送电子邮件。 如果密钥仍然无效,Atlas 会将其删除。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to MICROSOFT_TEAMS.

spec.alertConfigurations.notifications.mobileNumber

类型:字符串

可选的

Atlas 向其发送警报通知的手机号码。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to SMS.

spec.alertConfigurations.notifications.opsGenieApiKeyRef.name

类型:字符串

可选的

password不透明密钥的名称,其中包含单个 字段以及 Opsgenie 的API密钥。如果您希望通过 Opsgenie 收到通知,则必须指定此设置。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.alertConfigurations.notifications.opsGenieApiKeyRef.namespace

类型:字符串

可选的

包含 Opsgenie API 密钥的命名空间。 如果您希望通过 Opsgenie 收到通知,则必须指定此设置。

spec.alertConfigurations.notifications.opsGenieRegion

类型:字符串

Optional

默认值:US

Opsgenie 地区,用于指示要使用的 API 统一资源定位器 (URL)。

Atlas Kubernetes Operator 接受以下值:

  • US

  • EU

Atlas Kubernetes Operator applies this setting if you set spec.alertConfigurations.notifications.typeName to OPS_GENIE.

spec.alertConfigurations.notifications.roles

类型:数组

Optional

包含接收配置警报的一个或多个组织或项目角色的列表。 如果包含此参数,则 Atlas 仅向分配有您在列表中指定的角色的用户发送警报。 如果省略此参数,Atlas 则会向分配了任何角色的用户发送警报。

Atlas Kubernetes Operator 接受以下值:

  • GROUP_CLUSTER_MANAGER

  • GROUP_DATA_ACCESS_ADMIN

  • GROUP_DATA_ACCESS_READ_ONLY

  • GROUP_DATA_ACCESS_READ_WRITE

  • GROUP_OWNER

  • GROUP_READ_WRITE

  • ORG_OWNER

  • ORG_MEMBER

  • ORG_GROUP_CREATOR

  • ORG_BILLING_ADMIN

  • ORG_READ_ONLY

Atlas Kubernetes Operator applies this setting when you set spec.alertConfigurations.notifications.typeName to one of the following values:

  • GROUP

  • ORG

spec.alertConfigurations.notifications.serviceKeyRef.name

类型:字符串

可选的

不透明密钥的名称,其中包含单个password字段以及 PagerDuty 的API密钥。如果您希望通过 PagerDuty 收到通知,则必须指定此设置。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.alertConfigurations.notifications.serviceKeyRef.namespace

类型:字符串

可选的

包含 PagerDuty 的 API 密钥的命名空间。 如果您希望通过 PagerDuty 收到通知,则必须指定此设置。

spec.alertConfigurations.notifications.smsEnabled

类型:布尔值

可选的

指示 Atlas 是否发送短信通知的标志。

Atlas Kubernetes Operator requires this setting when you set spec.alertConfigurations.notifications.typeName to one of the following values:

  • GROUP

  • ORG

  • TEAM

spec.alertConfigurations.notifications.teamId

类型:字符串

可选的

唯一的 24 位十六进制数字字符串,用于标识一个 Atlas 团队。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to TEAM.

spec.alertConfigurations.notifications.teamName

类型:字符串

可选的

收到此通知的 Atlas 团队的名称。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to TEAM.

spec.alertConfigurations.notifications.typeName

类型:字符串

可选的

Human-readable label that displays the alert notification type. This setting is required if you specify a value for the spec.alertConfigurations.notifications setting. Atlas supports the following values:

  • DATADOG

  • EMAIL

  • OPS-GENIE

  • ORG

  • PAGER_DUTY

  • PROMETHEUS

  • SLACK

  • SMS

  • TEAM

  • USER

  • VICTOR_OPS

  • WEBHOOK

spec.alertConfigurations.notifications.username

类型:字符串

可选的

Atlas 向其发送通知的人员的 Atlas 用户名。仅指定属于拥有警报配置的项目的 Atlas 用户。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to USER.

spec.alertConfigurations.notifications.victorOpsSecretRef.name

类型:字符串

可选的

包含单个password 字段的不透明密钥的名称,该字段具有 Splunk On-Call 的API密钥。如果您希望通过 Splunk On-Call 收到通知,则必须指定此设置。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.alertConfigurations.notifications.victorOpsSecretRef.namespace

类型:字符串

可选的

包含 Splunk On-Call 的 API 密钥的命名空间。 如果您希望通过 Splunk On-Call 收到通知,则必须指定此设置。

spec.alertConfigurations.notifications.victorOpsRoutingKey

类型:字符串

可选的

Atlas 向 Splunk On-Call 发送警报通知所需的路由键。 如果密钥后来无效,Atlas 会向项目所有者发送电子邮件。 如果密钥仍然无效,Atlas 会将其删除。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to VICTOR_OPS.

spec.alertConfigurations.notifications.webhookSecret

类型:字符串

Optional

基于 Webhook 的警报的身份验证密钥。

Atlas Kubernetes Operator applies this setting if you set spec.alertConfigurations.notifications.typeName to WEBHOOK.

spec.alertConfigurations.notifications.webhookUrl

类型:字符串

可选的

表示 Webhook URL 的字符串。

Atlas Kubernetes Operator requires this setting if you set spec.alertConfigurations.notifications.typeName to WEBHOOK.

spec.alertConfigurations.severityOverride

类型:字符串

可选的

Overrides the Atlas-assigned default severity level for a project alert.

Atlas Kubernetes Operator 接受以下值:

  • CRITICAL

  • ERROR

  • WARNING

  • INFO

spec.alertConfigurations.threshold

类型:对象

可选的

超过限制后会Atlas Triggers警报。

Atlas Kubernetes Operator applies this setting if you set spec.alertConfigurations.eventTypeName to a value other than OUTSIDE_METRIC_THRESHOLD.

spec.alertConfigurations.threshold.operator

类型:字符串

可选的

Atlas 检查当前指标值时要应用的比较操作符。

Atlas Kubernetes Operator 接受以下值:

  • GREATER_THAN

  • LESS_THAN

Atlas Kubernetes Operator requires this setting if you include the spec.alertConfigurations.threshold object.

spec.alertConfigurations.threshold.threshold

类型:整数

可选的

超过该值时会Atlas Triggers警报的指标值。

Atlas Kubernetes Operator requires this setting if you include the spec.alertConfigurations.threshold object.

spec.alertConfigurations.threshold.units

类型:字符串

可选的

表示数量的元素。 您可以指定时间、存储容量等元素。

Atlas Kubernetes Operator 接受以下值:

  • BITS

  • BYTES

  • DAYS

  • GIGABITS

  • GIGABYTES

  • HOURS

  • KILOBITS

  • KILOBYTES

  • MEGABITS

  • MEGABYTES

  • MILLISECONDS

  • MINUTES

  • PETABYTES

  • RAW

  • SECONDS

  • TERABYTES

Atlas Kubernetes Operator requires this setting if you include the spec.alertConfigurations.threshold object.

spec.alertConfigurationSyncEnabled

类型:布尔值

Optional

默认值:false

Flag that indicates whether Atlas Kubernetes Operator applies the project alert settings defined in spec.alertConfigurations. If you omit or set to this parameter to false, Atlas Kubernetes Operator doesn't synchronize the project's alert configurations with the ones that you define in the AtlasProject custom resource.

For information on how this setting interacts with spec.withDefaultAlertsSettings, see the Considerations.

spec.auditing.auditAuthorizationSuccess

类型:布尔值

Optional

默认值:false

Flag that indicates whether to direct the auditing system to capture successful authentication attempts for audit filters using the "atype" : "authCheck" auditing event. To set this parameter to true, you must set spec.auditing.enabled to true. To learn more, see auditAuthorizationSuccess.

警告:如果启用auditAuthorizationSuccess ,可能会严重影响集群性能。 请谨慎启用此选项。

spec.auditing.auditFilter

类型:字符串

Optional

JSON-formatted auditing filter. You might need to escape the JSON string to remove characters that could prevent parsing, such as single or double-quotes. To specify a value for this setting, you must set spec.auditing.enabled to true.

要查看审核筛选器示例,请参阅审核筛选器示例。 要了解有关配置 MongoDB 审核筛选器的更多信息,请参阅配置自定义审核筛选器。

spec.auditing.enabled

类型:布尔值

可选的

默认值:false

Flag that indicates whether to enable auditing for the project. To specify a value for spec.auditing.auditFilter, or to set spec.auditing.auditAuthorizationSuccess to true, you must specify this setting. To learn more, see Enable Audit Logs.

spec.backupCompliancePolicyRef

类型:对象

可选的

AtlasBackupCompliancePolicy对象,包含引用 自定义资源的不透明密钥的名称和命名空间。如果启用备份合规策略,则必须指定此参数。

spec.backupCompliancePolicyRef.name

类型:字符串

可选的

引用 AtlasBackupCompliancePolicy自定义资源的不透明密钥的名称。如果启用备份合规策略,则必须指定此参数。

spec.backupCompliancePolicyRef.namespace

类型:对象

可选的

引用 AtlasBackupCompliancePolicy自定义资源的不透明密钥的命名空间。如果启用备份合规策略,则必须指定此参数。

spec.connectionSecretRef.name

类型:字符串

Optional

不透明密钥的名称,其中包含单个 password字段,其中包含Atlas Kubernetes Operator用于连接到Atlas 的组织ID和API密钥。如果未指定, Atlas Kubernetes Operator将使用默认的global 密钥。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials

默认下, Atlas Kubernetes Operator将连接密钥保存在与AtlasProject 自定义资源相同的命名空间中。要将密钥存储在其他命名空间中,请指定spec.connectionSecretRef.namespace 参数。

spec.connectionSecretRef.namespace

类型:字符串

Optional

包含密钥的命名空间,该密钥具有组织ID和Atlas Kubernetes Operator用于连接到Atlas 的API密钥。如果未指定, Atlas Kubernetes Operator会将连接密钥保存在与AtlasProject 自定义资源相同的命名空间中。

spec.cloudProviderAccessRoles

类型:数组

Deprecated. Use spec.cloudProviderIntegrations instead.

包含统一云提供商访问设置的列表。

spec.cloudProviderAccessRoles.iamAssumedRoleArn

类型:字符串

Deprecated. Use spec.cloudProviderIntegrations.iamAssumedRoleArn instead.

唯一的Amazon Web Services ARN ,用于标识 Atlas 假定的IAM访问角色。如果要设置统一的云提供商访问权限,则必须指定此设置。

spec.cloudProviderAccessRoles.providerName

类型:字符串

Deprecated. Use spec.cloudProviderIntegrations.providerName instead.

Atlas 担任访问角色的云提供商。 Atlas Kubernetes Operator 支持AWS以实现统一的云提供商访问。如果要设置统一的云提供商访问权限,则必须指定此设置。

spec.cloudProviderIntegrations

类型:数组

Optional

包含统一云提供商集成设置的列表。

spec.cloudProviderIntegrations.iamAssumedRoleArn

类型:字符串

可选的

唯一的Amazon Web Services ARN ,用于标识 Atlas 假定的IAM访问角色。如果要设置统一的云提供商集成,则必须指定此设置。

spec.cloudProviderIntegrations.providerName

类型:字符串

可选的

Atlas 担任访问角色的云提供商。 Atlas Kubernetes Operator 支持AWS进行统一的云提供商集成。如果要设置统一的云提供商集成,则必须指定此设置。

spec.customRoles

类型:对象

Optional

已弃用

重要

从Atlas Kubernetes Operator 2.6 开始,此参数已弃用。根据 迁移指南 ,迁移到 AtlasPrivateEndpoint 自定义资源 。

包含自定义角色规范的对象。

spec.encryptionAtRest

类型:数组

Optional

列表,其中包含使用客户托管密钥对项目进行静态加密的配置。

spec.encryptionAtRest.awsKms

类型:对象

Optional

列表,其中包含使用Amazon Web Services KMS为项目使用客户托管密钥进行静态加密的配置。

spec.encryptionAtRest.enabled

类型:布尔值

Optional

指示此项目是否使用 AWS KMS 对静态数据进行加密的标志。要使用 Amazon Web Services KMS 启用静态加密,请将此参数设置为 true。要使用 Amazon Web Services KMS 禁用静态加密,请将此参数设置为 false。如果您使用 Amazon Web Services KMS 禁用静态加密,Atlas Kubernetes Operator 将删除配置详情。

spec.encryptionAtRest.awsKms.region

类型:字符串

Optional

Label that indicates the AWS region where the customer master key exists.

spec.encryptionAtRest.awsKms.secretRef.name

类型:字符串

Optional

包含您的 Amazon Web Services 凭证的不透明 密钥 名称。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.encryptionAtRest.awsKms.secretRef.namespace

类型:字符串

Optional

包含您的Amazon Web Services凭证的命名空间。如果未指定,此参数默认为 AtlasProject 自定义资源的命名空间。

spec.encryptionAtRest.azureKeyVault

类型:对象

Optional

列表,其中包含使用Azure Key Vault 进行静态加密的配置,其中使用的是项目的客户托管密钥。

spec.encryptionAtRest.azureKeyVault.azureEnvironment

类型:字符串

Optional

Azure 部署位置,其中存储着 Azure 账户凭证。有效值包括 AZURE、AZURE_CHINA 和 AZURE_GERMANY。

spec.encryptionAtRest.azureKeyVault.clientID

类型:字符串

Optional

唯一的 36-十六进制string,用于标识您的 Azure 应用程序。

spec.encryptionAtRest.azureKeyVault.enabled

类型:布尔值

Optional

指示此项目是否使用使用Azure Key Vault 的Azure Key 的标志,Atlas Kubernetes Operator 删除了配置详细信息。

spec.encryptionAtRest.azureKeyVault.resourceGroupName

类型:字符串

Optional

用于标识包含 Azure Key Vault 的 Azure 资源组的标签。Azure在资源组的详细信息页面显示资源组名称。

spec.encryptionAtRest.azureKeyVault.secretRef.name

类型:字符串

Optional

包含您的 Azure 凭证的不透明 密钥 名称。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.encryptionAtRest.azureKeyVault.secretRef.namespace

类型:字符串

Optional

包含您的 Azure 凭证的命名空间。如果未指定,此参数默认为 AtlasProject 自定义资源的命名空间。

spec.encryptionAtRest.azureKeyVault.tenantID

类型:字符串

Optional

唯一的 36-十六进制string,用于标识Azure订阅中的Azure Active Directory 租户。Azure在租户属性页面上显示租户ID 。

spec.encryptionAtRest.googleCloudKms

类型:对象

Optional

列表,其中包含使用 Google Cloud KMS进行静态加密(使用客户管理的项目密钥)的配置。

spec.encryptionAtRest.googleCloudKms.enabled`

类型:字符串

Optional

标志,指示此项目是否使用 Google Cloud Platform KMS 对静态数据进行加密。要使用 Google Cloud KMS 实现静态加密,请将此参数设置为 true。要使用 Google Cloud KMS 禁用静态加密,请将此参数设置为 false。如果使用 Google Cloud Platform KMS 禁用静态加密,Atlas Kubernetes Operator 则删除配置详情。

spec.encryptionAtRest.googleCloudKms.secretRef.name

类型:字符串

Optional

包含Google Cloud Platform凭证的不透明密钥的名称。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials
spec.encryptionAtRest.googleCloudKms.secretRef.namespace

类型:字符串

Optional

包含您的 Google Cloud Platform 档案的命名空间。如果未指定,此参数默认为AtlasProject自定义资源的命名空间。

spec.integrations

类型:数组

Optional

已弃用

重要

从Atlas Kubernetes Operator 2.9 开始,此参数已弃用。根据 迁移指南 ,迁移到 AtlasThirdPartyIntegration 自定义资源。

包含第三方集成设置的列表。

spec.maintenanceWindow

类型:对象

Optional

包含维护窗口设置的列表。 您可以指定以下正文参数:

名称
类型
必要性
说明

dayOfWeek

数字

必需

您希望维护窗口在一周中的哪一天开始,采用从 1 开始的整数形式。

周中的某一天
整型

星期日

1

星期一

2

星期二

3

星期三

4

星期四

5

星期五

6

星期六

7

hourOfDay

数字

必需

您希望维护窗口开始的时间。 此参数使用 24 小时制,其中午夜为0 ,中午为12 。

autoDeferOnceEnabled

布尔

Optional

指示是否要将所有维护窗口推迟一周的标志。

重要

维护窗口注意事项

紧急维护活动

诸如安全补丁之类的紧急维护活动无法等待 您选择的窗口。Atlas 将在需要时启动这些维护活动。

持续维护操作

一旦为群集安排了维护, 在当前维护工作完成之前,您就无法更改维护窗口。

维护需要副本集选举

Atlas 的维护方式与 MongoDB 手册所述的维护过程相同。此过程要求每个副本集在维护窗口期间至少进行一次副本集选举。

维护尽量靠近整点开始

维护总是尽可能接近预定时间开始, 但正在进行的集群更新或意外的系统问题可能会延迟开始时间。
spec.maintenanceWindow.autoDefer

类型:布尔值

可选的

指示 Atlas 是否应在启用所有维护窗口后将其推迟一周的标志。

spec.maintenanceWindow.defer

类型:布尔值

可选的

Flag that indicates whether Atlas should defer scheduled maintenance. You must schedule maintenance before you can successfully defer maintenance. spec.maintenanceWindow.defer and spec.maintenanceWindow.startASAP can't both be set to true at the same time.

重要

While spec.maintenanceWindow.defer is set to true, Atlas Kubernetes Operator defers scheduled maintenance every time you apply changes to the AtlasProject custom resource. If you set spec.maintenanceWindow.defer to true, you should change spec.maintenanceWindow.defer to false after you apply changes.

spec.maintenanceWindow.dayOfWeek

类型:数字

可选的

从一开始的整数,表示维护窗口开始的星期几。 使用下表查找与每一天对应的整数:

周中的某一天
整型

星期日

1

星期一

2

星期二

3

星期三

4

星期四

5

星期五

6

星期六

7

如果要为项目配置维护窗口,则必须指定此设置。

spec.maintenanceWindow.hourOfDay

类型:数字

可选的

从零开始的整数,表示维护窗口按照 24 小时制开始的当天中的某个小时。 午夜使用0 ,中午使用12 。 如果要为项目配置维护窗口,则必须指定此设置。

spec.maintenanceWindow.startASAP

类型:布尔值

可选的

Flag that indicates whether Atlas should immediately start maintenance. spec.maintenanceWindow.defer and spec.maintenanceWindow.startASAP can't both be set to true at the same time.

重要

While spec.maintenanceWindow.startASAP is set to true, Atlas Kubernetes Operator starts maintenance every time you apply changes to the AtlasProject custom resource. If you set spec.maintenanceWindow.startASAP to true, you should change spec.maintenanceWindow.startASAP to false after you apply changes.

spec.networkPeers

类型:数组

Optional

已弃用

重要

从Atlas Kubernetes Operator 2.8 开始,此参数已弃用。根据 迁移指南 ,迁移到 AtlasNetworkPeering 和 AtlasNetworkContainer 自定义资源。

包含项目网络对等互连配置的列表。

spec.regionUsageRestrictions

类型:字符串

Optional

仅为Atlas for Government指定项目地区。您可以指定以下值之一:

  • NONE:项目没有地区使用限制。这是默认值。

  • GOV_REGIONS_ONLY:将项目限制在您指定的政府云区域。

  • COMMERCIAL_FEDRAMP_REGIONS_ONLY:表示项目仅限于Amazon Web Services FedRamp Moderate 标准区域。

spec.projectIpAccessList

类型:数组

必需

已弃用

重要

从Atlas Kubernetes Operator 2.7 开始,此参数已弃用。根据 迁移指南 ,迁移到 AtlasIPAccessList 自定义资源 。

IP访问列表,为项目中的 Atlas 集群授予网络访问权限。您可以指定以下正文参数:

Parameter
类型
必要性
说明

awsSecurityGroup

字符串

可选的

要添加到访问列表的Amazon Web Services安全组的唯一标识符。

您的访问列表条目只能包含一个awsSecurityGroup 、一个cidrBlock或一个ipAddress 。

您必须先为项目配置VPC对等互连,然后才能将Amazon Web Services安全群组添加到访问权限列表。

cidrBlock

字符串

可选的

要添加到访问列表的 IP 地址范围(采用CIDR表示法)。

您的访问列表条目只能包含一个awsSecurityGroup 、一个cidrBlock或一个ipAddress 。

comment

字符串

Optional

与访问列表条目关联的注释。

deleteAfterDate

日期

Optional

Timestamp in ISO 8601 date and time format in UTC after which Atlas removes the entry from the access list. The specified date must be in the future and within one week of the time you make the API request.

重要提示:您不能设立Amazon Web Services安全组设置为临时访问权限列表条目。

您可以包含 ISO 8601 时区域标识符,以确保到期日期相对于指定时区域的本地时间。

IP 地址

字符串

可选的

要添加到访问列表的单个 IP 地址。 与awsSecurityGroup和cidrBlock 互斥。

您的访问列表条目只能包含一个awsSecurityGroup 、一个cidrBlock或一个ipAddress 。

spec.settings

类型:对象

Optional

包含项目设置的列表。

spec.settings.isCollectDatabaseSpecificsStatisticsEnabled

类型:布尔值

Optional

指示项目是否启用集群指标中的数据库统计信息集合的标志。

spec.settings.isDataExplorerEnabled

类型:布尔值

Optional

指示项目是否启用了数据浏览器的标志。

spec.settings.isExtendedStorageSizesEnabled

类型:布尔值

Optional

Flag that indicates whether to enable extended storage sizes for the specified project. To learn more about enabling extended storage, see Manage Project Settings.

spec.settings.isPerformanceAdvisorEnabled

类型:布尔值

Optional

Flag that indicates whether your project has Performance Advisor enabled.

spec.settings.isRealtimePerformancePanelEnabled

类型:布尔值

Optional

Flag that indicates whether your project has Realtime Performance Panel enabled.

spec.settings.isSchemaAdvisorEnabled

类型:布尔值

Optional

指示项目是否已启用Schema Advisor的标志。

spec.privateEndpoints

类型:数组

Optional

已弃用

重要

从Atlas Kubernetes Operator 2.6 开始,此参数已弃用。根据 迁移指南 ,迁移到 AtlasPrivateEndpoint 自定义资源 。

包含项目私有端点配置的列表。

spec.teams

类型:对象

Optional

包含团队规范的对象。 要了解详情,请参阅配置团队。

spec.teams.teamRef.name

类型:字符串

可选的

来自AtlasTeam 字段中的metadata.name 自定义资源的人类可读标签。如果要将团队分配到此项目,则必须指定此设置。

spec.teams.teamRef.namespace

类型:字符串

可选的

如果命名空间不是default ,则在AtlasTeam自定义资源中指定。

spec.teams.teamRef.roles

类型:字符串

可选的

Atlas User Roles that a team uses for this project. If you want to assign a team to this project, you must specify this setting.

spec.withDefaultAlertsSettings

类型:布尔值

Optional

默认值:true

Flag that indicates whether Atlas Kubernetes Operator creates a project with the default alert configurations. If omitted, defaults to true.

If you use this setting, you must also set spec.alertConfigurationSyncEnabled to true for Atlas Kubernetes Operator to modify project alert configurations.

如果您在创建项目时将此参数设置为false ,则 Atlas 不会将默认警报配置添加到项目中。

此设置对现有项目没有影响。

For information on how this setting interacts with spec.alertConfigurationSyncEnabled, see the Considerations.

spec.x509CertRef.name

类型:字符串

Optional

kubernetes.io/tlsX.509 证书的 密钥的名称。

Atlas Kubernetes Operator 仅监视带有标签 atlas.mongodb.com/type=credentials 的密钥,以避免监视不必要的密钥。

以下示例标记了密钥:

kubectl label secret the-user-password atlas.mongodb.com/type=credentials