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

AtlasThirdPartyIntegration 自定义资源

The AtlasThirdPartyIntegration custom resource configures third party integrations in an Atlas project. These resources allow you to manage third-party integrations with various monitoring services to collect and analyze the performance of your Atlas deployment.

重要

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

  • Atlas Kubernetes Operator使用自定义资源配置文件来管理Atlas配置,但从Atlas Kubernetes Operator2.0 开始,您在Kubernetes中删除的自定义资源不再(默认)在Atlas中删除。相反, Atlas Kubernetes Operator只是停止管理Atlas中的这些资源。 AtlasProject示例,如果您在Kubernetes中删除 自定义资源,默认默认, Atlas Kubernetes Operator不再自动从Atlas中删除相应的项目。这种行为更改旨在帮助防止意外删除。 要学习;了解详情,包括如何将此行为恢复为在Atlas Kubernetes Operator.2 0之前使用的默认,请参阅新默认值: Atlas Kubernetes2 Operator.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 第三方服务集成API资源执行以下操作之一:

  • 创建新的第三方服务集成。

  • 更新现有的第三方服务集成。

以下示例显示了一个 AtlasThirdPartyIntegration 自定义资源,该资源在 my-project项目中定义了 DataDog 集成。

apiVersion: atlas.mongodb.com/v1
kind: AtlasThirdPartyIntegration
metadata:
name: my-atlas-integ
spec:
projectRef:
name: my-project
namespace: my-operator-namespace
type: DATADOG
datadog:
apiKeySecretRef:
name: datadog-secret
region: US
sendCollectionLatencyMetrics: enabled
sendDatabaseMetrics: enabled

The following example shows an AtlasThirdPartyIntegration independent CRD that defines the same Datadog integration defined in the Basic Example. This custom resource definition allows you to create this third-party integration in a project you don't manage in the same instance of Atlas Kubernetes Operator with which you define this resource. To enable independent operation, you must use an externalProjectRef instead of a projectRef, and you must supply a connectionSecret directly since this resource can't inherit API credentials from its parent project.

apiVersion: atlas.mongodb.com/v1
kind: AtlasThirdPartyIntegration
metadata:
name: my-atlas-integ
spec:
externalProjectRef:
projectID: 66e2f2b621571b7e69a89b66
connectionSecret:
name: atlas-connection-secret
type: DATADOG
datadog:
apiKeySecretRef:
name: datadog-secret
region: US
sendCollectionLatencyMetrics: enabled
sendDatabaseMetrics: enabled

本部分介绍可用的AtlasThirdPartyIntegration自定义资源参数。

metadata.name

类型:字符串

必需

Name that the AtlasThirdPartyIntegration Custom Resource uses to add this third-party integration to a project.

metadata.namespace

类型:字符串

Optional

要包含 AtlasThirdPartyIntegration 自定义资源的命名空间。如果未指定, Atlas Kubernetes Operator将使用 kubectl设立的当前命名空间。

spec.connectionSecret

类型:字符串

可选的

