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

AtlasStreamConnection 自定义资源

AtlasStreamConnection 自定义资源用于配置Atlas Stream Processing 连接。您可以配置示例连接、与Atlas变更流的连接或与Apache Kafka系统的连接。

以下示例将一个连接添加到 stream processing 工作区的“连接注册表”中。要学习;了解更多信息,请参阅 托管 Atlas Stream Processing。

apiVersion: atlas.mongodb.com/v1
kind: AtlasStreamConnection
metadata:
name: my-stream-connection
spec:
name: sample_stream_solar
type: Sample

注意

如果您为spec.type参数指定Sample ,则spec.name参数必须与样本集合名称匹配。 目前,Atlas Kubernetes Operator 仅支持此自定义资源的sample_stream_solar样本集合。

apiVersion: atlas.mongodb.com/v1
kind: AtlasStreamConnection
metadata:
name: my-stream-connection
spec:
name: my-stream-connection
type: Cluster
clusterConfig:
name: my-cluster
role:
name: my-db-role
type: CUSTOM
apiVersion: atlas.mongodb.com/v1
kind: AtlasStreamConnection
metadata:
name: my-stream-connection
spec:
name: my-stream-connection
type: Kafka
kafkaConfig:
bootstrapServers: "comma,separated,list,of,server,addresses"
authentication:
mechanism: SCRAM-512
credentials:
name: ref-to-creds-secret
namespace: default
security:
protocol: SSL
certificate:
name: ref-to-certificate-secret
namespace: default

本部分介绍可用的AtlasStreamConnection参数。

spec.name

类型:字符串

必需

标识Atlas Stream Processing连接的名称。

注意

如果您为spec.type参数指定Sample ,则spec.name参数必须与样本集合名称匹配。 目前,Atlas Kubernetes Operator 仅支持此自定义资源的sample_stream_solar样本集合。

spec.type

类型:字符串

必需

指示连接类型的string 。 有效值包括:

  • Sample

  • Cluster

  • Kafka

spec.clusterConfig

类型:对象

可选的

Object that contains the configuration for the connection to an Atlas change stream. If you specified Cluster for the spec.type parameter, you must specify this setting.

spec.clusterConfig.name

类型:字符串

可选的

Name that identifies the connection to the Atlas change stream. If you specified Cluster for the spec.type parameter, you must specify this setting.

spec.clusterConfig.role

类型:字符串

可选的

Database role for the connection to the Atlas change stream. If you specified Cluster for the spec.type parameter, you must specify this setting.

spec.clusterConfig.role.name

类型:字符串

可选的

Name that identifies the database role for the connection to the Atlas change stream. If you specified Cluster for the spec.type parameter, you must specify this setting.

spec.clusterConfig.role.type

类型:字符串

可选的

string ,表示数据库角色的类型。 有效值包括:

  • BUILT_IN

  • CUSTOM

To learn more, see Configure Custom Database Roles.

spec.kafkaConfig

类型:对象

可选的

包含连接到Apache Kafka系统的配置的对象。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。

spec.kafkaConfig.bootstrapServers

类型:数组

可选的

以逗号分隔的服务器地址列表,用于连接到Apache Kafka系统。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。

spec.kafkaConfig.authentication

类型:对象

可选的

包含身份验证机制和档案配置的对象。 如果您为spec.type参数指定了Kafka ,则必须指定此设置。

spec.kafkaConfig.authentication.mechanism

类型:字符串

可选的

字符串,表示连接Apache Kafka系统的身份验证机制。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。有效值包括:

  • PLAIN

  • SCRAM-256

  • SCRAM-512

spec.kafkaConfig.authentication.credentials

类型:对象

可选的

对象,其中包含对包含身份验证凭证的密钥的引用。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。

spec.kafkaConfig.authentication.credentials.name

类型:字符串

可选的

包含身份验证凭证的不透明密钥的名称。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。

spec.kafkaConfig.authentication.credentials.namespace

类型:字符串

可选的

包含身份验证凭证的不透明密钥的命名空间。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。

spec.kafkaConfig.security

类型:对象

可选的

包含安全协议和证书配置的对象。 如果您为spec.type参数指定了Kafka ,则必须指定此设置。

spec.kafkaConfig.security.protocol

类型:字符串

可选的

字符串,表示连接到Apache Kafka系统的安全协议。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。有效值包括:

  • PLAIN

  • SSL

spec.kafkaConfig.security.certificate

类型:对象

可选的

包含安全证书配置的对象。 如果您为spec.type参数指定了Kafka ,则必须指定此设置。

spec.kafkaConfig.security.certificate.name

类型:字符串

可选的

包含安全证书的不透明密钥的名称。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。

spec.kafkaConfig.security.certificate.namespace

类型:字符串

可选的

包含安全证书的不透明密钥的命名空间。如果您为 spec.type 参数指定了 Kafka,则必须指定此设置。