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
AtlasProjectCustom 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自定义资源规范来配置以下选项:
An IP access list with the
spec.projectIpAccessListparameter. This IP access list grants network access to Atlas clusters in the project.Teams with the
spec.teamsparameter. A team lets you grant an access role to an entire group of Atlas users for a particular project.The maintenance window with the
spec.maintenanceWindowparameter. The maintenance window sets the hour and day that Atlas starts weekly maintenance on your database deployments.
Network peering with the
spec.networkPeersparameter. Network peering allows you to connect securely to your AWS, Azure, or Google Cloud VPC.Encryption at rest using customer-managed keys with the
spec.encryptionAtRestparameter. Encryption at rest using customer-managed keys allows you to add an additional layer of security by using your cloud provider's KMS together with the MongoDB encrypted storage engine.Private endpoints with the
spec.privateEndpointsparameter.X.509 authentication with the
spec.x509CertRef.nameparameter.Project settings with the
spec.settingsparameter, including settings to enable and disable the following:Collection of database statistics in cluster metrics
Project alerts configurations with the
spec.alertConfigurationSyncEnabledandspec.alertConfigurationsparameters.有关这些设置如何交互的信息,请参阅注意事项。
如果您从 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 示例
以下示例显示了与 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.alertConfigurations类型:对象数组
Optional
List that contains alert configurations for this project.
If you use this setting, you must also set
spec.alertConfigurationSyncEnabledtotruefor 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.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.eventTypeNamespecifies an event for a host, replica set, or sharded cluster.
spec.alertConfigurations.matchers.fieldName类型:字符串
可选的
人类可读标签,用于标识 Atlas 检查的目标对象中的参数。 该参数必须匹配 Atlas 的所有规则,以检查警报配置。
Atlas Kubernetes Operator 接受以下值:
CLUSTER_NAMEHOSTNAMEHOSTNAME_AND_PORTPORTREPLICA_SET_NAMESHARD_NAMETYPE_NAME
Atlas Kubernetes Operator requires this setting if you include an object in the
spec.alertConfigurations.matchersarray.
spec.alertConfigurations.matchers.operator类型:字符串
可选的
Comparison operator to apply when checking the current metric value against
spec.alertConfigurations.matchers.value.Atlas Kubernetes Operator 接受以下值:
EQUALSCONTAINSSTARTS_WITHENDS_WITHNOT_EQUALSNOT_CONTAINSREGEX
Atlas Kubernetes Operator requires this setting if you include an object in the
spec.alertConfigurations.matchersarray.
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.matchersarray.
spec.alertConfigurations.metricThreshold类型:对象
可选的
指标的阈值,超过该阈值时会Atlas Triggers警报。
Atlas Kubernetes Operator requires this setting when
spec.alertConfigurations.eventTypeNameisOUTSIDE_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.metricThresholdobject.
spec.alertConfigurations.metricThreshold.mode类型:字符串
Optional
默认值:
AVERAGEAtlas 会将当前指标值计算为平均值。
Atlas Kubernetes Operator 仅接受
AVERAGE值。
spec.alertConfigurations.metricThreshold.operator类型:字符串
可选的
检查当前指标值时要应用的比较操作符。
Atlas Kubernetes Operator 接受以下值:
GREATER_THANLESS_THAN
Atlas Kubernetes Operator requires this setting if you include the
spec.alertConfigurations.metricThresholdobject.
spec.alertConfigurations.metricThreshold.threshold类型:整数
可选的
超过该值时会Atlas Triggers警报的指标值。
Atlas Kubernetes Operator requires this setting if you include the
spec.alertConfigurations.metricThresholdobject.
spec.alertConfigurations.metricThreshold.units类型:字符串
可选的
用于Express数量的元素。该值可以是时间、存储容量等元素
Atlas Kubernetes Operator 接受以下值:
BITSBYTESDAYSGIGABITSGIGABYTESHOURSKILOBITSKILOBYTESMEGABITSMEGABYTESMILLISECONDSMINUTESPETABYTESRAWSECONDSTERABYTES
Atlas Kubernetes Operator requires this setting if you include the
spec.alertConfigurations.metricThresholdobject.
spec.alertConfigurations.notifications类型:数组
可选的
列表,描述 Atlas 为此警报配置描述的警报发送的通知。
类型:字符串
可选的
不透明密钥的名称,其中包含单个
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.typeNametoSLACK.
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 接受以下值:
USEU
spec.alertConfigurations.notifications.emailAddress类型:字符串
可选的
Atlas 发送警报通知的电子邮件地址。
Atlas Kubernetes Operator requires this setting if you set
spec.alertConfigurations.notifications.typeNametoEMAIL.Atlas Kubernetes Operator doesn't require this setting to send email notifications when you set
spec.alertConfigurations.notifications.typeNameto one of the following values:GROUPORGTEAMUSERS
To send emails to one Atlas user or group of users, set the
spec.alertConfigurations.notifications.emailEnabledparameter.
spec.alertConfigurations.notifications.emailEnabled类型:布尔值
可选的
指示 Atlas 是否发送电子邮件通知的标志。
Atlas Kubernetes Operator requires this setting when you set
spec.alertConfigurations.notifications.typeNameto one of the following values:GROUPORGTEAM
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.typeNametoMICROSOFT_TEAMS.
spec.alertConfigurations.notifications.mobileNumber类型:字符串
可选的
Atlas 向其发送警报通知的手机号码。
Atlas Kubernetes Operator requires this setting if you set
spec.alertConfigurations.notifications.typeNametoSMS.
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
默认值:
USOpsgenie 地区,用于指示要使用的 API 统一资源定位器 (URL)。
Atlas Kubernetes Operator 接受以下值:
USEU
Atlas Kubernetes Operator applies this setting if you set
spec.alertConfigurations.notifications.typeNametoOPS_GENIE.
spec.alertConfigurations.notifications.roles类型:数组
Optional
包含接收配置警报的一个或多个组织或项目角色的列表。 如果包含此参数,则 Atlas 仅向分配有您在列表中指定的角色的用户发送警报。 如果省略此参数,Atlas 则会向分配了任何角色的用户发送警报。
Atlas Kubernetes Operator 接受以下值:
GROUP_CLUSTER_MANAGERGROUP_DATA_ACCESS_ADMINGROUP_DATA_ACCESS_READ_ONLYGROUP_DATA_ACCESS_READ_WRITEGROUP_OWNERGROUP_READ_WRITEORG_OWNERORG_MEMBERORG_GROUP_CREATORORG_BILLING_ADMINORG_READ_ONLY
Atlas Kubernetes Operator applies this setting when you set
spec.alertConfigurations.notifications.typeNameto one of the following values:GROUPORG
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.typeNameto one of the following values:GROUPORGTEAM
spec.alertConfigurations.notifications.teamId类型:字符串
可选的
唯一的 24 位十六进制数字字符串,用于标识一个 Atlas 团队。
Atlas Kubernetes Operator requires this setting if you set
spec.alertConfigurations.notifications.typeNametoTEAM.
spec.alertConfigurations.notifications.teamName类型:字符串
可选的
收到此通知的 Atlas 团队的名称。
Atlas Kubernetes Operator requires this setting if you set
spec.alertConfigurations.notifications.typeNametoTEAM.
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.notificationssetting. Atlas supports the following values:DATADOGEMAILOPS-GENIEORGPAGER_DUTYPROMETHEUSSLACKSMSTEAMUSERVICTOR_OPSWEBHOOK
spec.alertConfigurations.notifications.username类型:字符串
可选的
Atlas 向其发送通知的人员的 Atlas 用户名。仅指定属于拥有警报配置的项目的 Atlas 用户。
Atlas Kubernetes Operator requires this setting if you set
spec.alertConfigurations.notifications.typeNametoUSER.
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.typeNametoVICTOR_OPS.
spec.alertConfigurations.notifications.webhookSecret类型:字符串
Optional
基于 Webhook 的警报的身份验证密钥。
Atlas Kubernetes Operator applies this setting if you set
spec.alertConfigurations.notifications.typeNametoWEBHOOK.
spec.alertConfigurations.notifications.webhookUrl类型:字符串
可选的
表示 Webhook URL 的字符串。
Atlas Kubernetes Operator requires this setting if you set
spec.alertConfigurations.notifications.typeNametoWEBHOOK.
spec.alertConfigurations.severityOverride类型:字符串
可选的
Overrides the Atlas-assigned default severity level for a project alert.
Atlas Kubernetes Operator 接受以下值:
CRITICALERRORWARNINGINFO
spec.alertConfigurations.threshold类型:对象
可选的
超过限制后会Atlas Triggers警报。
Atlas Kubernetes Operator applies this setting if you set
spec.alertConfigurations.eventTypeNameto a value other thanOUTSIDE_METRIC_THRESHOLD.
spec.alertConfigurations.threshold.operator类型:字符串
可选的
Atlas 检查当前指标值时要应用的比较操作符。
Atlas Kubernetes Operator 接受以下值:
GREATER_THANLESS_THAN
Atlas Kubernetes Operator requires this setting if you include the
spec.alertConfigurations.thresholdobject.
spec.alertConfigurations.threshold.threshold类型:整数
可选的
超过该值时会Atlas Triggers警报的指标值。
Atlas Kubernetes Operator requires this setting if you include the
spec.alertConfigurations.thresholdobject.
spec.alertConfigurations.threshold.units类型:字符串
可选的
表示数量的元素。 您可以指定时间、存储容量等元素。
Atlas Kubernetes Operator 接受以下值:
BITSBYTESDAYSGIGABITSGIGABYTESHOURSKILOBITSKILOBYTESMEGABITSMEGABYTESMILLISECONDSMINUTESPETABYTESRAWSECONDSTERABYTES
Atlas Kubernetes Operator requires this setting if you include the
spec.alertConfigurations.thresholdobject.
spec.alertConfigurationSyncEnabled类型:布尔值
Optional
默认值:
falseFlag that indicates whether Atlas Kubernetes Operator applies the project alert settings defined in
spec.alertConfigurations. If you omit or set to this parameter tofalse, Atlas Kubernetes Operator doesn't synchronize the project's alert configurations with the ones that you define in theAtlasProjectcustom resource.For information on how this setting interacts with
spec.withDefaultAlertsSettings, see the Considerations.
spec.auditing.auditAuthorizationSuccess类型:布尔值
Optional
默认值:
falseFlag 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 totrue, you must setspec.auditing.enabledtotrue. 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.enabledtotrue.要查看审核筛选器示例,请参阅审核筛选器示例。 要了解有关配置 MongoDB 审核筛选器的更多信息,请参阅配置自定义审核筛选器。
spec.auditing.enabled类型:布尔值
可选的
默认值:
falseFlag that indicates whether to enable auditing for the project. To specify a value for
spec.auditing.auditFilter, or to setspec.auditing.auditAuthorizationSuccesstotrue, 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.cloudProviderIntegrationsinstead.包含统一云提供商访问设置的列表。
spec.cloudProviderAccessRoles.iamAssumedRoleArn类型:字符串
Deprecated. Use
spec.cloudProviderIntegrations.iamAssumedRoleArninstead.唯一的Amazon Web Services ARN ,用于标识 Atlas 假定的IAM访问角色。如果要设置统一的云提供商访问权限,则必须指定此设置。
spec.cloudProviderAccessRoles.providerName类型:字符串
Deprecated. Use
spec.cloudProviderIntegrations.providerNameinstead.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.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
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.defer类型:布尔值
可选的
Flag that indicates whether Atlas should defer scheduled maintenance. You must schedule maintenance before you can successfully defer maintenance.
spec.maintenanceWindow.deferandspec.maintenanceWindow.startASAPcan't both be set totrueat the same time.重要
While
spec.maintenanceWindow.deferis set totrue, Atlas Kubernetes Operator defers scheduled maintenance every time you apply changes to theAtlasProjectcustom resource. If you setspec.maintenanceWindow.defertotrue, you should changespec.maintenanceWindow.defertofalseafter 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.deferandspec.maintenanceWindow.startASAPcan't both be set totrueat the same time.重要
While
spec.maintenanceWindow.startASAPis set totrue, Atlas Kubernetes Operator starts maintenance every time you apply changes to theAtlasProjectcustom resource. If you setspec.maintenanceWindow.startASAPtotrue, you should changespec.maintenanceWindow.startASAPtofalseafter 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
IP 地址
字符串
可选的
要添加到访问列表的单个 IP 地址。 与awsSecurityGroup和cidrBlock 互斥。
您的访问列表条目只能包含一个awsSecurityGroup 、一个cidrBlock或一个ipAddress 。
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
默认值:
trueFlag 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.alertConfigurationSyncEnabledtotruefor 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