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

Kubernetes 演算子の認証情報の作成

Kubernetes Operator がCloud Managerまたは Ops Manager プロジェクト内のオブジェクトを作成または更新するには、プログラマティックAPIキーをシークレットストレージツールに保存する必要があります。

複数のシークレットが同じ名前空間に存在できます。 各ユーザーには独自のシークレットが必要です。

以下の手順に従って、プログラマティックAPIキーをKubernetes secret として手動で保存できます。または、次のこともできます。

Kubernetes Operator の認証情報を作成するには、次の手順を実行する必要があります。

  1. Have or create an Ops Manager Organization.

  2. Have or generate a Programmatic API Key.

  3. この新しいプログラマティック API キーを付与します。

    注意

    You must grant the Programmatic API Key the Organization Owner or Global Owner role. If you want to grant the Programmatic API Key only the Project Owner role, you must first create the project and then the Programmatic API Key for the project with the Project Owner role. The Kubernetes Operator can't create projects if the Programmatic API Key has only the Project Owner role.

  4. Add the IP or CIDR block of any hosts that serve the Kubernetes Operator to the API Access List.

Kubernetes シークレットを作成するには

1
  1. 目的のMongoDB Ops ManagerプログラマティックAPIキーの公開キーと秘密キーがあることを確認してください。

  2. 次の Kubernetes コマンドを呼び出してシークレットを作成します。

    kubectl -n <metadata.namespace> \
    create secret generic <mycredentials> \
    --from-literal="publicKey=<publicKey>" \
    --from-literal="privateKey=<privateKey>"

    -n フラグは、このシークレットが適用される名前空間を制限します。すべてのMongoDB Kubernetesリソースは、シークレット および ConfigMaps と同じ名前空間に存在する必要があります。Kubernetes Operator は、シークレットも ConfigMap も使用しません。

    注意

    このコマンドの非推奨バージョンでは、 publicKeyとprivateKeyではなく、 userとpublicApiKeyが指定されます。 Kubernetes Operator は認証にどちらのバージョンも受け入れます。

2

次の Kubernetes コマンドを呼び出して、シークレットを検証します。

kubectl describe secrets/<mycredentials> -n <metadata.namespace>

このコマンドは、shell 内のシークレットの説明を返します。

Name: <mycredentials>
Namespace: <metadata.namespace>
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
privateKey: 31 bytes
publicKey: 22 bytes
このページを評価

項目一覧