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システムへの接続を構成できます。次に、ストリーム処理ワークスペースの 接続レジストリ に接続を追加できます。詳しくは、Atlas 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.Atlas Kubernetes Operatorが配置された実行中の Kubernetes クラスターを用意します。
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カスタム リソースを参照してください。