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

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

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

To learn more about creating an Atlas account, see Register and Log in to 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 Administration API に接続します。

global Atlas Kubernetes Operator secrets let you use one API key for all the projects in an organization. Any new AtlasProject Custom Resource uses the same API key for reduced overhead.

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

プロジェクト

Atlas Kubernetes Operator spec.connectionSecretRef.nameシークレットは、AtlasProject カスタム リソース内の で参照されます。

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

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

Public part of the API key.

privateAPIKey

Private part of the API key.

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