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
独立 CRD 示例
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
AtlasThirdPartyIntegrationCustom 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
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集成的第三方服务的名称。此值必须是以下值之一:
DATADOGMICROSOFT_TEAMSNEW_RELICOPS_GENIEPAGER_DUTYPROMETHEUSSLACKVICTOR_OPSWEBHOOK
每个集成
type都需要一设立不同的配置字段。示例,如果将type设立为DATADOG,则必须仅配置spec.datadog文档及其子字段。要在同一项目中定义多个第三方集成,您必须为每个集成创建单独的 CRD。在给定项目中,每种集成类型只能定义一个实例。这既适用于此 CRD,也适用于
AtlasProjectCRD 的spec.integrations参数。
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.apiKeySecretRef.name类型:字符串
可选的
包含 Ops Genie API密钥的密钥。
如果将
spec.type值设立为OPS_GENIE,则必须声明此参数。
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,则必须声明此参数。