You can use Atlas Kubernetes Operator to manage stream processing workspaces and connections for Atlas Stream Processing. Atlas Stream Processing enables you to process streams of complex data using the same MongoDB Query API that Atlas databases use. Atlas Stream Processing allows you to do the following tasks:
构建聚合管道以持续处理流数据,而不会出现批处理中固有的延迟。
Perform continuous schema validation to check that messages are properly formed, detect message corruption, and detect late-arriving data.
持续将结果发布到Atlas集合或Apache Kafka集群,确保获得最新的数据视图和分析。
Atlas Stream Processing components belong directly to Atlas projects and operate independent of Atlas clusters. To learn more, see atlas-stream-processing.
Stream Processing 工作区和连接
Atlas Stream Processing工作区为流媒体数据上的所有操作提供上下文。您可以配置示例连接、与Atlas变更流的连接或与Apache Kafka系统的连接。然后,您可以将该连接添加到 stream processing 工作区的连接注册表中。要学习;了解更多信息,请参阅管理流处理工作区。
先决条件
要使用Atlas Kubernetes Operator管理流处理工作区和连接,您必须:
Have an Atlas user with the
Project Owneror theProject Stream Processing Ownerrole to manage a Connection Registry and Stream Processing Workspace. To learn more about the differences between the two roles, see Project Roles.拥有一个正在运行的 Kubernetes 集群,其中部署了 Atlas Kubernetes Operator。
确保您的IP解决位于组织的API访问权限列表中。
步骤
要使用Atlas Kubernetes Operator管理流处理工作区及其连接,请执行以下步骤:
配置 AtlasStreamWorkspace 自定义资源。
示例:
cat <<EOF | kubectl apply -f - apiVersion: atlas.mongodb.com/v1 kind: AtlasStreamWorkspace metadata: name: my-stream-workspace spec: name: my-stream-workspace clusterConfig: provider: AWS region: VIRGINIA_USA tier: SP30 projectRef: name: my-project EOF
要了解有关可用参数的更多信息,请参阅AtlasStreamWorkspace自定义资源。
注意
目前,Atlas Kubernetes Operator 仅支持此自定义资源的AWS提供程序和VIRGINIA_USA区域。
配置 AtlasStreamConnection 自定义资源。
您可以配置示例连接、与Atlas 变更流的连接或与Apache Kafka系统的连接。
例子:
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自定义资源。
将连接添加到AtlasStreamWorkspace 自定义资源中的连接注册表。
示例:
cat <<EOF | kubectl apply -f - apiVersion: atlas.mongodb.com/v1 kind: AtlasStreamWorkspace metadata: name: my-stream-workspace spec: name: my-stream-workspace clusterConfig: provider: AWS region: VIRGINIA_USA tier: SP30 projectRef: name: my-project connectionRegistry: - name: ref-my-connection-1 namespace: my-namespace1 - name: ref-my-connection-2 namespace: my-namespace2 - name: ref-my-connection-3 namespace: my-namespace1 EOF
注意
目前,Atlas Kubernetes Operator 仅支持此自定义资源的AWS提供程序和VIRGINIA_USA区域。
要了解有关可用参数的更多信息,请参阅AtlasStreamWorkspace自定义资源。