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 管理API に接続します。

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

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 シークレット により、より細かいアクセスが可能になります。1 つの Atlas プロジェクトへのアクセスを持つために、1 つの認証情報が必要になる場合があります。

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 my-project-connection atlas.mongodb.com/type=credentials -n <atlas_project_namespace>