注意
このページのMongoDB Ops Managerが表示されている場所では、 Cloud Managerを置き換えることができます。
MongoDB Controls for Kubernetes Operator は、ユーザーが書込んだ仕様ファイルからKubernetes State化し、
Kubernetes Operator は、Kubernetes 内の MongoDB 固有のリソースを カスタム リソースとして作成します。
これらのカスタム リソースを管理するには、次のプロセスを使用します。
MongoDBリソース仕様を作成または更新します。Kubernetes Operator 用のMongoDBパラメーターを使用して、 Kubernetes環境に適用します。その結果、 Kubernetes Operator は次のアクションを実行します。
定義された StateftSets、サービス、およびその他のKubernetesリソースを作成します。
変更を反映するようにMongoDB Ops Manager配置構成を更新します。
配置タイプ | StateftSets | ステートメントセットのサイズ |
|---|---|---|
スタンドアロン | 1 | 1 Pod |
レプリカセット | 1 | |
シャーディングされたクラスター | <numberOfShards> + 2 |
各 MongoDBリソースは、YAML のオブジェクト仕様を使用して、 MongoDBオブジェクト:スタンドアロン、レプリカセット、およびクラスターの特性と設定を定義します。
Common Resource Settings
すべてのリソース タイプでは、次の設定を使用する必要があります。
必須
spec.credentials型: string
必須。Cloud ManagerまたはMongoDB Ops Manager Manager と通信するためのKubernetes MongoDB Ops Manager API認証情報として作成したKubernetesシークレットの名前。
認証情報を保持するMongoDB Ops Manager Kubernetes Secretオブジェクトは、作成するリソースと同じ名前空間に存在する必要があります。
重要
演算子がシークレットへの変更を管理
Kubernetes Operator は、シークレットへの変更を追跡し、
MongoDBリソースの状態を調整します。
spec.persistentタイプ: ブール値
デフォルト: True
WARNING: Grant your containers permission to write to your Persistent Volume. The Kubernetes Operator sets
fsGroup = 2000,runAsUser = 2000, andrunAsNonRoot = trueinsecurityContext. Kubernetes Operator setsfsgroupequal torunAsUserto make the volume writable for a user that runs the main process in the container. To learn more, see Configure a Security Context for a Pod or Container and the related discussion in the Kubernetes documentation. If redeploying the resource doesn't fix issues with your Persistent Volume, contact MongoDB Support.If you do not use Persistent Volumes, the Disk Usage and Disk IOPS charts cannot be displayed in either the Processes tab on the Deployment page or in the Metrics page when reviewing the data for this deployment.
spec.version型: string
この
MongoDBリソースにインストールした MongoDB のバージョン。形式は、 MongoDB Community Editionでは
X.Y.Z、Enterprise エディションではX.Y.Z-entです。重要
互換性のある MongoDB Server バージョンを選択していることを確認してください。
互換性のあるバージョンは、MongoDB database リソースが使用する基本イメージによって異なります。
注意
If you update this value to a later version of MongoDB for your database resources, the feature compatibility version remains at the MongoDB version you're upgrading from to give you the option to downgrade if necessary. If you want the feature compatibility version to match the new MongoDB version, you must manually set
spec.featureCompatibilityVersionto the new version or toAlwaysMatchVersion. To learn more, seespec.featureCompatibilityVersion.
条件付き
すべてのリソースは、次のいずれかの設定を使用する必要があります。
spec.opsManager.configMapRef.name型: string
Name of the ConfigMap with the Cloud Manager or Ops Manager connection configuration. The
spec.cloudManager.configMapRef.namesetting is an alias for this setting and can be used in its place.この値は、作成するリソースと同じ名前空間に存在する必要があります。
重要
演算子が ConfigMap への変更を管理
Kubernetes 演算子は、ConfigMap への変更を追跡し、
MongoDBリソースの状態を調整します。
spec.cloudManager.configMapRef.name型: string
Alias for
spec.opsManager.configMapRef.name.
任意
すべてのリソースの種類では、次の設定を使用できます。
metadata.annotations.mongodb.com/v1.architecture型: string
具体的な配置で使用されるコンテナ アーキテクチャを決定します。
実行時に MongoDB バイナリをダウンロードするデフォルトの非静的コンテナ、または
実行時に不変である静的コンテナ(パブリック プレビュー) 。
指定できる値は次のとおりです。
staticnon-static
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-project annotations: mongodb.com/v1.architecture: "static"
spec.agent.backupAgent.logRotate.sizeThresholdMBタイプ: 整数
MongoDB Agent がログをローテーションする前のバックアップ ログファイルの最大サイズ(MB 単位)。
spec.agent.mongod.auditlogRotate.sizeThresholdMB型: string
ローテーション前の個別のログファイルの最大サイズ。string は float64 に変換できる必要があります。MB の小数値がサポートされています。
spec.agent.mongod.auditlogRotate.numTotalタイプ: 整数
MongoDB Ops Managerが保持する 監査ログ ファイルの合計数。 この値を設定しない場合、監査ログファイルの合計数はデフォルトで0になります。
spec.agent.mongod.auditlogRotate.percentOfDiskspace型: string
これらのログファイルが占有するディスク領域の合計の最大パーセンテージ。string は float64 に変換できる必要があります。
spec.agent.mongod.logRotate.sizeThresholdMB型: string
ローテーション前の個別のログファイルの最大サイズ。string は float64 に変換できる必要があります。MB の小数値がサポートされています。
spec.agent.mongod.logRotate.timeThresholdHrsタイプ: 整数
次のローテーションまでの個々のログファイルの最大期間(時間単位)。 は最後のローテーション以降の時間です。
Ops Manager rotates the log file once the file meets either this
timeThresholdHrsor thespec.agent.mongod.logRotate.sizeThresholdMB.
spec.agent.monitoringAgent.logRotate.sizeThresholdMBタイプ: 整数
MongoDB Agent が監視ログをローテーションする前の、個々のログファイルの最大サイズ(MB 単位)。
spec.agent.readinessProbe.environmentVariables型: オブジェクト
Readness Probe のログファイルを制御するために使用される次の環境変数を構成します。
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-project spec: agent: readinessProbe: environmentVariables: READINESS_PROBE_LOGGER_BACKUPS: 1 READINESS_PROBE_LOGGER_MAX_SIZE: 10 READINESS_PROBE_LOGGER_MAX_AGE: 3 READINESS_PROBE_LOGGER_COMPRESS: true MDB_WITH_AGENT_FILE_LOGGING: false LOG_FILE_PATH: /var/log/mongodb-mms-automation/readiness.log
spec.role型: string
Marks this resource as playing a special role for another MongoDB resource in Kubernetes. The only accepted value is
AppDB, which marks this resource as the externally managed Application Database for aMongoDBOpsManagerresource. When you omit this setting, the Kubernetes Operator manages the resource as an ordinary MongoDB deployment.To learn how to use an externally managed Application Database, see Back Up the Ops Manager Application Database.
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: primary-om-db spec: role: AppDB この設定は不変です。これは、リソースを作成する ときに設定する必要があります。それを 既存のリソースに追加することはできず、その後は変更または削除することはできません。
A resource that sets
spec.roletoAppDBmust meet the following requirements:spec.typemust beReplicaSet.spec.membersmust be3or greater.The resource must use a single Kubernetes cluster. The Kubernetes Operator rejects a
MongoDBMultiClusterresource and a MongoDB resource that uses a multi-cluster topology.The name of the resource must be
<MongoDBOpsManager-name>-db.If you configure
spec.security.authentication, you must enable it, set its modes toSCRAMonly, and setspec.security.authentication.ignoreUnknownUserstotrue. If you omit authentication settings, the Kubernetes Operator applies this configuration for you.
spec.featureCompatibilityVersion型: string
MongoDBのアップグレード後に、以前のメジャーMongoDBバージョンにデフォルト設定されます。
新しいメジャー バージョンへのアップグレードに関連して発生するデータの変更を制限します。 例、 MongoDB 5.0からMongoDB 6.0にアップグレードする場合、機能の互換性バージョンは5.0のままになり、必要に応じてダウングレードのオプションが提供されます。
機能の互換性バージョンを新しいMongoDBバージョンと一致させる場合は、
featureCompatibilityVersionを新しいバージョンに手動で設定する必要があります。 例、featureCompatibilityVersion: 6.0。または、
AlwaysMatchVersionオプションを有効にすると、アップグレード中に機能の互換性バージョンがMongoDBバージョンと一致するように自動的に更新されます。 例、featureCompatibilityVersion: AlwaysMatchVersion。To learn more about feature compatibility, see
setFeatureCompatibilityVersionin the MongoDB Manual.
spec.clusterDomain型: string
デフォルト: cluster.local
Domain name of the Kubernetes cluster where you deploy the Kubernetes Operator. When Kubernetes creates a StatefulSet, the Kubernetes assigns each Pod a FQDN. To update Cloud Manager or Ops Manager, the Kubernetes Operator calculates the FQDN for each Pod using a provided cluster name. Kubernetes doesn't provide an API to query these hostnames.
警告
You must set
spec.clusterDomainif your Kubernetes cluster has a default domain other than the defaultcluster.local. If you neither use the default nor set thespec.clusterDomainoption, the Kubernetes Operator might not function as expected.
spec.clusterName型: string
デフォルト: cluster.local
Domain name of the Kubernetes cluster where you deploy the Kubernetes Operator. When Kubernetes creates a StatefulSet, the Kubernetes assigns each Pod a FQDN. To update Cloud Manager or Ops Manager, the Kubernetes Operator calculates the FQDN for each Pod using a provided cluster name. Kubernetes doesn't provide an API to query these hostnames.
警告
You must set
spec.clusterDomainif your Kubernetes cluster has a default domain other than the defaultcluster.local. If you neither use the default nor set thespec.clusterDomainoption, the Kubernetes Operator might not function as expected.
metadata.namespace型: string
Kubernetes namespace where you create this
MongoDBresource and other objects.
spec.service型: string
デフォルト: <resource_name>+"-svc" および <resource_name>+"-svc-external"
Atlas App Servicesが作成または使用するKubernetesサービスの名前。この名前のサービスがすでに存在する場合、 MongoDB Controls for Kubernetes Operator はサービスを削除または再作成しません。この設定により、独自のカスタム サービスを作成し、 Kubernetes Operator でそれらを再利用できます。
spec.logLevel型: string
デフォルト: INFO
ポッド内でのオートメーションエージェントのログ記録のレベルを構成します。受け入れ可能な値は以下の通りです。
DEBUGINFOWARNERRORFATAL
配置固有のリソース設定
MongoDBリソース仕様で使用できる他の設定と使用する必要がある他の設定は、作成する MongoDB 配置アイテムによって異なります。
スタンドアロン設定
注意
すべてのスタンドアロン設定はレプリカセット リソースにも適用されます。
spec.additionalMongodConfigタイプ: コレクション
MongoDB プロセスを開始するための追加構成オプション。
Kubernetes Operator は、MongoDB Agent を通じて配置する MongoDB バージョンがサポートするすべての構成オプションをサポートしています。ただし、Kubernetes Operator は、次のいずれかのオプションに指定した値を上書きします。
Kubernetes Operator が所有する構成オプションの詳細については、「 MongoDB Kubernetes Operator 専用設定 」を参照してください。
使用できる構成オプションについては、 MongoDBドキュメントの「 配置の詳細オプションMongoDB Ops Manager 」を 参照してください。
spec.agent.startupOptionsタイプ: コレクション
MongoDB データベース リソースを起動する MongoDB Agent 設定。
MongoDB Agent 設定はキーと値のペアとして提供する必要があります。 値は文字列である必要があります。
サポートされている MongoDB Agent 設定のリストについては、以下を参照してください。
Cloud Manager プロジェクトのMongoDB Agent 設定。
OperatorMongoDB Agent を使用して配置したMongoDB Ops Manager バージョンの 設定 。Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-standalone 6 spec: 7 version: "8.0.0" 8 service: my-service 9 10 opsManager: 11 configMapRef: 12 name: my-project 13 credentials: my-credentials 14 type: Standalone 15 16 persistent: true 17 agent: 18 startupOptions: 19 maxLogFiles: "30" 20 dialTimeoutSeconds: "40" 21 ...
spec.podSpec型: オブジェクト
MongoDB CustomResourceDefinition ポッドの仕様を含むオブジェクト。
spec.externalAccessタイプ: コレクション
Specification to expose your cluster for external connections. To learn how to connect to your MongoDB resource from outside of the Kubernetes cluster, see Connect to a MongoDB Resource from Outside Kubernetes.
spec.externalAccessを追加すると、Kubernetes Operator はレプリカセット内の各ポッドの外部サービスを作成します。 外部サービスは、クラスター内の各 MongoDB database ポッドの外部エントリ ポイントを提供します。 各外部サービスには セレクター があります は、外部サービスを特定のポッドに一致させます。値なしでこの設定を追加すると、Kubernetes Operator は次のデフォルト値を持つ外部サービスを作成します。
フィールド値説明Name<pod-name>-svc-external外部サービスの名前。 この値は変更できません。
TypeLoadBalancer外部 LoadBalancer を作成します service
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.注意
If you set
spec.externalAccess.externalDomain, the external service adds another port (Port Number + 1) for backups.
spec.externalAccess.externalServiceタイプ: コレクション
Specification for overriding the default values in
spec.externalAccess.When you set the
spec.externalAccesssetting, the Kubernetes Operator automatically creates an external load balancer service with default values. You can override certain values or add new values depending on your needs. For example, if you intend to create NodePort services and don't need a load balancer, you must configure overrides in your Kubernetes specification:externalAccess: externalService: annotations: # cloud-specific annotations for the service spec: type: NodePort # default is LoadBalancer # you can specify other spec overrides if necessary Kubernetes仕様の詳細については、Kubernetesドキュメントの ServiceSpec を参照してください。
spec.externalAccess.externalService.annotationsタイプ: コレクション
配置内のすべてのクラスターにクラウドプロバイダー固有の構成設定を追加できるキーと値のペア。詳しくは、 「 Kubernetesクラウドプロバイダー 」の注釈とドキュメントを参照してください。
注釈 を使用して、 Kubernetes Operator 配置で使用される外部サービスのプレースホルダー値を指定できます。Kubernetes Operator は、これらの値を次の表に記載されている正しい値に自動的に置き換えます。プレースホルダーを使用すると、特定のポッドの各サービスに特定の注釈を提供できます。
値説明{resourceName}Equal to
metadata.name.{namespace}Equal to
metadata.namespace.{podIndex}StateftSet によって割り当てられ、現在の外部サービスが対象とする ポッドのインデックス。
{podName}{resourceName}-{podIndex}に等しい。{statefulSetName}The StatefulSet. Equal to
{resourceName}.{externalServiceName}指定したプレースホルダー値に基づいて、外部サービスの生成された名前。
{resourceName}-{podIndex}-svc-externalに等しい。{mongodProcessDomain}The domain name of the server that is hosting the mongod process. Equal to
spec.externalAccess.externalDomainif specified. Otherwise, equal to the domain used for themongodprocess FQDN.たとえば、プロセス ホスト名
mdb-rs-1.example.comの場合、example.comはドメイン名になります。{mongodProcessFQDN}The
mongodprocess hostname set in the automation configuration.The process hostname depends on your deployment configuration. If you've configured your deployment to use
external domains, the process hostname uses the following format:{resourceName}-{podIndex}.{mongodProcessDomain}以下に例を挙げます。
mdb-rs-1.example.com配置で外部ドメインを使用しない場合、プロセス ホスト名は次の形式を使用します。
{resourceName}-{podIndex}.{resourceName}-{podIndex}-svc.{namespace}.svc.cluster.local以下に例を挙げます。
mdb-rs-1.mdb-rs-1-svc.ns.svc.cluster.local注意
表に指定されている既知のプレースホルダー値のみを使用し、プレースホルダーが空または null 値を使用しないようにする必要があります。 また、単一の MongoDB リソース配置では、複数の Kubernetes クラスター配置に固有のプレースホルダーを使用することもできません。
それ以外の場合、Kubernetes Operator はエラーを返します。 たとえば、次のエラーメッセージが表示される場合があります。
error replacing placeholders in map with key=external-dns.alpha.kubernetes.io/hostname, value={resourceName}-{podIndex}-{unknownPlaceholder}.{clusterName}-{clusterIndex}.example.com: missing values for the following placeholders: {clusterName}, {clusterIndex}, {unknownPlaceholder}`` 例
次の例えでは、
{resourceName}、{podIndex}、{namespace}プレースホルダーを指定します。apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: mdb-rs namespace: ns spec: replicas: 3 externalAccess: externalService: annotations: external-dns.alpha.kubernetes.io/hostname: {resourceName}-{podIndex}-{namespace}.example.com Kubernetes Operator は、各プレースホルダーの適切な値に基づいて、外部サービスの注釈を自動的に入力します。 例:
mdb-rs-0-svc-external: annotations: external-dns.alpha.kubernetes.io/hostname: mdb-rs-0-ns.example.com mdb-rs-1-svc-external: annotations: external-dns.alpha.kubernetes.io/hostname: mdb-rs-1-ns.example.com mdb-rs-2-svc-external: annotations: external-dns.alpha.kubernetes.io/hostname: mdb-rs-2-ns.example.com
spec.externalAccess.externalService.specタイプ: コレクション
Configuration for the ServiceSpec. To learn more, see
spec.externalAccess.externalService.
spec.podSpec.persistence.singleタイプ: コレクション
Kubernetes Operator が 1 つの永続ボリューム要求を作成し、データ、ジャーナル、およびログの 3 つのすべてのディレクトリを同じ永続ボリュームにマウントします。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.multipleコレクションを設定できますが、両方は設定できません。
スカラーデータ型説明labelSelectorstring
storagestring
storageClassstring
永続的なボリューム要求 で指定されるストレージのタイプ 。このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.podSpec.persistence.multiple.dataタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします と は、データのディレクトリを独自の 永続ボリューム にマウントします。 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
Kubernetes ノード で使用可能である必要がある最小ストレージ容量 から、Kubernetes で スタンドアロン配置 をホストします。この値は、 JEDEC表記では、整数とそれに続くストレージの単位として表されます。
デフォルト値は 16Gi です。
たとえば、この
MongoDBリソースに60ギガバイトのストレージ容量が必要な場合は、この値を60Giに設定します。storageClassstring
スタンドアロン配置に必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.podSpec.persistence.multiple.journalタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします およびジャーナル用のディレクトリを独自の 永続ボリューム にマウントする 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
Kubernetes ノード で使用可能である必要がある最小ストレージ容量 から、Kubernetes で スタンドアロン配置 をホストします。この値は、 JEDEC表記では、整数とそれに続くストレージの単位として表されます。
デフォルト値は 1Gi です。
たとえば、この
MongoDBリソースに60ギガバイトのストレージ容量が必要な場合は、この値を60Giに設定します。storageClassstring
スタンドアロン配置に必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.podSpec.persistence.multiple.logsタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします および は、ログ用のディレクトリを独自の 永続ボリューム にマウントします。 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
Kubernetes ノード で使用可能である必要がある最小ストレージ容量 から、Kubernetes で スタンドアロン配置 をホストします。この値は、 JEDEC表記では、整数とそれに続くストレージの単位として表されます。
デフォルト値は 3Gi です。
たとえば、この
MongoDBリソースに60ギガバイトのストレージ容量が必要な場合は、この値を60Giに設定します。storageClassstring
スタンドアロン配置に必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.podSpec.podTemplateタイプ: コレクション
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for MongoDB database resources.
テンプレート値は、
spec.podSpecで指定された値よりも優先されます。注意
Kubernetes 演算子は、
spec.podSpec.podTemplateで指定したフィールドを検証しません。
spec.podSpec.podTemplate.metadataタイプ: コレクション
MongoDB Controls for Kubernetes Operator がMongoDBデータベースリソース用に作成するKubernetesポッドのメタデータ。
spec.podSpec.podTemplate.metadataに追加できるフィールドを確認するには、Kubernetes のドキュメント を参照してください。
spec.podSpec.podTemplate.specタイプ: コレクション
MongoDB Controls for Kubernetes Operator がMongoDBデータベースリソース用に作成するKubernetesポッドの仕様。
spec.podSpec.podTemplate.specに追加できるフィールドを確認するには、 Kubernetes PodSpec v1 Core API を参照してください。注意
spec.podSpec.podTemplate.spec.containersにコンテナを追加すると、Kubernetes Operator はそれらを Kubernetes ポッドに追加します。 これらのコンテナは、ポッド内の MongoDB database リソース コンテナに追加されます。この設定を使用して、各ポッドの CPU と RAM の割り当てを指定します。 例について Githubは、 のサンプルを参照してください。
spec.podSpec.podTemplate.spec.affinity.nodeAffinity型: 構造体
Kubernetes rule to place Pods for replica set on a specific range of nodes.
読み取りおよび書込みパフォーマンスを最適化するには、ノードの アフィニティ ルールを使用してノードを制限します 特定の ノード 上で を実行する 、または特定の ノード で の実行を優先する場合は 。
spec.podSpec.podTemplate.spec.affinity.podAffinity型: 構造体
Kubernetes rule to determine whether multiple
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
レプリカセット設定
注意
すべてのスタンドアロン設定はレプリカセット リソースにも適用されます。
レプリカセットのリソース タイプには次の設定が適用されます。
spec.backupタイプ: コレクション
The collection container for
spec.backup.mode, which enables continuous backups for MongoDB resources in Kubernetes Operator.
spec.backup.assignmentLabelsタイプ: 配列
バックアップデーモン、 oplogストア、ブロックストア、S3 スナップショット ストア、ファイルシステム ストアを特定のプロジェクトまたはグループに割り当てるためのラベルのコンマ区切りリスト。割り当てラベル を使用して、特定のバックアップストアが特定のプロジェクトに関連付けられていることを識別します。
Kubernetes Operator を使用して割り当てラベルを設定すると、割り当てラベルのKubernetes構成ファイルで設定した値が、 MongoDB Ops Manager UI で定義された値を上書きします。 Kubernetes Operator を使用して設定しない割り当てラベルは、 MongoDB Ops Manager UI で設定された値を引き続き使用します。
注意
If you set this parameter, the API key linked with the value of
spec.credentialsmust have aGlobal Ownerrole.
spec.backup.mode型: string
MongoDB リソースの継続的なバックアップを有効にします。 指定できる値は、
enabled、disabled、terminatedです。注意
The
spec.backup.modesetting relies on Backup that is enabled in the Ops Manager and requires thatspec.backup.enabledvalue in the Ops Manager resource specification is set totrue.After you enable continuous backups for your MongoDB resource with
spec.backup.mode, you can check the backup status.
spec.backup.encryption.kmip型: オブジェクト
KMIPバックアップ暗号化の構成設定を含むオブジェクトです。 詳細については、「 MongoDB Ops Managerの KMIP バックアップ暗号化の構成 」を参照してください。
spec.backup.snapshotScheduleタイプ: コレクション
Kubernetes Operator の MongoDB リソースの継続的なバックアップのスナップショット スケジュール設定のコレクション コンテナ。
spec.backup.snapshotSchedule.dailySnapshotRetentionDaysタイプ: 数値
日次スナップショットを保持する日数。
1から365までの値を設定できます。 値を0に設定すると、このルールが無効になります。
spec.backup.snapshotSchedule.weeklySnapshotRetentionWeeksタイプ: 数値
Number of weeks to keep weekly snapshots.
1から52までの値を設定できます。 値を0に設定すると、このルールが無効になります。
spec.backup.snapshotSchedule.monthlySnapshotRetentionMonthsタイプ: 数値
月次スナップショットを保持する月数。
1から36までの値を設定できます。 値を0に設定すると、このルールが無効になります。
spec.backup.snapshotSchedule.referenceHourOfDayタイプ: 数値
時刻の UTC 時間で、24 時間制でスナップショットをスケジュールする。
0から23までの値を設定できます。
spec.backup.snapshotSchedule.referenceMinuteOfHourタイプ: 数値
UTC minute of the hour to schedule snapshots. You can set a value between
0and59, inclusive.
spec.backup.snapshotSchedule.fullIncrementalDayOfWeek型: string
MongoDB Ops Managerが完全なスナップショットを取得する曜日。 この設定により、最新の完全なバックアップが保証されます。 MongoDB Ops Manager はデフォルト値を
SUNDAYに設定します。
spec.clusterName型: string
デフォルト: cluster.local
Domain name of the Kubernetes cluster where you deploy the Kubernetes Operator. When Kubernetes creates a StatefulSet, the Kubernetes assigns each Pod a FQDN. To update Cloud Manager or Ops Manager, the Kubernetes Operator calculates the FQDN for each Pod using a provided cluster name. Kubernetes doesn't provide an API to query these hostnames.
警告
You must set
spec.clusterDomainif your Kubernetes cluster has a default domain other than the defaultcluster.local. If you neither use the default nor set thespec.clusterDomainoption, the Kubernetes Operator might not function as expected.
spec.connectivity.replicaSetHorizonsタイプ: コレクション
クライアント アプリケーションと MongoDB エージェントに対して異なるDNS設定を提供できます。 Kubernetes Operator は、レプリカセット ノードに スプリット ホライゾンDNSを使用します。 この機能により、Kubernetes クラスター内と Kubernetes 外部からの両方で通信が可能になります。
ホストごとに複数の外部マッピングを追加できます。
スプリットホライゾンの要件:
この配列内の各値が一意であることを確認してください。
Make sure that the number of entries in this array matches the value given in
spec.members.Provide a value for the
spec.security.certsSecretPrefixsetting to enable TLS. This method to use split horizons requires the Server Name Indication extension of the TLS protocol.
例
この例では、レプリカセットのメンバーは
example-localhostホライゾンで相互に通信します。 クライアントはexample-websiteホライゾンを使用してレプリカセットと通信します。記載されているホライゾンの名前は、この例では任意です。 ホライゾンには任意の名前を付けることができますが、そのホライゾンの名前が、そのホライゾンの一部であるすべてのホスト名と同じであることを確認してください。
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: <my-replica-set> 6 spec: 7 members: 3 8 version: "8.0.0" 9 type: ReplicaSet 10 opsManager: 11 configMapRef: 12 name: <configMap.metadata.name> 13 credentials: <mycredentials> 14 persistent: true 15 security: 16 tls: 17 enabled: true 18 connectivity: 19 replicaSetHorizons: 20 - "example-website": "web1.example.com:30907" 21 - "example-website": "web2.example.com:32350" 22 - "example-website": "web3.example.com:31185" 23 ...
spec.externalAccess.externalDomain型: string
レプリカセットの配置を外部で公開するために使用される外部ドメイン。
By default, each replica set member uses the Kubernetes Pod's FQDN (
*.svc.cluster.local) as the default hostname. However, if you add an external domain to this setting, the replica set uses a hostname that is a subdomain of the specified domain instead. This hostname uses the following format:<replica-set-name>-<pod-idx>.<externalDomain>以下に例を挙げます。
replica-set-1.example.comAfter you deploy the replica set with this setting, the Kubernetes Operator uses the hostname with the external domain to override the
processes[n].hostnamefield in the Ops Manager automation configuration. Then, the MongoDB Agent uses this hostname to connect tomongod.To specify other hostnames for connecting to the replica set, you can use the
spec.connectivity.replicaSetHorizonssetting. However, the following connections still use the hostname with the external domain:The MongoDB Agent to connect to
mongod.
WARNING: Specifying this field changes how Ops Manager registers
mongodprocesses. You can't change the value of this field or anyprocesses[n].hostnamefields in the Ops Manager automation configuration for a running replica set deployment.
spec.memberConfigタイプ: コレクション
MongoDBリソースから配置された各 MongoDB レプリカセット ノードの仕様。配列内の要素の順序は、レプリカセット内のノードの順序を反映する必要があります。 たとえば、 配列の最初の要素はインデックス
0の ポッドに影響し、2 番目の要素はインデックス1に影響するなどします。例
3 つのノードからなるレプリカセットの次の仕様例を検討してみましょう。
spec: memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod" - votes: 1 priority: "1.5" tags: tag2: "value2" environment: "prod" - votes: 0 priority: "0.5" tags: tag2: "value2" environment: "prod"
spec.memberConfig.priority型: string
MongoDBレプリカセットのメンバーがプライマリになる相対的な可能性を示す数値。
レプリカセット メンバーがプライマリになる相対的な可能性を高めるには、
priorityの値を高く指定します。レプリカセット メンバーがプライマリになる相対的な可能性を減らすには、
priorityの値を低く指定します。
たとえば、
memberConfig.priorityが1.5のメンバーは、memberConfig.priorityが0.5のメンバーよりも多く、プライマリになる可能性が高くなります。かつ
memberConfig.priorityが0のノードはプライマリになる資格がありません。 詳しくは、「メンバーの優先順位 」を参照してください。
spec.memberConfig.tagsタイプ: map
MongoDB レプリカセットの特定のノードに読み取りおよび書込み (write) 操作を指示するためのレプリカセット タグのマップ。
spec.memberConfig.votesタイプ: 数値
Determines whether a MongoDB replica set member can vote in an election. Set to
1to allow the member to vote. Set to0to exclude the member from an election.
次の設定はレプリカセットのリソースタイプにのみ適用されます。
spec.backup.autoTerminateOnDeletionタイプ: ブール値
Flag that controls whether the Kubernetes Operator stops and terminates the backup when you delete a MongoDB resource. If omitted, the default value is
false. Setting this flag totrueis useful when you want to delete the MongoDB custom resource while thespec.backup.modesetting is set toenabled.
シャーディングされたクラスターの設定
注意
すべてのレプリカセット設定は、特に指定がない限り、シャーディングされたクラスター リソースにも適用されます。
次の設定は、シャーディングされたクラスターのリソース タイプにのみ適用されます。
spec.backup.snapshotSchedule.clusterCheckpointIntervalMinタイプ: 数値
連続するクラスター チェックポイント間の分数。 この設定は、 MongoDBを機能の互換性バージョン7.0またはそれ以前のバージョンで実行するシャーディングされたクラスターにのみ適用されます。 この数値により、シャーディングされたクラスターのポイントインタイム復元の粒度が決まります。
15、30、または60の値を設定できます。
spec.configSrv.additionalMongodConfigタイプ: コレクション
Additional configuration options with which you want to start each config server member.
Kubernetes Operator は、MongoDB Agent を通じて配置する MongoDB バージョンがサポートするすべての構成オプションをサポートしています。ただし、Kubernetes Operator は、次のいずれかのオプションに指定した値を上書きします。
Kubernetes Operator が所有する構成オプションの詳細については、「 MongoDB Kubernetes Operator 専用設定 」を参照してください。
使用できる構成オプションについては、 MongoDBドキュメントの「 配置の詳細オプションMongoDB Ops Manager 」を 参照してください。
spec.configSrv.agentタイプ: コレクション
各コンフィギュレーションサーバーノードの MongoDB Agent 構成設定。
spec.configSrv.agent.startupOptionsタイプ: コレクション
各コンフィギュレーションサーバー ノードを起動する MongoDB Agent 設定。
MongoDB Agent 設定はキーと値のペアとして提供する必要があります。 値は文字列である必要があります。
サポートされている MongoDB Agent 設定のリストについては、以下を参照してください。
Cloud Manager プロジェクトのMongoDB Agent 設定。
OperatorMongoDB Agent を使用して配置したMongoDB Ops Manager バージョンの 設定 。Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-sharded-cluster-options 6 spec: 7 version: "8.0.0" 8 type: ShardedCluster 9 opsManager: 10 configMapRef: 11 name: my-project 12 credentials: my-credentials 13 persistent: true 14 shardCount: 2 15 mongodsPerShardCount: 3 16 mongosCount: 2 17 configServerCount: 1 18 19 mongos: 20 agent: 21 startupOptions: 22 maxLogFiles: "30" 23 24 configSrv: 25 agent: 26 startupOptions: 27 dialTimeoutSeconds: "40" 28 shard: 29 agent: 30 startupOptions: 31 serverSelectionTimeoutSeconds: "20" 32 ...
spec.configSrvPodSpec型: オブジェクト
MongoDB CustomResourceDefinitionコンフィギュレーションサーバーポッドの仕様を含むオブジェクト。
spec.configSrvPodSpec.persistence.singleタイプ: コレクション
Kubernetes Operator が 1 つの永続ボリューム要求を作成し、データ、ジャーナル、およびログの 3 つのすべてのディレクトリを同じ永続ボリュームにマウントします。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.multipleコレクションを設定できますが、両方は設定できません。
スカラーデータ型説明labelSelectorstring
storagestring
storageClassstring
永続的なボリューム要求 で指定されるストレージのタイプ 。このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.configSrvPodSpec.persistence.multiple.dataタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします と は、データのディレクトリを独自の 永続ボリューム にマウントします。 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
storageClassstring
各コンフィギュレーションサーバー ノードに必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.configSrvPodSpec.persistence.multiple.journalタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします およびジャーナル用のディレクトリを独自の 永続ボリューム にマウントする 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
storageClassstring
各コンフィギュレーションサーバー ノードに必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.configSrvPodSpec.persistence.multiple.logsタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします および は、ログ用のディレクトリを独自の 永続ボリューム にマウントします。 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
storageClassstring
各コンフィギュレーションサーバー ノードに必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.configSrvPodSpec.podTemplateタイプ: コレクション
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each config server member.
テンプレート値は、
spec.configSrvPodSpecで指定された値よりも優先されます。注意
Kubernetes 演算子は、
spec.configSrvPodSpec.podTemplateで指定したフィールドを検証しません。
spec.configSrvPodSpec.podTemplate.metadataタイプ: コレクション
MongoDB Controls for Kubernetes Operator が各コンフィギュレーションサーバーノードに対して作成するKubernetesポッドのメタデータ。
spec.configSrvPodSpec.podTemplate.metadataに追加できるフィールドを確認するには、Kubernetes のドキュメント を参照してください。
spec.configSrvPodSpec.podTemplate.specタイプ: コレクション
MongoDB Controls for Kubernetes Operator が各コンフィギュレーションサーバーノードに対して作成するKubernetesポッドの仕様。
To review which fields you can add to
spec.configSrvPodSpec.podTemplate.spec, see the Kubernetes PodSpec v1 core API.注意
spec.configSrvPodSpec.podTemplate.spec.containersにコンテナを追加すると、Kubernetes Operator はそれらを Kubernetes ポッドに追加します。 これらのコンテナは、ポッド内の各コンフィギュレーションサーバー ノードコンテナに追加されます。この設定を使用して、各ポッドの CPU と RAM の割り当てを指定します。 例について Githubは、 のサンプルを参照してください。
spec.configSrvPodSpec.podTemplate.spec.affinity.podAffinityタイプ: コレクション
Kubernetes rule to determine whether multiple
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
spec.configSrvPodSpec.podTemplate.spec.affinity.nodeAffinityタイプ: コレクション
Kubernetes rule to place Pods for replica set on a specific range of nodes.
読み取りおよび書込みパフォーマンスを最適化するには、ノードの アフィニティ ルールを使用してノードを制限します 特定の ノード 上で を実行する 、または特定の ノード で の実行を優先する場合は 。
spec.configSrvPodSpec.podTemplate.spec.affinity.podAntiAffinity型: string
Default: kubernetes.io/hostname
Sets a rule to spread Pods hosting
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.configSrvPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey型: string
Default: kubernetes.io/hostname
spec.mongodsPerShardCountタイプ: 整数
Required. Number of members per shard.
spec.mongosCountタイプ: 整数
Required. Number of
mongosinstances in the sharded cluster.
spec.mongos.additionalMongodConfigタイプ: コレクション
各 mongos インスタンスを起動するための追加 構成オプション 。
Kubernetes Operator は、MongoDB Agent を通じて配置する MongoDB バージョンがサポートするすべての構成オプションをサポートしています。ただし、Kubernetes Operator は、次のいずれかのオプションに指定した値を上書きします。
Kubernetes Operator が所有する構成オプションの詳細については、「 MongoDB Kubernetes Operator 専用設定 」を参照してください。
使用できる構成オプションについては、 MongoDBドキュメントの「 配置の詳細オプションMongoDB Ops Manager 」を 参照してください。
spec.mongos.agentタイプ: コレクション
MongoDB Agent configuration settings for each
mongosinstance.
spec.mongos.agent.startupOptionsタイプ: コレクション
MongoDB Agent settings with which you want to start each
mongosinstance.MongoDB Agent 設定はキーと値のペアとして提供する必要があります。 値は文字列である必要があります。
サポートされている MongoDB Agent 設定のリストについては、以下を参照してください。
Cloud Manager プロジェクトのMongoDB Agent 設定。
OperatorMongoDB Agent を使用して配置したMongoDB Ops Manager バージョンの 設定 。Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-sharded-cluster-options 6 spec: 7 version: "8.0.0" 8 type: ShardedCluster 9 opsManager: 10 configMapRef: 11 name: my-project 12 credentials: my-credentials 13 persistent: true 14 shardCount: 2 15 mongodsPerShardCount: 3 16 mongosCount: 2 17 configServerCount: 1 18 19 mongos: 20 agent: 21 startupOptions: 22 maxLogFiles: "30" 23 24 configSrv: 25 agent: 26 startupOptions: 27 dialTimeoutSeconds: "40" 28 shard: 29 agent: 30 startupOptions: 31 serverSelectionTimeoutSeconds: "20" 32 ...
spec.mongosPodSpec型: オブジェクト
MongoDB CustomResourceDefinition mongos ポッドの仕様を含むオブジェクト。
spec.mongosPodSpec.podTemplateタイプ: コレクション
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each
mongosinstance.テンプレート値は、
spec.mongosPodSpecで指定された値よりも優先されます。注意
Kubernetes 演算子は、
spec.mongosPodSpec.podTemplateで指定したフィールドを検証しません。
spec.mongosPodSpec.podTemplate.metadataタイプ: コレクション
Metadata for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each
mongosinstance.spec.mongosPodSpec.podTemplate.metadataに追加できるフィールドを確認するには、Kubernetes のドキュメント を参照してください。
spec.mongosPodSpec.podTemplate.specタイプ: コレクション
Specifications of the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each
mongosinstance.To review which fields you can add to
spec.mongosPodSpec.podTemplate.spec, see the Kubernetes PodSpec v1 core API.注意
When you add containers to
spec.mongosPodSpec.podTemplate.spec.containers, the Kubernetes Operator adds them to the Kubernetes pod. These containers are appended to eachmongosinstance containers in the pod.この設定を使用して、各ポッドの CPU と RAM の割り当てを指定します。 例について Githubは、 のサンプルを参照してください。
spec.mongosPodSpec.podTemplate.spec.affinity.podAffinityタイプ: コレクション
Optional. Kubernetes rule to determine if multiple
MongoDBresource Pods must be co-located with other Pods.
spec.mongosPodSpec.podTemplate.spec.affinity.nodeAffinityタイプ: コレクション
Kubernetes rule to place Pods for replica set on a specific range of nodes.
読み取りおよび書込みパフォーマンスを最適化するには、ノードの アフィニティ ルールを使用してノードを制限します 特定の ノード 上で を実行する 、または特定の ノード で の実行を優先する場合は 。
spec.mongosPodSpec.podTemplate.spec.affinity.podAntiAffinity型: string
Default: kubernetes.io/hostname
Sets a rule to spread Pods hosting
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.mongosPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey型: string
Default: kubernetes.io/hostname
spec.shardCountタイプ: 整数
必須。 シャーディングされたクラスター内の シャード の数。
spec.shard.additionalMongodConfigタイプ: コレクション
各シャーディングされた クラスター のシャード ノードを起動するための追加 構成オプション 。
Kubernetes Operator は、MongoDB Agent を通じて配置する MongoDB バージョンがサポートするすべての構成オプションをサポートしています。ただし、Kubernetes Operator は、次のいずれかのオプションに指定した値を上書きします。
Kubernetes Operator が所有する構成オプションの詳細については、「 MongoDB Kubernetes Operator 専用設定 」を参照してください。
使用できる構成オプションについては、 MongoDBドキュメントの「 配置の詳細オプションMongoDB Ops Manager 」を 参照してください。
spec.shard.agentタイプ: コレクション
各シャーディングされたクラスターのシャード ノードの MongoDB Agent の構成設定。
spec.shard.agent.startupOptionsタイプ: コレクション
各シャーディングされたクラスターのシャード ノードを起動する MongoDB Agent 設定。
MongoDB Agent 設定はキーと値のペアとして提供する必要があります。 値は文字列である必要があります。
サポートされている MongoDB Agent 設定のリストについては、以下を参照してください。
Cloud Manager プロジェクトのMongoDB Agent 設定。
OperatorMongoDB Agent を使用して配置したMongoDB Ops Manager バージョンの 設定 。Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-sharded-cluster-options 6 spec: 7 version: "8.0.0" 8 type: ShardedCluster 9 opsManager: 10 configMapRef: 11 name: my-project 12 credentials: my-credentials 13 persistent: true 14 shardCount: 2 15 mongodsPerShardCount: 3 16 mongosCount: 2 17 configServerCount: 1 18 19 mongos: 20 agent: 21 startupOptions: 22 maxLogFiles: "30" 23 24 configSrv: 25 agent: 26 startupOptions: 27 dialTimeoutSeconds: "40" 28 shard: 29 agent: 30 startupOptions: 31 serverSelectionTimeoutSeconds: "20" 32 ...
spec.shardPodSpec型: オブジェクト
MongoDB CustomResourceDefinition の仕様を含むオブジェクト シャード ポッド。
spec.shardPodSpec.persistence.multiple.dataタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします と は、データのディレクトリを独自の 永続ボリューム にマウントします。 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
Kubernetes ノード で使用可能である必要がある最小ストレージ容量 各シャーディングされた クラスター のシャード ノードを Kubernetes でホストします。この値は、 JEDEC表記では、整数とそれに続くストレージの単位として表されます。
デフォルト値は 16Gi です。
たとえば、この
MongoDBリソースに60ギガバイトのストレージ容量が必要な場合は、この値を60Giに設定します。storageClassstring
各シャーディングされたクラスターのシャード ノードに必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.shardPodSpec.persistence.multiple.journalタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします およびジャーナル用のディレクトリを独自の 永続ボリューム にマウントする 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
Kubernetes ノード で使用可能である必要がある最小ストレージ容量 各シャーディングされた クラスター のシャード ノードを Kubernetes でホストします。この値は、 JEDEC表記では、整数とそれに続くストレージの単位として表されます。
デフォルト値は 1Gi です。
たとえば、この
MongoDBリソースに60ギガバイトのストレージ容量が必要な場合は、この値を60Giに設定します。storageClassstring
各シャーディングされたクラスターのシャード ノードに必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.shardPodSpec.persistence.multiple.logsタイプ: コレクション
Kubernetes Operator が 永続的なボリューム要求 を作成するようにします および は、ログ用のディレクトリを独自の 永続ボリューム にマウントします。 。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.singleコレクションを設定できますが、両方を設定することはできません。
スカラーデータ型説明labelSelectorstring
storagestring
Kubernetes ノード で使用可能である必要がある最小ストレージ容量 各シャーディングされた クラスター のシャード ノードを Kubernetes でホストします。この値は、 JEDEC表記では、整数とそれに続くストレージの単位として表されます。
デフォルト値は 3Gi です。
たとえば、この
MongoDBリソースに60ギガバイトのストレージ容量が必要な場合は、この値を60Giに設定します。storageClassstring
各シャーディングされたクラスターのシャード ノードに必要なストレージのタイプ。 このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.shardPodSpec.podTemplateタイプ: コレクション
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each sharded cluster shard member.
テンプレート値は、
spec.shardPodSpecで指定された値よりも優先されます。注意
Kubernetes 演算子は、
spec.shardPodSpec.podTemplateで指定したフィールドを検証しません。
spec.shardPodSpec.podTemplate.metadataタイプ: コレクション
MongoDB Controls for Kubernetes Operator が各シャーディングされたクラスターのシャード ノードに対して作成するKubernetesポッドのメタデータ。
spec.shardPodSpec.podTemplate.metadataに追加できるフィールドを確認するには、Kubernetes のドキュメント を参照してください。
spec.shardPodSpec.podTemplate.specタイプ: コレクション
MongoDB Controls for Kubernetes Operator が各シャーディングされたクラスターのシャード ノードに対して作成するKubernetesポッドの仕様。
To review which fields you can add to
spec.shardPodSpec.podTemplate.spec, see the Kubernetes PodSpec v1 core API.注意
spec.shardPodSpec.podTemplate.spec.containersにコンテナを追加すると、Kubernetes Operator はそれらを Kubernetes ポッドに追加します。 これらのコンテナは、ポッド内の各シャーディングされたクラスターのシャード ノードのコンテナに追加されます。この設定を使用して、各ポッドの CPU と RAM の割り当てを指定します。 例について Githubは、 のサンプルを参照してください。
spec.shardPodSpec.podTemplate.spec.affinity.podAffinity型: string
Kubernetes rule to determine whether multiple
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
spec.shardPodSpec.podTemplate.spec.affinity.nodeAffinity型: string
Kubernetes rule to place Pods for replica set on a specific range of nodes.
読み取りおよび書込みパフォーマンスを最適化するには、ノードの アフィニティ ルールを使用してノードを制限します 特定の ノード 上で を実行する 、または特定の ノード で の実行を優先する場合は 。
spec.shardPodSpec.podTemplate.spec.affinity.podAntiAffinity型: string
Default: kubernetes.io/hostname
Sets a rule to spread Pods hosting
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.shardPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey型: string
Default: kubernetes.io/hostname
spec.shardSpecificPodSpecタイプ: 配列
ステートメント を含むリスト は、シャードごとに上書きします。
spec.shardSpecificPodSpec.podTemplateタイプ: コレクション
MongoDB Controls for Kubernetes Operator が特定のシャードに対して作成するKubernetesポッドのテンプレート。
テンプレート値は、
spec.shardSpecificPodSpecで指定された値よりも優先されます。注意
Kubernetes 演算子は、
spec.shardSpecificPodSpec.podTemplateで指定したフィールドを検証しません。
spec.shardSpecificPodSpec.podTemplate.metadataタイプ: コレクション
MongoDB Controls for Kubernetes Operator が特定のシャードに対して作成するKubernetesポッドのメタデータ。
spec.shardSpecificPodSpec.podTemplate.metadataに追加できるフィールドを確認するには、Kubernetes のドキュメント を参照してください。
spec.shardSpecificPodSpec.podTemplate.specタイプ: コレクション
MongoDB Controls for Kubernetes Operator が特定のシャードに対して作成するKubernetesポッドの仕様。
To review which fields you can add to
spec.shardSpecificPodSpec.podTemplate.spec, see the Kubernetes PodSpec v1 core API.注意
spec.shardSpecificPodSpec.podTemplate.spec.containersにコンテナを追加すると、Kubernetes Operator はそれらを Kubernetes ポッドに追加します。 これらのコンテナは、ポッド内の特定のシャード コンテナに追加されます。この設定を使用して、各ポッドの CPU と RAM の割り当てを指定します。 例について Githubは、 のサンプルを参照してください。
spec.shardSpecificPodSpec.podTemplate.spec.affinity.podAffinity型: string
Kubernetes rule to determine whether multiple
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
spec.shardSpecificPodSpec.podTemplate.spec.affinity.podAntiAffinity型: string
Default: kubernetes.io/hostname
Sets a rule to spread Pods hosting
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.shardSpecificPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey型: string
Default: kubernetes.io/hostname
spec.topology型: string
任意
デフォルト:
SingleClusterシャーディングされたシャーディングされたクラスターのトポロジーを定義します。 既存の配置では変更できません。
MultiClusterに設定されている場合:すべてのシャーディングされたクラスターコンポーネントには
clusterSpecListが定義されている必要があります。spec.mongos.clusterSpecListspec.configSrv.clusterSpecListspec.shard.clusterSpecList
次のフィールドは無視され、
spec.<section>.clusterSpecListオブジェクト内の各クラスターに同等の値が渡されます。spec.mongodsPerShardCountは で定義されていますspec.shard.clusterSpecList.membersspec.mongosCountは で定義されていますspec.mongos.clusterSpecList.membersspec.configServerCountは で定義されていますspec.configSrv.clusterSpecList.membersspec.shardOverrides.memberConfigは で定義されていますspec.shardOverrides.clusterSpecList.memberConfigspec.shardOverrides.membersは で定義されていますspec.shardOverrides.clusterSpecList.membersspec.shardOverrides.statefulSetは で定義されていますspec.shardOverrides.clusterSpecList.statefulSet
例:
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: sc spec: shardCount: 3 # we don't specify mongodsPerShardCount, mongosCount and configServerCount as they don't make sense for multi-cluster topology: MultiCluster type: ShardedCluster version: 7.0.12 cloudManager: configMapRef: name: my-project credentials: my-credentials persistent: true shard: clusterSpecList: - clusterName: member-cluster-0 members: 2 # each shard will have 2 members in cluster 0, unless overriden - clusterName: member-cluster-1 members: 2 - clusterName: member-cluster-2 members: 1 shardOverrides: - shardNames: [sc-2] # this override will apply to the third shard (here, shards are indexed from 0 to 2 as we have 3 shards) clusterSpecList: - clusterName: member-cluster-0 # all other fields are optional, if not provided the fields from matching member cluster from shard.clusterSpecList will be taken by default members: 3 - clusterName: member-cluster-1 # we don't deploy this shard to member-cluster-1 # Note that it is also possible to make it explicit with members: 0 # we don't provide entry for clusterName: member-cluster-1, so it won't be deployed there - clusterName: member-cluster-2 members: 2 configSrv: clusterSpecList: - clusterName: member-cluster-0 members: 2 # config server will have 2 members in this cluster - clusterName: member-cluster-1 members: 1 - clusterName: member-cluster-2 members: 2 mongos: clusterSpecList: - clusterName: member-cluster-0 members: 2 # router will have 2 members in this cluster - clusterName: member-cluster-1 members: 1 次のフィールドは、
topology=MultiClusterが実行される配置にのみ関連します。spec.configSrv.clusterSpecList注意
このフィールドは、マルチクラスターのシャーディングされたクラスターの配置でのみ使用できます。
タイプ: オブジェクトの配列
必須
topology=MultiClusterの場合)次の最上位フィールドを持つマルチクラスターのシャーディングされたクラスター配置で使用するオブジェクトの配列。
clusterName型: string
MongoDB Controls for Kubernetes Operator が StateftSet をスケジュールするクラスターの名前。
externalAccessタイプ: コレクション
マルチ Kubernetes クラスター MongoDB 配置を外部接続用に公開するための仕様。 Kubernetes クラスターの外部からマルチ Kubernetes クラスター MongoDB 配置に接続する方法については、「 Kubernetes 外部からマルチクラスター リソースに接続する 」を参照してください。
これらの設定は、すべてのクラスターのサービスに適用されます。 特定のクラスターでこれらのグローバル設定をオーバーライドするには、 spec.clusterSpecList.externalAccess.externalService を使用します。
spec.externalAccessを追加すると、Kubernetes Operator はレプリカセット内の各ポッドの外部サービスを作成します。 外部サービスは、クラスター内の各 MongoDB database ポッドの外部エントリ ポイントを提供します。 各外部サービスには セレクター があります は、外部サービスを特定のポッドに一致させます。値なしでこの設定を追加すると、Kubernetes Operator は次のデフォルト値を持つ外部サービスを作成します。
フィールド値説明Name<pod-name>-svc-external外部サービスの名前。 この値は変更できません。
TypeLoadBalancer外部 LoadBalancer を作成します service
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.注意
spec.clusterSpecList.externalAccess.externalDomainを設定すると、外部サービスはバックアップ用の別のポート(
Port Number + 1)を追加します。
membersタイプ: 数値
MongoDB レプリカセット内のノードの数。
memberConfigタイプ: コレクション
マルチ Kubernetes クラスターMongoDBデプロイ内の各MongoDBシャードとそのノードの仕様。
シャードのオブジェクト内の要素の順序は、レプリカセット内のノードの順序を反映する必要があります。 例、最初の要素はインデックス
0の ポッドに影響し、2 番目の要素はインデックス1に影響するなど、 に影響します。例
3 つのレプリカ セットを含むマルチ Kubernetes クラスター MongoDB 配置の次の例の仕様を検討してみましょう。
apiVersion: mongodb.com/v1 kind: MongoDBMultiCluster metadata: name: multi-replica-set spec: version: 8.0.0 type: ReplicaSet duplicateServiceObjects: false credentials: my-credentials opsManager: configMapRef: name: my-project clusterSpecList: - clusterName: cluster1.example.com members: 2 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod" - votes: 1 priority: "1.5" tags: tag2: "value2" environment: "prod" - clusterName: cluster2.example.com members: 1 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod" - clusterName: cluster3.example.com members: 1 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod"
podSpec.persistenceタイプ: コレクション
spec.configSrv.clusterSpecListとspec.shard.clusterSpecListに渡されるclusterSpecItemオブジェクトでのみ利用可能。 特定のクラスターの既存の永続化構成を上書きします。
statefulSetタイプ: コレクション
Provides the configuration for the StatefulSet override for each of the cluster's StatefulSets in a multi-Kubernetes cluster MongoDB deployment. To set the global configuration that applies to all clusters in your multi-Kubernetes cluster MongoDB deployment, see spec.statefulSet.spec.
この設定は、マルチ Kubernetes クラスター MongoDB 配置のレプリカセット リソース タイプにのみ適用されます。
spec.duplicateServiceObjects注意
このフィールドは、マルチクラスターのシャーディングされたクラスターの配置でのみ使用できます。
タイプ: ブール値
任意
デフォルト:
trueトポロジーが
MultiClusterでない場合は無視されます。 すべてのシャーディングされたクラスターコンポーネントのサービスに適用されます(mongos、configSrv、shards。trueに設定されている場合:- Kubernetes演算子は、各ノード クラスター内のすべてのノード クラスターからすべての
Pod Servicesを作成します。 falseに設定されている場合:- Kubernetes演算子は、次のみを作成します:
spec.mongos.clusterSpecList注意
このフィールドは、マルチクラスターのシャーディングされたクラスターの配置でのみ使用できます。
タイプ: オブジェクトの配列
必須
topology=MultiClusterの場合)次の最上位フィールドを持つマルチクラスターのシャーディングされたクラスター配置で使用するオブジェクトの配列。
clusterName型: string
MongoDB Controls for Kubernetes Operator が StateftSet をスケジュールするクラスターの名前。
externalAccessタイプ: コレクション
マルチ Kubernetes クラスター MongoDB 配置を外部接続用に公開するための仕様。 Kubernetes クラスターの外部からマルチ Kubernetes クラスター MongoDB 配置に接続する方法については、「 Kubernetes 外部からマルチクラスター リソースに接続する 」を参照してください。
これらの設定は、すべてのクラスターのサービスに適用されます。 特定のクラスターでこれらのグローバル設定をオーバーライドするには、 spec.clusterSpecList.externalAccess.externalService を使用します。
spec.externalAccessを追加すると、Kubernetes Operator はレプリカセット内の各ポッドの外部サービスを作成します。 外部サービスは、クラスター内の各 MongoDB database ポッドの外部エントリ ポイントを提供します。 各外部サービスには セレクター があります は、外部サービスを特定のポッドに一致させます。値なしでこの設定を追加すると、Kubernetes Operator は次のデフォルト値を持つ外部サービスを作成します。
フィールド値説明Name<pod-name>-svc-external外部サービスの名前。 この値は変更できません。
TypeLoadBalancer外部 LoadBalancer を作成します service
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.注意
spec.clusterSpecList.externalAccess.externalDomainを設定すると、外部サービスはバックアップ用の別のポート(
Port Number + 1)を追加します。
membersタイプ: 数値
MongoDB レプリカセット内のノードの数。
memberConfigタイプ: コレクション
マルチ Kubernetes クラスターMongoDBデプロイ内の各MongoDBシャードとそのノードの仕様。
シャードのオブジェクト内の要素の順序は、レプリカセット内のノードの順序を反映する必要があります。 例、最初の要素はインデックス
0の ポッドに影響し、2 番目の要素はインデックス1に影響するなど、 に影響します。例
3 つのレプリカ セットを含むマルチ Kubernetes クラスター MongoDB 配置の次の例の仕様を検討してみましょう。
apiVersion: mongodb.com/v1 kind: MongoDBMultiCluster metadata: name: multi-replica-set spec: version: 8.0.0 type: ReplicaSet duplicateServiceObjects: false credentials: my-credentials opsManager: configMapRef: name: my-project clusterSpecList: - clusterName: cluster1.example.com members: 2 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod" - votes: 1 priority: "1.5" tags: tag2: "value2" environment: "prod" - clusterName: cluster2.example.com members: 1 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod" - clusterName: cluster3.example.com members: 1 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod"
statefulSetタイプ: コレクション
Provides the configuration for the StatefulSet override for each of the cluster's StatefulSets in a multi-Kubernetes cluster MongoDB deployment. To set the global configuration that applies to all clusters in your multi-Kubernetes cluster MongoDB deployment, see spec.statefulSet.spec.
この設定は、マルチ Kubernetes クラスター MongoDB 配置のレプリカセット リソース タイプにのみ適用されます。
spec.shard.clusterSpecList注意
このフィールドは、マルチクラスターのシャーディングされたクラスターの配置でのみ使用できます。
タイプ: オブジェクトの配列
必須
topology=MultiClusterの場合)次の最上位フィールドを持つマルチクラスターのシャーディングされたクラスター配置で使用するオブジェクトの配列。
clusterName型: string
MongoDB Controls for Kubernetes Operator が StateftSet をスケジュールするクラスターの名前。
externalAccessタイプ: コレクション
マルチ Kubernetes クラスター MongoDB 配置を外部接続用に公開するための仕様。 Kubernetes クラスターの外部からマルチ Kubernetes クラスター MongoDB 配置に接続する方法については、「 Kubernetes 外部からマルチクラスター リソースに接続する 」を参照してください。
これらの設定は、すべてのクラスターのサービスに適用されます。 特定のクラスターでこれらのグローバル設定をオーバーライドするには、 spec.clusterSpecList.externalAccess.externalService を使用します。
spec.externalAccessを追加すると、Kubernetes Operator はレプリカセット内の各ポッドの外部サービスを作成します。 外部サービスは、クラスター内の各 MongoDB database ポッドの外部エントリ ポイントを提供します。 各外部サービスには セレクター があります は、外部サービスを特定のポッドに一致させます。値なしでこの設定を追加すると、Kubernetes Operator は次のデフォルト値を持つ外部サービスを作成します。
フィールド値説明Name<pod-name>-svc-external外部サービスの名前。 この値は変更できません。
TypeLoadBalancer外部 LoadBalancer を作成します service
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.注意
spec.clusterSpecList.externalAccess.externalDomainを設定すると、外部サービスはバックアップ用の別のポート(
Port Number + 1)を追加します。
membersタイプ: 数値
MongoDB レプリカセット内のノードの数。
memberConfigタイプ: コレクション
マルチ Kubernetes クラスターMongoDBデプロイ内の各MongoDBシャードとそのノードの仕様。
シャードのオブジェクト内の要素の順序は、レプリカセット内のノードの順序を反映する必要があります。 例、最初の要素はインデックス
0の ポッドに影響し、2 番目の要素はインデックス1に影響するなど、 に影響します。例
3 つのレプリカ セットを含むマルチ Kubernetes クラスター MongoDB 配置の次の例の仕様を検討してみましょう。
apiVersion: mongodb.com/v1 kind: MongoDBMultiCluster metadata: name: multi-replica-set spec: version: 8.0.0 type: ReplicaSet duplicateServiceObjects: false credentials: my-credentials opsManager: configMapRef: name: my-project clusterSpecList: - clusterName: cluster1.example.com members: 2 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod" - votes: 1 priority: "1.5" tags: tag2: "value2" environment: "prod" - clusterName: cluster2.example.com members: 1 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod" - clusterName: cluster3.example.com members: 1 memberConfig: - votes: 1 priority: "0.5" tags: tag1: "value1" environment: "prod"
podSpec.persistenceタイプ: コレクション
spec.configSrv.clusterSpecListとspec.shard.clusterSpecListに渡されるclusterSpecItemオブジェクトでのみ利用可能。 特定のクラスターの既存の永続化構成を上書きします。
statefulSetタイプ: コレクション
Provides the configuration for the StatefulSet override for each of the cluster's StatefulSets in a multi-Kubernetes cluster MongoDB deployment. To set the global configuration that applies to all clusters in your multi-Kubernetes cluster MongoDB deployment, see spec.statefulSet.spec.
この設定は、マルチ Kubernetes クラスター MongoDB 配置のレプリカセット リソース タイプにのみ適用されます。
spec.shardOverridesタイプ: オブジェクトの配列
任意
シャードごとのオーバーライドを含むリスト。 各オブジェクトには、次のフィールドが含まれています。
shardNames必須
このオーバーライドが適用されるシャードの名前。
podSpec.Persistence任意
Kubernetes Operator が永続ボリュームを作成してシャードにバインドする方法を定義します。
topology=MultiClusterの場合、すべてのノード クラスターの永続化設定を設定します。spec.shardOverrides.clusterSpecList.persistenceでは、特定のノード クラスターの永続設定を定義できます。additionalMongodConfig任意
spec.shard.additionalMongodConfigのシャード固有の上書き。agent任意
spec.shard.agentのシャード固有の上書き。statefulSet任意
spec.shardPodSpec.podTemplateとspec.shard.clusterSpecList.statefulSetのシャード固有の上書き。members任意
topology=SingleClusterの場合にのみ利用可能です。spec.mongodsPerShardCountのオーバーライド用のシャード固有オーバーライド。memberConfig任意
topology=SingleClusterの場合にのみ利用可能です。spec.shard.memberConfigのシャード固有の上書き。
spec.shardPodSpec.persistence.singleタイプ: コレクション
Kubernetes Operator が 1 つの永続ボリューム要求を作成し、データ、ジャーナル、およびログの 3 つのすべてのディレクトリを同じ永続ボリュームにマウントします。
注意
You must set the values in this collection if
spec.persistent: true.このコレクションまたは
persistence.multipleコレクションを設定できますが、両方は設定できません。
スカラーデータ型説明labelSelectorstring
storagestring
永続ボリューム の最小サイズ マウントする必要があるもの。この値は、 JEDEC表記では、整数とそれに続くストレージの単位として表されます。
デフォルト値は 16Gi です。
例、 の各シャーディングされたクラスターのシャード ノードに60 ギガバイトのストレージ容量が必要な場合は、この値を
60Giに設定します。storageClassstring
永続的なボリューム要求 で指定されるストレージのタイプ 。このストレージ タイプは、 StorageClass として作成できます。 この オブジェクト で使用する前にオブジェクトを 仕様。
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
Prometheus 設定
Prometheus は、スタンドアロン リソース、レプリカセット、またはシャーディングされたクラスターで使用できます。 詳細については、「 Prometheus で使用するリソースの配置」を参照してください。 例については、「 Prometheus と MongoDB リソース 」を参照してください。
MongoDB リソースで Prometheus を使用する場合、次の設定が適用されます。
spec.prometheus.metricsPath型: string
任意
デフォルト:
"/metrics"メトリクス エンドポイントへのパスを示す、人間が判読可能なstring 。 この設定を指定しない場合、デフォルトが適用されます。
spec.prometheus.passwordSecretRef型: オブジェクト
条件付き
基本的なHTTP認証のシークレットの詳細を含むオブジェクト。MongoDBリソースで Prometheus を使用する場合は、この設定を指定する必要があります。
spec.prometheus.passwordSecretRef.key型: string
任意
デフォルト:
"password"シークレット 内のキーを識別する、人間が判読可能な 基本的なstringHTTP 認証のパスワードを保存します。この設定を指定しない場合、デフォルトが適用されます。
spec.prometheus.passwordSecretRef.name型: string
条件付き
基本的なHTTP認証のパスワードを含むシークレットを識別する、人間が判読可能なラベル。MongoDBリソースで Prometheus を使用する場合は、この設定を指定する必要があります。
spec.prometheus.tlseSecretKeyRef型: オブジェクト
任意
シークレット の詳細を含むオブジェクト TLS 認証用。
spec.prometheus.tlseSecretKeyRef.key型: string
任意
デフォルト:
"password"シークレットstring 内のキーを識別する、人間が判読可能な は TLS 認証用のパスワードを保存します。この設定を指定しない場合、デフォルトが適用されます。
spec.prometheus.tlseSecretKeyRef.name型: string
条件付き
秘密 を識別する、人間が判読可能なラベル TLS 認証用のパスワードを含むMongoDB リソースで Prometheus を使用し、 TLS認証を使用する場合は、この設定を指定する必要があります。
移行設定
重要
The settings in this section exist to support migrating a self-managed deployment into Kubernetes under Kubernetes Operator. Do not set them on a MongoDB resource that you deploy directly in Kubernetes without an accompanying migration. For full detail on every field in this section, see MongoDB Migration Resource Settings.
spec.externalMembersType: array of
ExternalMemberobjects移行の一部である仮想マシンまたは必要最低限のソース プロセス。
spec.externalMembers[].processNameタイプ: string、必須
The process name exactly as it appears in the
processesarray of the automation config.spec.externalMembers[].hostnameType: string, Required
The
host:portvalue for the process, exactly as it appears in the automation config.spec.externalMembers[].typeType: enum:
mongodormongos, Required for sharded clustersA replica set has only
mongodexternal members.spec.externalMembers[].replicaSetNameタイプ: string、任意
Required for a sharded-cluster
mongodexternal member. Identifies whether the process belongs to the config server replica set or to a specific shard's replica set.spec.replicaSetNameOverride型: string
Kubernetesリソース名と異なる場合、またはオートメーション構成レプリカセット名が有効なKubernetes名でない場合の、オートメーション構成レプリカセット名。
spec.configServerNameOverride型: string
オートメーション構成に表示されるコンフィギュレーションサーバーのレプリカセット名。
spec.shardNameOverridesType: array of
ShardNameOverrideobjectsPer-shard automation config replica set name and shard
_id.spec.downloadBaseType: string, Default:
/var/lib/mongodb-mms-automationMongoDB Agent がエージェントのバイナリをダウンロードするディレクトリ。
spec.security.tls.caFilePathType: string, Default:
/mongodb-automation/tls/ca/ca-pemKubernetes Operator が ポッド内に CA 証明書をプロジェクションする絶対パス。アプリケーション データベースではサポートされていません。
spec.security.authentication.agents.autoPEMKeyFilePath型: string
Absolute path of the MongoDB Agent's combined PEM file inside database pods. Requires
spec.security.authentication.agents.clientCertificateSecretRef.status.conditionsType: array of Kubernetes Conditions
New on the
MongoDBresource. Standard Kubernetes conditions, keyed bytype, includingMigratingandNetworkConnectivityVerified.status.migrationObservedExternalMembersCountタイプ: 整数
The number of
spec.externalMembersentries that Kubernetes Operator observed on the last reconcile.metadata.annotations.mongodb.com/migration-dry-runタイプ: string(ブール値値)
The
kubectl mongodb migrate-to-mckplugin sets this annotation totrue. While present, Kubernetes Operator makes no automation config changes and performs connectivity validation only.metadata.annotations.mongodb.com/migrate-tool-version型: string
This annotation exists for migration only. Records the version of the
kubectl mongodb migrate-to-mckplugin that generated the resource.
セキュリティ設定
次のセキュリティ設定は、レプリカセットとシャーディングされたクラスターのリソース タイプにのみ適用されます。
spec.security.tls.ca型: string
Provide the name of the ConfigMap that stores the CA for the
MongoDBresource.重要
If you use a custom CA to sign your TLS certificates for the
MongoDBresource, you must specify this parameter.Kubernetes Operator では、ConfigMap で
MongoDBリソース証明書ca-pemに名前を付ける必要があります。
spec.security.certsSecretPrefix型: string
Kubernetes シークレット のプレフィックスへのテキスト レプリカセットの または シャーディングされたクラスターの TLS キーと証明書を含む を作成した
シークレットの前に
<prefix>-<metadata.name>を付ける必要があります。For example, if you call your deployment
my-deploymentand you set the prefix tomdb, you must name the TLS secret for the client TLS communicationsmdb-my-deployment-cert. Also, you must name the TLS secret for internal cluster authentication (if enabled)mdb-my-deployment-clusterfile.TLS証明書を含むシークレットの名前の詳細については、配置に適用される「レプリカセットの配置 」のトピックを参照してください。
spec.security.tls.additionalCertificateDomainsタイプ: ブール値
List of every domain that should be added to TLS certificates to each pod in this deployment. When you set this parameter, every CSR that the Kubernetes Operator transforms into a TLS certificate includes a SAN in the form
<pod name>.<additional cert domain>.Replica set resources don't need this parameter. Use
spec.connectivity.replicaSetHorizonsinstead.注意
If you add this parameter to a TLS-enabled resource, Kubernetes displays an error when the resource reaches the
Pendingstate. This error displays:Please manually remove the |csr| in order to proceed.To remedy this issue:Kubernetes が新しい CSR を生成できるように、既存の CSR を削除します。リソースを削除する方法については、 リソースの 削除 を参照してください。 (Kubernetes ドキュメント)。
Kubernetes が CSR を生成した後に、 CSRを承認します。
spec.additionalMongodConfig.net.ssl.mode型: string
デフォルト:
requireSSLネットワーク接続に使用する
sslModeを指定します。 以下は有効なオプションです。値説明allowSSLConnections between servers do not use TLS. For incoming connections, the server accepts both TLS and non-TLS.
preferSSLConnections between servers use TLS. For incoming connections, the server accepts both TLS and non-TLS.
requireSSLサーバーはTLS暗号化接続のみを使用し、受け入れます。
spec.additionalMongodConfig.net.tls.disabledProtocols型: string
MongoDB バージョン 4.2 の新機能。
Prevents a MongoDB server running with TLS from accepting incoming connections that use a specific protocol or protocols. To specify multiple protocols, enter a comma separated list of protocols. For example,
TLS1_0,TLS1_1.この設定は、次のプロトコルを認識します:
TLS1_0、TLS1_1、TLS1_2、および MongoDB 4.0.4 以降 (および 3.6.9)、TLS1_3。 認識されないプロトコルを指定すると、サーバーは起動しません。macOS では、
TLS1_1を無効にして、TLS1_0とTLS1_2の両方を有効にすることはできません。 少なくともTLS1_0またはTLS1_2も無効にする必要があります。 たとえば、TLS1_0,TLS1_1は macOS でTLS1_2を無効にします。無効にするプロトコルのリストは、無効なプロトコルのデフォルトのリストを置き換えます。
MongoDBバージョン 4.0 以降、TLS 1.1+ がシステムで利用可能な場合、 MongoDB はTLS 1.0 の使用を無効にします。無効になっている TLS 1.0 を有効にするには、
spec.additionalMongodConfig.net.tls.disabledProtocolsの値としてnoneを指定します。レプリカセットとシャーディングされたクラスターのノード間では、少なくとも 1 つのプロトコルが共通している必要があります。
spec.security.authentication.enabledタイプ: ブール値
デフォルト:
falseSpecifies whether authentication is enabled on the Cloud Manager or Ops Manager project. If set to
true, you must set an authentication mechanism inspec.security.authentication.modes.重要
この設定を含めると、
falseに設定されている場合でも、Kubernetes Operator はこの MongoDB リソースの認証を管理します。 この設定がリソース仕様に存在している間は、 Cloud ManagerまたはMongoDB Ops Managerの UI または API を使用してこのリソースの認証を構成することはできません。Cloud ManagerまたはMongoDB Ops Managerの UI または API を使用して認証を管理する場合は、この設定を省略します。
spec.security.authentication.modesタイプ: 配列
MongoDBデプロイで使用する認証メカニズムを指定します。有効な値は、
SCRAM、SCRAM-SHA-1、MONGODB-CR、X509、LDAP、OIDCです。SCRAM-SHA-1よりもSCRAM-SHA-256(SCRAM)を推奨します。SCRAM-SHA-1を指定する場合は、MONGODB-CRも指定する必要があります。注意
X.509 内部クラスター認証
Cloud Managerまたは Ops Managerプロジェクトで X. 内部クラスター認証を有効にするには、この値を509
["X509"]に設定し、次の設定を指定します。provide a value for the
spec.security.certsSecretPrefixsetting.`
If you provide more than one value for
spec.security.authentication.modes, you must also specify a value forspec.security.authentication.agents.mode.
spec.security.authentication.internalCluster型: string
X.509 内部クラスター認証を有効にするかどうかを指定します。
X.509 内部クラスター認証を有効にするには、 を
"X509"に設定します。 次の設定を指定する必要があります。spec.security.authentication.modes: ["X509"]
Kubernetes 演算子は次の値を受け入れます。
["X509"]: X.509 内部クラスター認証が有効になっています。""または省略: 内部クラスター認証が有効になっていません。
重要
内部クラスター認証を有効にした後で、無効にすることはできません。
spec.security.authentication.requireClientTLSAuthenticationタイプ: ブール値
デフォルト:
falseSpecifies whether the MongoDB host requires clients to connect using a TLS certificate. Defaults to
trueif you enable TLS authentication.To enable TLS authentication, provide a value for the
spec.security.certsSecretPrefixsetting.
spec.security.authentication.ldapタイプ: コレクション
LDAP 認証に必要です。
Configures LDAP authentication for the Cloud Manager or Ops Manager project. To enable LDAP authentication, set
spec.security.authentication.modesto["LDAP"].
spec.security.authentication.ldap.serversタイプ: 文字列の配列
LDAP 認証に必要です。
LDAPサーバーのホスト名とポートのリスト。 次の形式で、それぞれのポートを持つホスト名を指定します。
spec: security: authentication: ldap: servers: - "<hostname1>:<port1>" - "<hostname2>:<port2>"
spec.security.authentication.ldap.transportSecurity型: string
LDAP 認証に必要です。
LDAPサーバーがTLSを受け入れるかどうかを指定します。
If the LDAP server accepts TLS, set the value to
tls. If the LDAP server doesn't accept TLS, leave this value blank or set the value tonone.注意
noneまたはtls以外の string を指定した場合でも、Kubernetes Operator は 設定をtlsに設定します。
spec.security.authentication.ldap.caConfigMapRefタイプ: コレクション
TLS による LDAP 認証に必要です。
ConfigMap は、 LDAP サーバーの TLS 証明書を検証する CA を含みます。
spec.security.authentication.ldap.caConfigMapRef.name型: string
TLS による LDAP 認証に必要です。
ConfigMap の名前 は、 LDAP サーバーの TLS 証明書を検証する CA を含みます。
spec.security.authentication.ldap.caConfigMapRef.key型: string
TLS による LDAP 認証に必要です。
LDAP サーバーの TLS 証明書を検証する CA を保存するフィールド名。
spec.security.authentication.ldap.bindQueryUser型: string
LDAP 認証に必要です。
LDAP Distinguished Name to which MongoDB binds when connecting to the LDAP server.
spec.security.authentication.ldap.bindQueryPasswordSecretRefタイプ: コレクション
LDAP 認証に必要です。
Specifies the secret that contains the password with which MongoDB binds when connecting to the LDAP server.
spec.security.authentication.ldap.bindQueryPasswordSecretRef.name型: string
LDAP 認証に必要です。
シークレット の名前 は、 LDAP サーバーに接続するときに MongoDB がバインドするパスワードを含みます。
The secret must contain only one
passwordfield which stores the password.
spec.security.authentication.ldap.authzQueryTemplate型: string
LDAP 認可に必要です。
ユーザーが属する LDAP グループを取得するためにMongoDBによって実行される RFC4515 および
spec.security.authentication.ldap.serversRFC4516 LDAP 形式のクエリURLテンプレート。クエリは、 で指定されたホストに対して相対的です。テンプレートでは、次のトークンを使用できます。{USER}- Substitutes the authenticated username, or the
transformedusername, into the LDAP query.
{PROVIDED_USER}- 認証または LDAP 変換の前に、指定されたユーザー名を LDAP クエリに置き換えます。 ( MongoDB バージョン 4.2 以降で利用可能)
Tip
MongoDB マニュアルのLDAP クエリ テンプレート
spec.security.authentication.agents.automationLdapGroupDN型: string
MongoDB Agent ユーザーが属する LDAP グループの DN(Distinguished Name、識別名)。
この設定は、次の場合に必要です。
spec.security.authentication.agents.modeisLDAPorX509.
spec.security.authentication.ldap.userToDNMapping型: string
Maps the username provided to
mongodormongosfor authentication to a LDAP Distinguished Name (DN).Tip
security.ldap.userToDNMapping( MongoDBマニュアル)
spec.security.authentication.ldap.userCacheInvalidationIntervalタイプ: 整数
MongoDB が LDAP ユーザー キャッシュをフラッシュするまでの待機時間を秒単位で指定します。 デフォルトは 30 秒です。
spec.security.authentication.oidcProviderConfigsタイプ: コレクション
必須
MongoDB のバージョンは 7.0.11+ または 8.0.0+ である必要があります
MongoDB Enterpriseのみサポート
注意
spec.security.authentication.modeがOIDCに設定されている場合は、コレクション内の少なくとも 1 つの要素が必要です。
spec.security.authentication.oidcProviderConfigs.audience型: string
必須
外部IdP(IdP)がトークンを発行するエンティティ。外部 IdP に登録したアプリのオーディエンス値を入力します。複数の IdP が定義されている場合、これは
issuerURIを共有する構成ごとに一意の値である必要があります。
spec.security.authentication.oidcProviderConfigs.authorizationMethod型: string
必須
有効な値は
WorkforceIdentityFederationとWorkloadIdentityFederationです。 Workforce IdP を使用して、人間が配置にアクセスするためにシングルサインオンを構成します。配置へのプログラムによるアプリケーションアクセスには、 Workload Identity Federation を使用します。 MongoDBリソースごとに構成できるワークフォース IdP IdP は 1 つだけです。詳しくは、「 OIDC/OAuth による認証と認可2 0」を参照してください。.
spec.security.authentication.oidcProviderConfigs.authorizationType型: string
必須
有効な値は
GroupMembershipとUserIDです。IdP ユーザー グループ メンバーシップに基づいて認可を付与するにはGroupMembershipを選択し、個々のユーザーに認可を付与するにはUserIDを選択します。
spec.security.authentication.oidcProviderConfigs.clientId型: string
必須
登録されたアプリケーションの一意の識別子です。外部 IdP に登録したアプリの
clientId値を入力します。
spec.security.authentication.oidcProviderConfigs.configurationName型: string
必須
この構成を識別する一意のラベル。このラベルは MongoDB Ops Manager ユーザーに表示され、認可 のユーザーとロールを作成するときに使用されます。大文字と小文字が区別され、次の文字のみを含めることができます。
英数字( から z 、0 から 9 の組み合わせ)
ハイフン(-)
アンダースコア(_)
spec.security.authentication.oidcProviderConfigs.groupsClaim型: string
任意
ユーザー プリンシパル ID を含む要求の識別子。IdP が別の要求を使用しない限り、デフォルト値を受け入れます。
spec.security.authentication.oidcProviderConfigs.issuerURI型: string
必須
登録された IdPアプリケーションによって提供される発行者値。この URI を使用して、 MongoDB は
/.wellknown/open-id-configurationエンドポイントで利用可能な OpenID プロバイダー構成ドキュメントを見つけます。MongoDB8.0+の場合、issuerURIとオーディエンスの組み合わせは、OIDC プロバイダー構成全体で一意である必要があります。その他のMongoDBバージョンでは、issuerURI自体は一意である必要があります。
spec.security.authentication.oidcProviderConfigs.requestedScopes型: string
任意
ユーザーに認可ポイントからのデータをリクエスト権限を付与するトークン。Workforce IdP の認可方法にのみ使用されます。
spec.security.authentication.oidcProviderConfigs.userClaim型: string
必須
ユーザー プリンシパル ID を含む要求の識別子。IdP が別の要求を使用しない限り、デフォルト値を受け入れます。
spec.security.authentication.agentsタイプ: コレクション
MongoDB AgentCloud ManagerまたはMongoDB Ops Manager プロジェクトの 認証構成。
spec.security.authentication.agents.mode型: string
The authentication mechanism that the MongoDB Agents for your MongoDB deployment use. Valid values are
SCRAM,SCRAM-SHA-1,MONGODB-CR,X509,OIDC, andLDAP. The value you specify must also be present inspec.security.authentication.modes. We recommendSCRAM-SHA-256(SCRAM) overSCRAM-SHA-1. If you specifySCRAM-SHA-1, you must also specifyMONGODB-CR.This setting is required if you specified more than one value for
spec.security.authentication.modes.
spec.security.authentication.agents.automationUserName型: string
Name of the user that the MongoDB Agents use to interact with your MongoDB deployment. The username is mapped to an LDAP Distinguished Name (DN) according to
spec.security.authentication.ldap.userToDNMapping. The resulting DN must already exist in your LDAP deployment.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.automationPasswordSecretRefタイプ: コレクション
Details of the secret that contains the password for the
spec.security.authentication.agents.automationUserNameuser.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.automationPasswordSecretRef.name型: string
Name of the secret that contains the password for the
spec.security.authentication.agents.automationUserNameuser. You must create this secret in the same namespace to which you deploy the Kubernetes Operator:kubectl create secret generic ldap-agent-user \ --from-literal="password=<password>" -n <metadata.namespace> This secret must contain one key, the value of which matches the password of the
spec.security.authentication.agents.automationUserNameuser in your LDAP deployment.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.automationPasswordSecretRef.key型: string
Key in the
spec.security.authentication.agents.automationPasswordSecretRef.namesecret that contains the password for the user inspec.security.authentication.agents.automationUserName.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.clientCertificateSecretRef.name型: string
Specifies the secret that contains the MongoDB Agent's TLS certificate. If omitted, defaults to
agent-certs.このシークレットは、 Kubernetes Operator を配置するのと同じ名前空間に作成し、シークレットのタイプが
kubernetes.io/tlsである必要があります。
spec.security.rolesタイプ: 配列
MongoDB 配置に対するきめ細かなアクセス制御を付与するユーザー定義のロールを定義する配列。
To enable user-defined roles, the
spec.security.authentication.enabledmust betrue.例
上記の例では、
customRoleという名前のユーザー定義ロールにより、このロールを割り当てられたユーザーには次の操作を許可します。petsデータベースのcatsコレクションにドキュメントを挿入し、petsデータベース内のdogsコレクションにドキュメントを検索して挿入します。
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: <my-replica-set> 6 spec: 7 members: 3 8 version: "8.0.0" 9 type: ReplicaSet 10 opsManager: 11 configMapRef: 12 name: <configMap.metadata.name> 13 credentials: <mycredentials> 14 persistent: true 15 security: 16 authentication: 17 enabled: true 18 modes: 19 - "SCRAM" 20 roles: 21 - role: "customRole" 22 db: admin 23 privileges: 24 - actions: 25 - insert 26 resource: 27 collection: cats 28 db: pets 29 - actions: 30 - insert 31 - find 32 resource: 33 collection: dogs 34 db: pets 35 ...
spec.security.roles.authenticationRestrictionsタイプ: 配列
Array that defines the IP address from which and to which users assigned this
spec.security.roles.rolecan connect.
spec.security.roles.authenticationRestrictions.clientSourceタイプ: 配列
Array of IP addresses or CIDR blocks from which users assigned this
spec.security.roles.rolecan connect.MongoDB サーバーは、リクエストがこの配列に存在しないクライアントからの接続リクエストである場合、このロールを持つユーザーからの接続リクエストを拒否します。
spec.security.roles.authenticationRestrictions.serverAddressタイプ: 配列
Array of IP addresses or CIDR blocks to which users assigned this
spec.security.roles.rolecan connect.MongoDB サーバーは、クライアントがこの配列に存在しないサーバーへの接続をリクエストした場合、このロールを持つユーザーからの接続リクエストを拒否します。
spec.security.roles.privileges.actionsタイプ: 配列
このロールを付与されたユーザーが実行できるアクションのリスト。 許容値のリストについては、Kubernetes Operator で配置する MongoDB バージョンの MongoDB マニュアルの「特権アクション」を参照してください。
spec.security.roles.privileges.resourceタイプ: コレクション
Resources for which the privilege
actionsapply.このコレクションには、次のいずれかを含める必要があります。
The
spec.security.roles.privileges.resource.clustersetting with a value oftrue.
spec.security.roles.privileges.resource.database型: string
Database for which the privilege
actionsapply.If you provide a value for this setting, you must also provide a value for
spec.security.roles.privileges.resource.collection.
spec.security.roles.privileges.resource.collection型: string
Collection in the
databasefor which the privilegeactionsapply.If you provide a value for this setting, you must also provide a value for
spec.security.roles.privileges.resource.database.
spec.security.roles.privileges.resource.clusterタイプ: ブール値
デフォルト: False
Flag that indicates that the privilege
actionsapply to all databases and collections in the MongoDB deployment. If omitted, defaults tofalse.If set to true, do not provide values for
spec.security.roles.privileges.resource.databaseandspec.security.roles.privileges.resource.collection.
例
次の例は、すべての設定が指定されたスタンドアロン配置のリソース仕様を示しています。
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-standalone spec: version: "8.0.0" service: my-service opsManager: # Alias of cloudManager configMapRef: name: my-project credentials: my-credentials persistent: true type: Standalone additionalMongodConfig: systemLog: logAppend: true verbosity: 4 operationProfiling: mode: slowOp podSpec: persistence: single: storage: "12Gi" storageClass: standard labelSelector: matchExpressions: - {key: environment, operator: In, values: [dev]} podTemplate: metadata: labels: label1: mycustomlabel spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: "mykey" weight: 50 ...
次の例は、提供されたすべての設定を持つレプリカセットのリソース仕様を示しています。
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-replica-set spec: members: 3 version: "8.0.0" service: my-service opsManager: # Alias of cloudManager configMapRef: name: my-project credentials: my-credentials persistent: true type: ReplicaSet podSpec: persistence: multiple: data: storage: "10Gi" journal: storage: "1Gi" labelSelector: matchLabels: app: "my-app" logs: storage: "500M" storageClass: standard podTemplate: metadata: labels: label1: mycustomlabel spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: "mykey" weight: 50 security: certsSecretPrefix: "prefix" tls: ca: custom-ca authentication: enabled: true modes: ["X509"] internalCluster: "X509" statefulSet: spec: serviceName: my-service additionalMongodConfig: net: ssl: mode: preferSSL ...
次の例は、すべての 設定が提供されているシャーディングされたクラスターのリソース仕様を示しています。
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-sharded-cluster spec: shardCount: 2 mongodsPerShardCount: 3 mongosCount: 2 configServerCount: 3 version: "8.0.0" service: my-service type: ShardedCluster ## Please Note: The default Kubernetes cluster name is ## `cluster.local`. ## If your cluster has been configured with another name, you can ## specify it with the `clusterDomain` attribute. opsManager: # Alias of cloudManager configMapRef: name: my-project credentials: my-credentials persistent: true configSrvPodSpec: # if "persistence" element is omitted then Operator uses the # default size (5Gi) for mounting single Persistent Volume podTemplate: spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: nodeId mongosPodSpec: podTemplate: spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: nodeId shardPodSpec: persistence: multiple: # if the child of "multiple" is omitted then the default size will be used. # 16GB for "data", 1GB for "journal", 3GB for "logs" data: storage: "20Gi" logs: storage: "4Gi" storageClass: standard podTemplate: spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: nodeId mongos: additionalMongodConfig: systemLog: logAppend: true verbosity: 4 configSrv: additionalMongodConfig: operationProfiling: mode: slowOp shard: additionalMongodConfig: storage: journal: commitIntervalMs: 50 security: certsSecretPrefix: "prefix" tls: ca: custom-ca authentication: enabled: true modes: ["X509"] internalCluster: "X509" statefulSet: spec: serviceName: my-service ...
StateftSet 設定
次のステートメントセット 設定は、レプリカセットとシャーディングされたクラスターのリソースタイプにのみ適用されます。
The Kubernetes Operator supports overriding the Kubernetes Operator default StatefulSet and PVC settings by specifying values for spec.statefulSet.spec fields in the MongoDB resource specification. However, only certain fields are preserved during the merge process. The following tables list the supported override fields.
spec.statefulSet.specタイプ: コレクション
Specification for the StatefulSet that the MongoDB Controllers for Kubernetes Operator creates for
MongoDBresources.
StatefulSet オーバーライド フィールド
The following fields are merged in and take precedence over default StatefulSet settings when you specify values in spec.statefulSet.spec. Field paths are relative to the StatefulSet definition, so spec.replicas corresponds to spec.statefulSet.spec.replicas in the MongoDB resource specification.
フィールド |
|---|
|
|
|
|
|
|
|
|
|
spec.statefulSet.spec.serviceName型: string
デフォルト:
<resource_name>-svcと<resource_name>-svc-externalAtlas App Servicesが作成または使用するKubernetesサービスの名前。この名前のサービスがすでに存在する場合、 MongoDB Controls for Kubernetes Operator はサービスを削除または再作成しません。この設定により、独自のカスタム サービスを作成し、 Kubernetes Operator でそれらを再利用できます。
PVC (VolumeClaimTemplates) 上書きフィールド
The Kubernetes Operator merges a volume claim template that you specify in spec.statefulSet.spec.volumeClaimTemplates only if its metadata.name matches the name of an existing volume claim template. The following table shows which PVC fields the Kubernetes Operator preserves and which it drops when you specify values in spec.statefulSet.spec.volumeClaimTemplates. Field paths are relative to an individual volume claim template, so spec.volumeMode corresponds to spec.statefulSet.spec.volumeClaimTemplates.spec.volumeMode in the MongoDB resource specification.
サポートされています (保持) | 未サポート(削除) |
|---|---|
|
|
| [1] | Kubernetes 演算子は、指定したアクセス モードをデフォルトのアクセス モードに追加しますが、置き換えは行いません。 |