AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。

Atlas へのアクセスを設定する

Atlas APIに接続するために、Atlas Kubernetes Operator は Atlas Kubernetes Operator シークレット から組織IDとAPIキーを読み取ります。次の機能を設定することもできます。

Atlas アカウントの作成の詳細については、Atlas への登録とログイン を参照してください。

構成に応じて、Atlas Kubernetes Operator は、次の Atlas Kubernetes Operator シークレット のいずれかから読み取りを行います。

スコープ
ロケーション
説明

グローバル

Atlas Kubernetes <operator-deployment-name>-api-keyOperator をインストールしたのと同じ 名前空間 に作成された Atlas Kubernetes Operator シークレット 。

Atlas Kubernetes Operator は、AtlasProject カスタム リソース が spec.connectionSecretRef.name を指定しない限り、このシークレット データを使用して Atlas 管理API に接続します。

global Atlas Kubernetes Operator シークレットを使用すると、組織内のすべてのプロジェクトで1つのAPIキーを使用できます。新しいAtlasProjectカスタムリソースはすべて、同じAPIキーを使用してオーバーヘッドを削減します。

Atlas Kubernetes Operator 配置のデフォルト名は mongodb-atlas-operator です。したがって、シークレット の名前は mongodb-atlas-operator-api-key にする必要があります。

プロジェクト

カスタム リソース内のspec. connectionSecretRef.nameで参照される Atlas KubernetesAtlasProject Operator シークレット。

デフォルトでは 、Atlas Kubernetes Operator は カスタム AtlasProjectリソースと同じ名前空間に接続シークレットを保持します。シークレットを別の名前空間に保存するには、spec. connectionSecretRef を指定します。名前空間パラメータ。

Atlas Kubernetes Operator はこのシークレットデータを使用して、プロジェクトを参照する任意のAtlasDeployment カスタム リソースと AtlasDatabaseUser カスタムリソースの Atlas APIに接続します。

spec.connectionSecretRef.name を指定しない場合、Atlas Kubernetes Operator は global Atlas Kubernetes Operator シークレットを使用します。

Atlas Kubernetes Operator プロジェクトごとの シークレット により、より細かいアクセスが可能になります。単一の Atlas プロジェクトにアクセスするために、単一の API キーを使用したい場合があるかもしれません。

global と project のいずれのシークレットにも次の情報が必要です。

Parameter
説明

orgId

組織 を識別するために使用される一意の 24桁の 16 進数 。stringAtlas

publicAPIKey

privateAPIKey

Atlas Kubernetes Operator から Atlas へのアクセスを構成するには、次の公開 API キー、プライベート API キー、および組織 ID 情報が必要です。

Atlas への Atlas Kubernetes Operator アクセスを構成するには、次のいずれかの手順を実行します。

  • global Atlas Kubernetes Operator シークレット については、次のコマンドを実行します。

    注意

    global Atlas Kubernetes Operator シークレットの名前は、事前定義された形式に準拠している必要があります。Atlas Kubernetes Operator 配置のデフォルト名は mongodb-atlas-operator です。したがって、シークレット の名前は mongodb-atlas-operator-api-key にする必要があります。

    kubectl create secret generic mongodb-atlas-operator-api-key \ --from-literal="orgId=<the_atlas_organization_id>" \ --from-literal="publicApiKey=<the_atlas_api_public_key>" \ --from-literal="privateApiKey=<the_atlas_api_private_key>" \ -n <operator_namespace> kubectl label secret mongodb-atlas-operator-api-key atlas.mongodb.com/type=credentials -n mongodb-atlas-system
  • project Atlas Kubernetes Operator シークレット については、次のコマンドを実行します。

    kubectl create secret generic my-project-connection \ --from-literal="orgId=<the_atlas_organization_id>" \ --from-literal="publicApiKey=<the_atlas_api_public_key>" \ --from-literal="privateApiKey=<the_atlas_api_private_key>" \ -n <atlas_project_namespace> kubectl label secret mongodb-atlas-operator-api-key atlas.mongodb.com/type=credentials -n mongodb-atlas-system