不透明密钥的名称,其中包含Atlas Kubernetes Operator用于连接到Atlas 的组织ID和API密钥。如果未指定, Atlas Kubernetes Operator会回退到以下任一项:

  • 父级 atlasProject 的 spec.connectionSecretRef.name 参数

  • 默认global 密钥(如果未为父 atlasProject 定义 spec.connectionSecretRef.name

对于独立的 CRD,此参数为必填项。

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

以下示例标记了密钥:

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

类型:字符串

可选的

第三方集成所属项目的ID 。您必须指定现有Atlas项目的项目ID 。对于属于以下任一组织托管的项目的第三方集成,需要使用此参数:

  • Atlas Kubernetes Operator的不同实例

  • Atlas Kubernetes Operator以外的工具

对于属于同一Atlas Kubernetes Operator实例托管的项目的部署,如果不使用 spec.externalProjectRef.id,请使用 spec.projectRef.name。

第三方集成只能属于一个项目。要为多个项目定义相同的第三方集成,请为每个项目创建自定义资源定义。

spec.projectRef.name

类型:字符串

可选的

第三方集成所属项目的名称。您必须指定现有的 AtlasProject 自定义资源。此参数仅适用于属于由同一实例Atlas Kubernetes Operator托管的项目的第三方集成。

对于属于以下任一机构托管的项目的第三方集成:

  • Atlas Kubernetes Operator的不同实例

  • Atlas Kubernetes Operator以外的工具

使用 spec.externalProjectRef.id 。

第三方集成只能属于一个项目。要为多个项目定义相同的第三方集成,请为每个项目创建自定义资源定义。

spec.type

类型:字符串

必需

要与Atlas集成的第三方服务的名称。此值必须是以下值之一:

  • DATADOG

  • MICROSOFT_TEAMS

  • NEW_RELIC

  • OPS_GENIE

  • PAGER_DUTY

  • PROMETHEUS

  • SLACK

  • VICTOR_OPS

  • WEBHOOK

每个集成 type 都需要一设立不同的配置字段。示例,如果将 type设立为 DATADOG,则必须仅配置 spec.datadog文档及其子字段。

要在同一项目中定义多个第三方集成,您必须为每个集成创建单独的 CRD。在给定项目中,每种集成类型只能定义一个实例。这既适用于此 CRD,也适用于 AtlasProject CRD 的 spec.integrations 参数。

spec.datadog

类型:文档

可选的

声明 DataDog 第三方服务集成配置参数的文档。

如果将 spec.type 值设立为 DATADOG,则必须声明此参数。

spec.datadog.apiKeySecretRef.name

类型:字符串

可选的

包含 DataDog API密钥的密钥。

如果将 spec.type 值设立为 DATADOG,则必须声明此参数。

spec.datadog.region

类型:字符串

可选的

托管 DataDog 服务的地理地区。

如果将 spec.type 值设立为 DATADOG,则必须声明此参数。

spec.datadog.sendCollectionLatencyMetrics

类型:字符串

可选的

用于控制是否向 DataDog 发送集合延迟指标的开关。 必须是 enabled 或 disabled。

如果将 spec.type 值设立为 DATADOG,则必须声明此参数。

spec.datadog.sendDatabaseMetrics

类型:字符串

可选的

用于控制是否将数据库指标发送到 DataDog 的开关。 必须是 enabled 或 disabled。

如果将 spec.type 值设立为 DATADOG,则必须声明此参数。

spec.microsoftTeams.urlSecretRef.name

类型:字符串

可选的

包含Microsoft Teams 密钥URL 的密钥。必须包含 webhookURL 值。

如果将 spec.type 值设立为 MICROSOFT_TEAMS,则必须声明此参数。

spec.newRelic.credentialsSecretRef.name

类型:字符串

可选的

包含 New Relic凭证的密钥。这必须包括以下内容:

  • New Relic 帐户ID

  • New Relic 许可证密钥

  • New Relic 读取和写入令牌

如果将 spec.type 值设立为 NEW_RELIC,则必须声明此参数。

spec.opsGenie

类型:文档

可选的

用于声明 Ops Genie 第三方服务集成的配置参数的文档。

如果将 spec.type 值设立为 OPS_GENIE,则必须声明此参数。

spec.opsGenie.apiKeySecretRef.name

类型:字符串

可选的

包含 Ops Genie API密钥的密钥。

如果将 spec.type 值设立为 OPS_GENIE,则必须声明此参数。

spec.opsGenie.region

类型:字符串

可选的

托管 Ops Genie 服务的地理地区。

如果将 spec.type 值设立为 OPS_GENIE,则必须声明此参数。

spec.pagerDuty

类型:文档

可选的

声明用于 Pager Duty 第三方服务集成的配置参数的文档。

如果将 spec.type 值设立为 PAGER_DUTY,则必须声明此参数。

spec.pagerDuty.serviceKeySecretRef.name

类型:字符串

可选的

包含寻呼机值班服务密钥的密钥。

spec.pagerDuty.region

类型:字符串

可选的

托管 Ops Genie 服务的地理地区。

如果将 spec.type 值设立为 OPS_GENIE,则必须声明此参数。

spec.prometheus

类型:文档

可选的

声明 Prometheus 第三方服务集成配置参数的文档。

如果将 spec.type 值设立为 PROMETHEUS,则必须声明此参数。

spec.prometheus.enabled

类型:字符串

可选的

用于启用 Prometheus 数据集合的开关。必须是 enabled 或 disabled。

如果将 spec.type 值设立为 PROMETHEUS,则必须声明此参数。

spec.prometheus.serviceDiscovery

类型:字符串

可选的

决定 Prometheus 如何发现服务的切换。必须设立为 http 或 file。

如果将 spec.type 值设立为 PROMETHEUS,则必须声明此参数。

spec.prometheus.prometheusCredentialsSecretRef.name

类型:字符串

可选的

包含 Prometheus用户名和密码的密钥。

如果将 spec.type 值设立为 PROMETHEUS,则必须声明此参数。

spec.slack

类型:文档

可选的

用于声明Slack第三方服务集成的配置参数的文档。

如果将 spec.type 值设立为 SLACK,则必须声明此参数。

spec.slack.apiTokenSecretRef.name

类型:字符串

可选的

包含Slack API令牌的密钥。

如果将 spec.type 值设立为 SLACK,则必须声明此参数。

spec.slack.channelName

类型:字符串

可选的

要与Atlas集成的Slack渠道的名称。

如果将 spec.type 值设立为 SLACK,则必须声明此参数。

spec.slack.teamName

类型:字符串

可选的

spec.slack.channelName 所属Slack团队的名称。

如果将 spec.type 值设立为 SLACK,则必须声明此参数。

spec.victorOps

类型:文档

可选的

声明 Victor Ops 第三方服务集成配置参数的文档。

如果将 spec.type 值设立为 VICTOR_OPS,则必须声明此参数。

spec.victorOps.apiKeySecretRef.name

类型:字符串

可选的

包含 Victor Ops 的API密钥的密钥。

如果将 spec.type 值设立为 VICTOR_OPS,则必须声明此参数。

spec.victorOps.routingKey

类型:字符串

可选的

Victor Ops 路由密钥。

如果将 spec.type 值设立为 VICTOR_OPS,则必须声明此参数。

spec.webhook.urlSecretRef.name

类型:字符串

可选的

包含 Webhook URL和密钥的密钥。