AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

MongoDB database 리소스 사양

참고

이 페이지의 어느 곳에서나 Ops Manager라고 표시된 곳에서는 Cloud Manager로 대체할 수 있습니다.

Kubernetes Operator용 MongoDB 컨트롤러 는 사용자가 쓰기 (write) 사양 파일에서 Kubernetes statefulSets 를 생성합니다.

Kubernetes Operator는 Kubernetes 에서 MongoDB 전용 리소스를 사용자 지정 리소스로생성합니다.

이러한 사용자 지정 리소스를 관리하려면 다음 프로세스를 사용하세요:

  1. MongoDB 리소스 사양을 만들거나 업데이트합니다.

  2. Kubernetes Operator용 MongoDB 컨트롤러에 지시하여 Kubernetes 환경에 적용 . 결과적으로 Kubernetes Operator는 다음 조치를 수행합니다.

    • 정의된 StatefulSets, 서비스 및 기타 Kubernetes 리소스를 생성합니다.

    • 변경 사항을 반영하도록 Ops Manager 배포 구성을 업데이트합니다.

배포 유형
StatefulSets
StatefulSet 의 크기

독립형

1

1 Pod

복제본 세트

1

1 멤버당 Pod

샤딩된 클러스터

<numberOfShards> + 2

1 Pod per mongos, shard, or config server member

MongoDB 리소스 YAML의 객체 사양을 사용하여 독립형, 복제본 세트샤딩된 클러스터와 같은 MongoDB 객체 의 특성과 설정을 정의합니다.

모든 리소스 유형은 다음 설정을 사용해야 합니다:

apiVersion

유형: 문자열

MongoDB 리소스 스키마의 버전입니다.

kind

유형: 문자열

생성하고자 하는 MongoDB 리소스 유형입니다. 이것을 MongoDB(으)로 설정합니다.

metadata.name

유형: 문자열

생성할 MongoDB 리소스의 이름입니다.

리소스 이름은 44자 이내여야 합니다.

spec.credentials

유형: 문자열

Required. Name of the Kubernetes secret you created as Ops Manager API authentication credentials for the Kubernetes Operator to communicate with Cloud Manager or Ops Manager.

자격 증명을 보유하고 있는 Ops Manager 쿠버네티스 시크릿 객체는 생성하려는 리소스와 동일한 네임스페이스에 존재해야 합니다.

중요

연산자는 시크릿에 대한 변경 사항을 관리합니다

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, and runAsNonRoot = true in securityContext. Kubernetes Operator sets fsgroup equal to runAsUser to 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.type

유형: 문자열

생성하고자 하는 MongoDB 리소스 유형입니다. 허용되는 값은 다음과 같습니다.

  • Standalone

  • ReplicaSet

  • ShardedCluster

spec.version

유형: 문자열

MongoDB 리소스에 설치한 MongoDB의 버전.

중요

호환되는 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.featureCompatibilityVersion to the new version or to AlwaysMatchVersion. To learn more, see spec.featureCompatibilityVersion.

모든 리소스는 다음 설정 중 하나를 사용해야 합니다.

spec.opsManager.configMapRef.name

유형: 문자열

Name of the ConfigMap with the Cloud Manager or Ops Manager connection configuration. The spec.cloudManager.configMapRef.name setting is an alias for this setting and can be used in its place.

이 값은 생성하려는 리소스와 동일한 네임스페이스에 존재해야 합니다.

중요

Operator가 ConfigMap의 변경 사항을 관리합니다.

Kubernetes Operator는 ConfigMap에 대한 모든 변경 사항을 추적하고 MongoDB 리소스 상태를 조정합니다.

spec.cloudManager.configMapRef.name

유형: 문자열

Alias for spec.opsManager.configMapRef.name.

모든 리소스 유형은 다음 설정을 사용할 수 있습니다:

metadata.annotations.mongodb.com/v1.architecture

유형: 문자열

특정 배포에서 사용하는 컨테이너 아키텍처를 결정합니다.

허용되는 값은 다음과 같습니다.

  • static

  • non-static

apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: my-project
annotations:
mongodb.com/v1.architecture: "static"
spec.agent.backupAgent.logRotate

유형: 객체

MongoDB Agent 가 백업 로그 를 로테이션하는 임계값입니다.

spec.agent.backupAgent.logRotate.sizeThresholdMB

유형: integer

MongoDB Agent 가 로그를 로테이션하기 전의 백업 로그 파일 의 최대 크기(MB)입니다.

spec.agent.backupAgent.logRotate.timeThresholdHrs

유형: integer

MongoDB Agent 가 백업 로그 파일 을 로테이션하는 데 걸리는 시간(시간)입니다.

spec.agent.mongod.auditlogRotate

유형: 객체

MongoDB 프로세스에 대한 감사 로그 순환 구성이 포함된 객체입니다.

spec.agent.mongod.auditlogRotate.sizeThresholdMB

유형: 숫자

MongoDB Agent 가 로그를 로테이션하기 전의 감사 로그 파일 의 최대 크기(MB)입니다.

spec.agent.mongod.auditlogRotate.timeThresholdHrs

유형: integer

MongoDB Agent 가 감사 로그 파일 을 로테이션하는 데 걸리는 시간(시간)입니다.

spec.agent.mongod.auditlogRotate.numUncompressed

유형: integer

현재 로그 파일 을 포함하여 압축되지 않은 상태로 유지할 총 감사 로그 파일의 최대 개수입니다.

spec.agent.mongod.auditlogRotate.numTotal

유형: integer

MongoDB Ops Manager 가 보관하는 감사 로그 파일의 총 개수입니다. 이 값을 설정하다 하지 않으면 총 감사 로그 파일 수가 기본적으로 0 로 설정됩니다.

spec.agent.mongod.auditlogRotate.percentOfDiskspace

유형: 숫자

Ops Manager가 10진수로 표시된 로그 파일을 저장하는 데 사용할 수 있는 총 디스크 공간의 최대 백분율입니다. 이 제한을 초과하면 Ops Manager는 이 제한에 도달할 때까지 로그 파일을 삭제합니다. Ops Manager는 가장 오래된 로그 파일을 먼저 삭제합니다.

기본값은 0.02 입니다.

spec.agent.mongod.logRotate

유형: 객체

MongoDB Ops Manager 가 프로세스 의 MongoDB 로그를 로테이션하는 임계값입니다.

spec.agent.mongod.logRotate.sizeThresholdMB

유형: integer

Maximum size in MB for an individual log file before Ops Manager rotates it. Ops Manager rotates the log file immediately if it meets the value given in either this sizeThresholdMB or the spec.agent.mongod.logRotate.timeThresholdHrs.

spec.agent.mongod.logRotate.timeThresholdHrs

유형: integer

다음 로테이션 전 개별 로그 파일의 최대 기간(단위: 시간)입니다. 시간은 마지막 회전 이후의 시간입니다.

Ops Manager rotates the log file once the file meets either this timeThresholdHrs or the spec.agent.mongod.logRotate.sizeThresholdMB.

spec.agent.monitoringAgent.logRotate

유형: 객체

MongoDB Agent 가 모니터링 로그 를 로테이션하는 임계값입니다.

spec.agent.monitoringAgent.logRotate.sizeThresholdMB

유형: integer

MongoDB Agent 가 모니터링 로그 를 로테이션하기 전의 개별 로그 파일 의 최대 크기(MB)입니다.

spec.agent.monitoringAgent.logRotate.timeThresholdHrs

유형: integer

MongoDB Agent 가 모니터링 로그 를 로테이션하는 데 걸리는 시간(시간)입니다.

spec.agent.readinessProbe.environmentVariables

유형: 객체

준비성 프로브의 로그 파일을 제어하는 데 사용되는 다음 환경 변수를 구성합니다.

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.featureCompatibilityVersion

유형: 문자열

기본값은 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 setFeatureCompatibilityVersion in the MongoDB Manual.

spec.clusterDomain

유형: 문자열

기본값: 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.clusterDomain if your Kubernetes cluster has a default domain other than the default cluster.local. If you neither use the default nor set the spec.clusterDomain option, the Kubernetes Operator might not function as expected.

spec.clusterName

유형: 문자열

기본값: cluster.local

중요

spec.clusterName은 더 이상 사용되지 않습니다.

Use spec.clusterDomain instead.

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.clusterDomain if your Kubernetes cluster has a default domain other than the default cluster.local. If you neither use the default nor set the spec.clusterDomain option, the Kubernetes Operator might not function as expected.

metadata.namespace

유형: 문자열

Kubernetes namespace where you create this MongoDB resource and other objects.

spec.service

유형: 문자열

기본값: <resource_name>+'-svc' 및 <resource_name>+'-svc-external'

중요

spec.service는 더 이상 사용되지 않습니다.

Use spec.statefulSet.spec.serviceName instead.

StatefulSet에 생성하거나 사용할 Kubernetes 서비스의 이름입니다. 이 이름의 서비스가 이미 존재하는 경우, Kubernetes Operator용 MongoDB 컨트롤러는 해당 서비스를 삭제 하거나 다시 생성하지 않습니다. 이 설정을 사용하면 사용자 지정 서비스를 직접 생성하고 Kubernetes Operator가 이를 재사용할 수 있습니다.

spec.logLevel

유형: 문자열

기본값: INFO

Configures the level of Automation Agent logging inside the Pod. Accepted values include:

  • DEBUG

  • INFO

  • WARN

  • ERROR

  • FATAL

spec.security.authentication.ignoreUnknownUsers

유형: 부울

기본값: false

Kubernetes Operator 또는 Cloud Manager 또는 Ops Manager 사용자 인터페이스를 통해 구성되지 않은 데이터베이스 사용자를 수정할 수 있는지 여부를 결정합니다.

To manage database users directly through the mongod or mongos, set this setting to true.

MongoDB 리소스 사양에서 사용할 수 있고 사용해야 하는 기타 설정은 생성하려는 MongoDB 배포 항목에 따라 다릅니다.

참고

모든 독립형 설정은 복제본 세트 리소스에도 적용됩니다.

spec.additionalMongodConfig

유형: 컬렉션

MongoDB 프로세스를 시작할 때 사용하는 추가 구성 옵션입니다.

Kubernetes Operator는 MongoDB Agent를 통해 배포하는 MongoDB 버전의 모든 구성 옵션을 지원합니다. 단, 사용자가 다음 옵션에 제공한 값은 Kubernetes Operator에 의해 재정의됩니다.

Kubernetes Operator가 소유하는 구성 옵션에 대해 자세히 알아보려면 MongoDB Kubernetes Operator전용 설정을 참조하세요.

사용할 수 있는 구성 옵션에 대해 알아보려면 Ops 관리자 설명서에서 MongoDB 배포를 위한 고급 옵션을 참조하세요.

spec.agent

유형: 컬렉션

MongoDB 데이터베이스 리소스에 대한 MongoDB Agent 구성 설정입니다.

spec.agent.startupOptions

유형: 컬렉션

MongoDB 데이터베이스 리소스를 시작하는 데 적합한 MongoDB Agent 설정.

MongoDB Agent 설정을 키-값 쌍으로 제공해야 합니다. 값은 문자열이어야 합니다.

지원되는 MongoDB Agent 설정 목록은 다음을 참조하세요.

1---
2apiVersion: mongodb.com/v1
3kind: MongoDB
4metadata:
5 name: my-standalone
6spec:
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

유형: 컬렉션

외부 연결을 위해 클러스터 노출하는 사양입니다. Kubernetes 클러스터 외부에서 MongoDB 리소스에 연결하는 방법을 학습하려면 Kubernetes 외부에서 MongoDB 데이터베이스에 연결을 참조하세요.

spec.externalAccess를 추가하면 Kubernetes Operator는 복제본 세트의 각 Pod에 대한 외부 서비스를 생성합니다. 외부 서비스는 클러스터의 각 MongoDB 데이터베이스 Pod에 대한 외부 진입점을 제공합니다. 각 외부 서비스에는 외부 서비스를 특정 Pod와 일치시키는 셀렉터(selector)가 있습니다.

이 설정을 값없이 추가하면 Kubernetes Operator는 다음과 같은 기본값을 사용하여 외부 서비스를 생성합니다.

필드
설명

Name

<pod-name>-svc-external

외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.

Type

LoadBalancer

외부 LoadBalancer 서비스를 생성합니다.

Port

<Port Number>

A port for mongod.

publishNotReadyAddress

true

Specifies that DNS records are created even if the Pod isn't ready. Do not set to false for 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.externalAccess setting, 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

유형: 컬렉션

배포서버 의 모든 클러스터에 cloud 제공자별 구성 설정을 추가할 수 있는 키-값 쌍입니다. 자세한 학습 은 주석 및 Kubernetes cloud 제공자 설명서를 참조하세요.

주석 을 사용하여 Kubernetes Operator 배포에서 사용하는 외부 서비스에 대한 자리 표시자 값을 지정할 수 있습니다. Kubernetes Operator는 다음 표에 설명된 대로 이러한 값을 올바른 값으로 자동으로 바꿉니다. 자리 표시자를 사용하면 특정 파드의 각 서비스에 특정 어노테이션을 제공할 수 있습니다.

설명

{resourceName}

{namespace}

{podIndex}

StatefulSet 에 의해 할당되고 현재 외부 서비스의 대상이 되는 파드의 인덱스입니다.

{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.externalDomain if specified. Otherwise, equal to the domain used for the mongod process FQDN.

예를 들어 프로세스 호스트 이름 mdb-rs-1.example.com 의 경우 example.com 은 도메인 이름입니다.

{mongodProcessFQDN}

The mongod process 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가 하나의 퍼시스턴트 볼륨 클레임(Persistent Volume Claim, PVC)을 생성하고 데이터와 저널 및 로그에 대한 세 개의 디렉토리를 모두 동일한 퍼시스턴트 볼륨 마운트하도록 합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.multiple 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

마운트해야 하는 영구 볼륨 의 최소 크기입니다. 이 값은 정수 뒤에 JEDEC 표기법으로 저장 단위를 붙여 표현합니다.

기본값은 16Gi입니다.

For example, if standalone deployment in requires 60 gigabytes of storage space, set this value to 60Gi.

storageClass

문자열

영구 볼륨 클레임에 지정된 저장 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to 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 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host standalone deployment on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 16Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

독립형 배포에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to Retain. This ensures that data is retained when a Persistent Volume Claim is removed.

spec.podSpec.persistence.multiple.journal

유형: 컬렉션

Kubernetes Operator가 Persistent Volume Claim 을 생성하고 자체 Persistent Volume에 저널 용 디렉토리 마운트합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.single 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host standalone deployment on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 1Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

독립형 배포에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to Retain. This ensures that data is retained when a Persistent Volume Claim is removed.

spec.podSpec.persistence.multiple.logs

유형: 컬렉션

Kubernetes Operator가 Persistent Volume Claim 을 생성하고 자체 Persistent Volume에 로그용 디렉토리 마운트하도록 합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.single 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host standalone deployment on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 3Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

독립형 배포에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to 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 Operator가 spec.podSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.

spec.podSpec.podTemplate.metadata

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 MongoDB database 리소스에 대해 생성하는 Kubernetes Pods의 메타데이터입니다.

추가할 수 있는 필드를 검토하려면 spec.podSpec.podTemplate.metadata Kubernetes 설명서를 참조하세요.

spec.podSpec.podTemplate.spec

유형: 컬렉션

Kubernetes 연산자용 MongoDB 컨트롤러가 MongoDB database 리소스에 대해 생성하는 Kubernetes 파드의 사양입니다.

To review which fields you can add to spec.podSpec.podTemplate.spec, see the Kubernetes PodSpec v1 core API.

참고

spec.podSpec.podTemplate.spec.containers에 컨테이너를 추가하면 Kubernetes Operator가 컨테이너를 Kubernetes 포드에 추가합니다. 이러한 컨테이너는 포드의 MongoDB 데이터베이스 리소스 컨테이너에 추가됩니다.

이 설정을 사용하여 각 pod에 대한 CPU 및 RAM 할당을 지정합니다. 예시는 GitHub의 샘플을 참조하세요.

spec.podSpec.podTemplate.spec.affinity.nodeAffinity

유형: 구조체

Kubernetes rule to place Pods for replica set on a specific range of nodes.

읽기-쓰기 성능을 최적화하려면 Pods 를 제한하는 노드 어피니티 규칙을 사용하세요. 특정 노드 에서 실행 또는 특정 노드 에서 실행하는 것을 선호합니다. .

spec.podSpec.podTemplate.spec.affinity.podAffinity

유형: 구조체

Kubernetes rule to determine whether multiple MongoDB resource 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.podSpec.podTemplate.spec.affinity.podAntiAffinity

유형: 구조체

Default: kubernetes.io/hostname

Sets a rule to spread Pods hosting MongoDB resource 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.podSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey

유형: 구조체

Default: kubernetes.io/hostname

This key defines which label is used to determine which topology domain a node belongs to.

참고

모든 독립형 설정은 복제본 세트 리소스에도 적용됩니다.

다음 설정은 복제본 세트 리소스 유형에 적용됩니다:

spec.backup

유형: 컬렉션

The collection container for spec.backup.mode, which enables continuous backups for MongoDB resources in Kubernetes Operator.

spec.backup.assignmentLabels

유형: 배열

A comma-separated list of labels to assign backup daemons, oplog stores, blockstores, S3 snapshot stores, and file system stores to specific projects or groups. Use assignment labels to identify that specific backup stores are associated with particular projects.

Kubernetes Operator를 사용하여 할당 레이블을 설정하는 경우 Kubernetes 설정 파일에서 설정한 할당 레이블 값이 Ops Manager UI에 정의된 값을 재정의합니다. Kubernetes Operator를 사용하여 설정하지 않은 할당 레이블은 Ops Manager UI에 설정된 값을 계속 사용합니다.

참고

If you set this parameter, the API key linked with the value of spec.credentials must have a Global Owner role.

spec.backup.mode

유형: 문자열

MongoDB 리소스에 대한 지속적인 백업을 활성화합니다. 가능한 값은 enabled, disabled, terminated입니다.

참고

The spec.backup.mode setting relies on Backup that is enabled in the Ops Manager and requires that spec.backup.enabled value in the Ops Manager resource specification is set to true.

After you enable continuous backups for your MongoDB resource with spec.backup.mode, you can check the backup status.

spec.backup.encryption

유형: 객체

백업 암호화 구성 설정이 포함된 객체입니다.

spec.backup.encryption.kmip

유형: 객체

KMIP 백업 암호화 구성 설정을 포함하는 객체입니다. 자세히 알아보려면 Ops Manager에 대한 KMIP 백업 암호화 구성을 참조하세요.

spec.backup.encryption.kmip.client

유형: 객체

KMIP 백업 암호화 클라이언트 구성 설정을 포함하는 객체입니다.

spec.backup.encryption.kmip.client.clientCertificatePrefix

유형: 문자열

spec.backup.snapshotSchedule

유형: 컬렉션

Kubernetes Operator에서 MongoDB 리소스에 대한 연속 백업을 위한 스냅샷 일정 설정을 위한 collection 컨테이너입니다.

spec.backup.snapshotSchedule.snapshotIntervalHours

유형: 숫자

스냅샷 사이의 시간 간격입니다. 6, 8, 12 또는 24 값을 설정할 수 있습니다.

spec.backup.snapshotSchedule.snapshotRetentionDays

유형: 숫자

최근 스냅샷을 보관할 일수입니다. 2에서 5 사이의 값을 설정할 수 있습니다.

spec.backup.snapshotSchedule.dailySnapshotRetentionDays

유형: 숫자

일일 스냅샷을 보관할 수 있는 일수입니다. 1에서 365 사이의 값을 설정할 수 있습니다. 값을 0으로 설정하면 이 규칙이 비활성화됩니다.

spec.backup.snapshotSchedule.weeklySnapshotRetentionWeeks

유형: 숫자

주간 스냅샷을 보관할 주 수입니다. 1에서 52 사이의 값을 설정할 수 있습니다. 값을 0으로 설정하면 이 규칙이 비활성화됩니다.

spec.backup.snapshotSchedule.monthlySnapshotRetentionMonths

유형: 숫자

월별 스냅샷을 보관하는 개월 수입니다. 1에서 36 사이의 값을 설정할 수 있습니다. 값을 0으로 설정하면 이 규칙이 비활성화됩니다.

spec.backup.snapshotSchedule.pointInTimeWindowHours

유형: 숫자

특정 시점 스냅샷을 만들 수 있는 과거의 기간(시간 단위)입니다.

spec.backup.snapshotSchedule.referenceHourOfDay

유형: 숫자

UTC hour of the day to schedule snapshots using a 24 hour clock. You can set a value between 0 and 23, inclusive.

spec.backup.snapshotSchedule.referenceMinuteOfHour

유형: 숫자

UTC minute of the hour to schedule snapshots. You can set a value between 0 and 59, inclusive.

spec.backup.snapshotSchedule.fullIncrementalDayOfWeek

유형: 문자열

Ops Manager가 전체 스냅샷을 찍는 요일입니다. 이 설정은 최근의 작업에 대한 완전한 백업을 보장합니다. Ops Manager의 기본값은 SUNDAY로 설정됩니다.

spec.clusterName

유형: 문자열

기본값: cluster.local

중요

spec.clusterName은 더 이상 사용되지 않습니다.

Use spec.clusterDomain instead.

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.clusterDomain if your Kubernetes cluster has a default domain other than the default cluster.local. If you neither use the default nor set the spec.clusterDomain option, the Kubernetes Operator might not function as expected.

spec.connectivity.replicaSetHorizons

유형: 컬렉션

클라이언트 애플리케이션 및 MongoDB Agent에 대해 다양한 DNS 설정을 제공할 수 있습니다. Kubernetes Operator는 복제본 세트 멤버에 대해 분할 수평 DNS를 사용합니다. 이 기능을 사용하면 Kubernetes 클러스터 내부와 Kubernetes 외부 모두에서 통신할 수 있습니다.

호스트당 여러 개의 외부 매핑을 추가할 수 있습니다.

스플릿 호라이즌 요구 사항:

예시

이 예에서 복제본 세트 멤버는 example-localhost 경계에서 서로 통신합니다. 클라이언트는 example-website 경계를 사용하여 복제본 세트와 통신합니다.

언급된 지평의 이름은 이 예시 의 목적에 따라 임의적입니다. 수평선의 이름은 무엇이든 지정할 수 있지만 해당 수평선의 일부인 모든 호스트 이름에 대해 수평선 이름이 동일해야 합니다.

1---
2apiVersion: mongodb.com/v1
3kind: MongoDB
4metadata:
5 name: <my-replica-set>
6spec:
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

유형: 문자열

복제본 세트 배포를 외부에 노출하는 데 사용되는 외부 도메인입니다.

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.com

After you deploy the replica set with this setting, the Kubernetes Operator uses the hostname with the external domain to override the processes[n].hostname field in the Ops Manager automation configuration. Then, the MongoDB Agent uses this hostname to connect to mongod.

To specify other hostnames for connecting to the replica set, you can use the spec.connectivity.replicaSetHorizons setting. However, the following connections still use the hostname with the external domain:

WARNING: Specifying this field changes how Ops Manager registers mongod processes. You can't change the value of this field or any processes[n].hostname fields in the Ops Manager automation configuration for a running replica set deployment.

spec.members

유형: integer

필수 사항입니다. 복제본 세트의 멤버 수입니다.

spec.memberConfig

유형: 컬렉션

MongoDB 리소스에서 배포된 각 MongoDB 복제본 집합 구성원에 대한 사양입니다.

배열의 요소 순서는 복제 세트의 멤버 순서를 반영해야 합니다. 예를 들어 배열의 첫 번째 요소는 인덱스 0 에 있는 Pod에 영향을 주고, 두 번째 요소는 인덱스 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

유형: 문자열

MongoDB 복제본 세트 멤버가 프라이머리가 될 상대적인 가능성을 나타내는 숫자입니다.

  • 복제 세트 멤버가 프라이머리가 될 가능성을 상대적으로 높이려면 더 높은 priority 값을 지정합니다.

  • 복제 세트 멤버가 기본 멤버가 될 가능성을 상대적으로 줄이려면 더 낮은 priority 값을 지정하세요.

예를 들어 memberConfig.priority1.5인 노드는 memberConfig.priority0.5인 노드보다 프라이머리 노드가 될 가능성이 큽니다.

memberConfig.priority0인 멤버는 프라이머리가 될 수 없습니다. 자세히 알아보려면 멤버 우선순위를 참조하세요.

spec.memberConfig.tags

유형: 매핑

읽기 및 쓰기 작업을 MongoDB 복제본 세트의 특정 멤버로 전달하기 위한 복제본 세트 태그의 맵입니다.

spec.memberConfig.votes

유형: 숫자

Determines whether a MongoDB replica set member can vote in an election. Set to 1 to allow the member to vote. Set to 0 to 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 to true is useful when you want to delete the MongoDB custom resource while the spec.backup.mode setting is set to enabled.

참고

별도로 지정하지 않는 한 모든 복제본 세트 설정은 샤딩된 클러스터 리소스에도 적용됩니다.

다음 설정은 샤딩된 클러스터 리소스 유형에만 적용됩니다.

spec.backup.snapshotSchedule.clusterCheckpointIntervalMin

유형: 숫자

연속 클러스터 체크포인트 사이의 시간(분)입니다. 이 설정은 기능 호환성 버전 이 4.0 이하인 MongoDB 를 실행 하는 샤딩된 클러스터에만 적용됩니다. 이 숫자는 샤딩된 클러스터에 대한 특정 시점 복원의 세분성을 결정합니다. 15, 30 또는 60 의 값을 설정하다 수 있습니다.

spec.configServerCount

유형: integer

필수 사항. config 서버의 멤버 수입니다.

spec.configSrv.additionalMongodConfig

유형: 컬렉션

config 서버 멤버를 시작하는 데 사용할 추가 구성 옵션 입니다.

Kubernetes Operator는 MongoDB Agent를 통해 배포하는 MongoDB 버전의 모든 구성 옵션을 지원합니다. 단, 사용자가 다음 옵션에 제공한 값은 Kubernetes Operator에 의해 재정의됩니다.

Kubernetes Operator가 소유하는 구성 옵션에 대해 자세히 알아보려면 MongoDB Kubernetes Operator전용 설정을 참조하세요.

사용할 수 있는 구성 옵션에 대해 알아보려면 Ops 관리자 설명서에서 MongoDB 배포를 위한 고급 옵션을 참조하세요.

spec.configSrv.agent

유형: 컬렉션

config 서버 멤버에 대한 MongoDB Agent 구성 설정입니다.

spec.configSrv.agent.startupOptions

유형: 컬렉션

config 서버 멤버를 시작할 MongoDB Agent 설정입니다.

MongoDB Agent 설정을 키-값 쌍으로 제공해야 합니다. 값은 문자열이어야 합니다.

지원되는 MongoDB Agent 설정 목록은 다음을 참조하세요.

1---
2apiVersion: mongodb.com/v1
3kind: MongoDB
4metadata:
5 name: my-sharded-cluster-options
6spec:
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 config 서버 파드에 대한 사양이 포함된 객체입니다.

spec.configSrvPodSpec.persistence.single

유형: 컬렉션

Kubernetes Operator가 하나의 퍼시스턴트 볼륨 클레임(Persistent Volume Claim, PVC)을 생성하고 데이터와 저널 및 로그에 대한 세 개의 디렉토리를 모두 동일한 퍼시스턴트 볼륨 마운트하도록 합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.multiple 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

마운트해야 하는 영구 볼륨 의 최소 크기입니다. 이 값은 정수 뒤에 JEDEC 표기법으로 저장 단위를 붙여 표현합니다.

기본값은 5Gi입니다.

For example, if each config server member in requires 60 gigabytes of storage space, set this value to 60Gi.

storageClass

문자열

영구 볼륨 클레임에 지정된 저장 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to 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 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host each config server member on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 16Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

config 서버 멤버에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to Retain. This ensures that data is retained when a Persistent Volume Claim is removed.

spec.configSrvPodSpec.persistence.multiple.journal

유형: 컬렉션

Kubernetes Operator가 Persistent Volume Claim 을 생성하고 자체 Persistent Volume에 저널 용 디렉토리 마운트합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.single 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host each config server member on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 1Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

config 서버 멤버에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to Retain. This ensures that data is retained when a Persistent Volume Claim is removed.

spec.configSrvPodSpec.persistence.multiple.logs

유형: 컬렉션

Kubernetes Operator가 Persistent Volume Claim 을 생성하고 자체 Persistent Volume에 로그용 디렉토리 마운트하도록 합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.single 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host each config server member on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 3Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

config 서버 멤버에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to 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 Operator가 spec.configSrvPodSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.

spec.configSrvPodSpec.podTemplate.metadata

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 각 config 서버 멤버에 대해 생성하는 Kubernetes Pods의 메타데이터입니다.

추가할 수 있는 필드를 검토하려면 spec.configSrvPodSpec.podTemplate.metadata Kubernetes 설명서를 참조하세요.

spec.configSrvPodSpec.podTemplate.spec

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 각 config 서버 멤버에 대해 생성하는 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 포드에 추가합니다. 이러한 컨테이너는 pod의 각 config 서버 멤버 컨테이너에 추가됩니다.

이 설정을 사용하여 각 pod에 대한 CPU 및 RAM 할당을 지정합니다. 예시는 GitHub의 샘플을 참조하세요.

spec.configSrvPodSpec.podTemplate.spec.affinity.podAffinity

유형: 컬렉션

Kubernetes rule to determine whether multiple MongoDB resource 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.

읽기-쓰기 성능을 최적화하려면 Pods 를 제한하는 노드 어피니티 규칙을 사용하세요. 특정 노드 에서 실행 또는 특정 노드 에서 실행하는 것을 선호합니다. .

spec.configSrvPodSpec.podTemplate.spec.affinity.podAntiAffinity

유형: 문자열

Default: kubernetes.io/hostname

Sets a rule to spread Pods hosting MongoDB resource 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

유형: 문자열

Default: kubernetes.io/hostname

This key defines which label is used to determine which topology domain a node belongs to.

spec.mongodsPerShardCount

유형: integer

필수 사항. 샤드당 구성원 수입니다.

spec.mongosCount

유형: integer

Required. Number of mongos instances in the sharded cluster.

spec.mongos.additionalMongodConfig

유형: 컬렉션

mongos 인스턴스를 시작하는 데 사용할 추가 구성 옵션 입니다.

Kubernetes Operator는 MongoDB Agent를 통해 배포하는 MongoDB 버전의 모든 구성 옵션을 지원합니다. 단, 사용자가 다음 옵션에 제공한 값은 Kubernetes Operator에 의해 재정의됩니다.

Kubernetes Operator가 소유하는 구성 옵션에 대해 자세히 알아보려면 MongoDB Kubernetes Operator전용 설정을 참조하세요.

사용할 수 있는 구성 옵션에 대해 알아보려면 Ops 관리자 설명서에서 MongoDB 배포를 위한 고급 옵션을 참조하세요.

spec.mongos.agent

유형: 컬렉션

MongoDB Agent configuration settings for each mongos instance.

spec.mongos.agent.startupOptions

유형: 컬렉션

MongoDB Agent settings with which you want to start each mongos instance.

MongoDB Agent 설정을 키-값 쌍으로 제공해야 합니다. 값은 문자열이어야 합니다.

지원되는 MongoDB Agent 설정 목록은 다음을 참조하세요.

1---
2apiVersion: mongodb.com/v1
3kind: MongoDB
4metadata:
5 name: my-sharded-cluster-options
6spec:
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 mongos instance.

템플릿 값은 spec.mongosPodSpec에 지정된 값보다 우선합니다.

참고

Kubernetes Operator가 spec.mongosPodSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.

spec.mongosPodSpec.podTemplate.metadata

유형: 컬렉션

Metadata for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each mongos instance.

추가할 수 있는 필드를 검토하려면 spec.mongosPodSpec.podTemplate.metadata Kubernetes 설명서를 참조하세요.

spec.mongosPodSpec.podTemplate.spec

유형: 컬렉션

Specifications of the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each mongos instance.

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 each mongos instance containers in the pod.

이 설정을 사용하여 각 pod에 대한 CPU 및 RAM 할당을 지정합니다. 예시는 GitHub의 샘플을 참조하세요.

spec.mongosPodSpec.podTemplate.spec.affinity.podAffinity

유형: 컬렉션

Optional. Kubernetes rule to determine if multiple MongoDB resource 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.

읽기-쓰기 성능을 최적화하려면 Pods 를 제한하는 노드 어피니티 규칙을 사용하세요. 특정 노드 에서 실행 또는 특정 노드 에서 실행하는 것을 선호합니다. .

spec.mongosPodSpec.podTemplate.spec.affinity.podAntiAffinity

유형: 문자열

Default: kubernetes.io/hostname

Sets a rule to spread Pods hosting MongoDB resource 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

유형: 문자열

Default: kubernetes.io/hostname

This key defines which label is used to determine which topology domain a node belongs to.

spec.shardCount

유형: integer

필수 사항. 샤딩된 클러스터의 샤드 수입니다.

spec.shard.additionalMongodConfig

유형: 컬렉션

샤딩된 클러스터 샤드 멤버를 시작할 추가 구성 옵션입니다.

Kubernetes Operator는 MongoDB Agent를 통해 배포하는 MongoDB 버전의 모든 구성 옵션을 지원합니다. 단, 사용자가 다음 옵션에 제공한 값은 Kubernetes Operator에 의해 재정의됩니다.

Kubernetes Operator가 소유하는 구성 옵션에 대해 자세히 알아보려면 MongoDB Kubernetes Operator전용 설정을 참조하세요.

사용할 수 있는 구성 옵션에 대해 알아보려면 Ops 관리자 설명서에서 MongoDB 배포를 위한 고급 옵션을 참조하세요.

spec.shard.agent

유형: 컬렉션

샤딩된 클러스터 샤드 구성원에 대한 MongoDB Agent 구성 설정입니다.

spec.shard.agent.startupOptions

유형: 컬렉션

샤딩된 클러스터 샤드 구성원을 시작할 MongoDB Agent 설정입니다.

MongoDB Agent 설정을 키-값 쌍으로 제공해야 합니다. 값은 문자열이어야 합니다.

지원되는 MongoDB Agent 설정 목록은 다음을 참조하세요.

1---
2apiVersion: mongodb.com/v1
3kind: MongoDB
4metadata:
5 name: my-sharded-cluster-options
6spec:
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 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host each sharded cluster shard member on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 16Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

샤딩된 클러스터 샤드 멤버에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to Retain. This ensures that data is retained when a Persistent Volume Claim is removed.

spec.shardPodSpec.persistence.multiple.journal

유형: 컬렉션

Kubernetes Operator가 Persistent Volume Claim 을 생성하고 자체 Persistent Volume에 저널 용 디렉토리 마운트합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.single 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host each sharded cluster shard member on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 1Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

샤딩된 클러스터 샤드 멤버에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to Retain. This ensures that data is retained when a Persistent Volume Claim is removed.

spec.shardPodSpec.persistence.multiple.logs

유형: 컬렉션

Kubernetes Operator가 Persistent Volume Claim 을 생성하고 자체 Persistent Volume에 로그용 디렉토리 마운트하도록 합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.single 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

Minimum storage capacity that must be available on a Kubernetes node to host each sharded cluster shard member on Kubernetes. This value is expressed as an integer followed by a unit of storage in JEDEC notation.

기본값은 3Gi입니다.

예를 예시 이 MongoDB 리소스 에 60 기가바이트의 저장 공간이 필요한 경우 이 값을 60Gi 로 설정하다 합니다.

storageClass

문자열

샤딩된 클러스터 샤드 멤버에 필요한 스토리지 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to 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 Operator가 spec.shardPodSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.

spec.shardPodSpec.podTemplate.metadata

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 각 샤딩된 클러스터 샤드 멤버에 대해 생성하는 Kubernetes Pods의 메타데이터입니다.

추가할 수 있는 필드를 검토하려면 spec.shardPodSpec.podTemplate.metadata Kubernetes 설명서를 참조하세요.

spec.shardPodSpec.podTemplate.spec

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 각 샤딩된 클러스터 샤드 멤버에 대해 생성하는 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 포드에 추가합니다. 이러한 컨테이너는 파드의 각 샤딩된 클러스터 샤드 멤버 컨테이너에 추가됩니다.

이 설정을 사용하여 각 pod에 대한 CPU 및 RAM 할당을 지정합니다. 예시는 GitHub의 샘플을 참조하세요.

spec.shardPodSpec.podTemplate.spec.affinity.podAffinity

유형: 문자열

Kubernetes rule to determine whether multiple MongoDB resource 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

유형: 문자열

Kubernetes rule to place Pods for replica set on a specific range of nodes.

읽기-쓰기 성능을 최적화하려면 Pods 를 제한하는 노드 어피니티 규칙을 사용하세요. 특정 노드 에서 실행 또는 특정 노드 에서 실행하는 것을 선호합니다. .

spec.shardPodSpec.podTemplate.spec.affinity.podAntiAffinity

유형: 문자열

Default: kubernetes.io/hostname

Sets a rule to spread Pods hosting MongoDB resource 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

유형: 문자열

Default: kubernetes.io/hostname

This key defines which label is used to determine which topology domain a node belongs to.

spec.shardSpecificPodSpec

유형: 배열

샤드별로 StatefulSet에 대한 재정의 항목을 포함하는 목록입니다.

spec.shardSpecificPodSpec.podTemplate

유형: 컬렉션

Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for the specific shard.

템플릿 값은 spec.shardSpecificPodSpec에 지정된 값보다 우선합니다.

참고

Kubernetes Operator가 spec.shardSpecificPodSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.

spec.shardSpecificPodSpec.podTemplate.metadata

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 특정 샤드 에 대해 생성하는 Kubernetes Pods의 메타데이터입니다.

추가할 수 있는 필드를 검토하려면 spec.shardSpecificPodSpec.podTemplate.metadata Kubernetes 설명서를 참조하세요.

spec.shardSpecificPodSpec.podTemplate.spec

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 특정 샤드 에 대해 생성하는 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 pod에 추가합니다. 이러한 컨테이너는 pod의 특정 샤드 컨테이너에 추가됩니다.

이 설정을 사용하여 각 pod에 대한 CPU 및 RAM 할당을 지정합니다. 예시는 GitHub의 샘플을 참조하세요.

spec.shardSpecificPodSpec.podTemplate.spec.affinity.podAffinity

유형: 문자열

Kubernetes rule to determine whether multiple MongoDB resource 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

유형: 문자열

Default: kubernetes.io/hostname

Sets a rule to spread Pods hosting MongoDB resource 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

유형: 문자열

Default: kubernetes.io/hostname

This key defines which label is used to determine which topology domain a node belongs to.

spec.topology

유형: 문자열

옵션

기본값: SingleCluster

샤딩된 클러스터 의 토폴로지 를 정의합니다. 기존 배포서버 서버에 대해서는 변경할 수 없습니다. MultiCluster 로 설정하다 경우:

  • 모든 샤딩된 클러스터 구성 요소에는 clusterSpecList 이(가) 정의되어 있어야 합니다.

    • spec.mongos.clusterSpecList

    • spec.configSrv.clusterSpecList

    • spec.shard.clusterSpecList

  • 다음 필드는 spec.<section>.clusterSpecList 객체의 각 클러스터 에 대해 동등한 값이 전달되므로 무시됩니다.

    • spec.mongodsPerShardCount 는 다음에 정의되어 있습니다. spec.shard.clusterSpecList.members

    • spec.mongosCount 는 다음에 정의되어 있습니다. spec.mongos.clusterSpecList.members

    • spec.configServerCount 는 다음에 정의되어 있습니다. spec.configSrv.clusterSpecList.members

    • spec.shardOverrides.memberConfig 는 다음에 정의되어 있습니다. spec.shardOverrides.clusterSpecList.memberConfig

    • spec.shardOverrides.members 는 다음에 정의되어 있습니다. spec.shardOverrides.clusterSpecList.members

    • spec.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

유형: 문자열

Kubernetes Operator용 MongoDB 컨트롤러가 StatefulSet를 예약하는 클러스터의 이름입니다.

externalAccess

유형: 컬렉션

외부 연결을 위해 다중 Kubernetes 클러스터 MongoDB deployment 를 노출하는 사양입니다. Kubernetes 클러스터 외부에서 멀티-Kubernetes 클러스터 MongoDB deployment 에 연결하는 방법을 학습 보려면 Kubernetes 외부 Kubernetes 멀티-클러스터 리소스에 연결하기를 참조하세요.

이러한 설정은 모든 클러스터의 서비스에 적용 됩니다. 특정 클러스터 에서 이러한 전역 설정을 재정의하려면 spec.clusterSpecList.externalAccess.externalService를 사용합니다.

spec.externalAccess를 추가하면 Kubernetes Operator는 복제본 세트의 각 Pod에 대한 외부 서비스를 생성합니다. 외부 서비스는 클러스터의 각 MongoDB 데이터베이스 Pod에 대한 외부 진입점을 제공합니다. 각 외부 서비스에는 외부 서비스를 특정 Pod와 일치시키는 셀렉터(selector)가 있습니다.

이 설정을 값없이 추가하면 Kubernetes Operator는 다음과 같은 기본값을 사용하여 외부 서비스를 생성합니다.

필드
설명

Name

<pod-name>-svc-external

외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.

Type

LoadBalancer

외부 LoadBalancer 서비스를 생성합니다.

Port

<Port Number>

A port for mongod.

publishNotReadyAddress

true

Specifies that DNS records are created even if the Pod isn't ready. Do not set to false for any database Pod.

참고

spec.clusterSpecList.externalAccess.externalDomain 을 설정하다 하면 외부 서비스가 백업을 위해 다른 포트(Port Number + 1)를 추가합니다.

members

유형: 숫자

MongoDB 복제본 세트의 멤버 수입니다.

memberConfig

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB deployment 의 각 MongoDB 샤드 및 해당 멤버에 대한 사양입니다.

샤드 객체 의 요소 순서는 복제본 세트 의 멤버 순서를 반영해야 합니다. 예를 예시 첫 번째 요소는 인덱스 0 에서 Pod에 영향을 주고, 두 번째 요소는 인덱스 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.clusterSpecListspec.shard.clusterSpecList 에 전달된 clusterSpecItem 객체에서만 사용할 수 있습니다. 지정된 클러스터 에 대한 기존 지속성 구성을 재정의합니다.

statefulSet

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB deployment 에서 클러스터의 각 StatefulSet에 대한 StatefulSet 재정의 구성을 제공합니다. 다중 Kubernetes 클러스터 MongoDB deployment 의 모든 클러스터에 적용되는 글로벌 구성을 설정하다 하려면 spec.statefulSet.spec을 참조하세요.

이 설정은 다중 Kubernetes 클러스터 MongoDB 배포의 복제본 세트 리소스 유형에만 적용됩니다.

spec.duplicateServiceObjects

참고

이 필드 멀티 클러스터 샤딩된 클러스터 배포에만 사용할 수 있습니다.

유형: 부울

옵션

기본값: true

토폴로지 가 MultiCluster 이(가) 아닌 경우 무시됩니다. 모든 샤딩된 클러스터 구성 요소에 대한 서비스에 적용됩니다: mongos, configSrvshards.

true 로 설정하다 경우:

Kubernetes Operator는 각 멤버 클러스터 의 모든 멤버 cluster에서 모든 Pod Services 을(를) 생성합니다.

false 로 설정하다 경우:

Kubernetes Operator는 다음 항목만 생성합니다.
spec.mongos.clusterSpecList

참고

이 필드 멀티 클러스터 샤딩된 클러스터 배포에만 사용할 수 있습니다.

유형: 객체 배열

topology=MultiCluster인 경우 필수

다음과 같은 최상위 필드가 있는 멀티 클러스터 샤딩된 클러스터 배포에 사용할 객체 배열 입니다.

clusterName

유형: 문자열

Kubernetes Operator용 MongoDB 컨트롤러가 StatefulSet를 예약하는 클러스터의 이름입니다.

externalAccess

유형: 컬렉션

외부 연결을 위해 다중 Kubernetes 클러스터 MongoDB deployment 를 노출하는 사양입니다. Kubernetes 클러스터 외부에서 멀티-Kubernetes 클러스터 MongoDB deployment 에 연결하는 방법을 학습 보려면 Kubernetes 외부 Kubernetes 멀티-클러스터 리소스에 연결하기를 참조하세요.

이러한 설정은 모든 클러스터의 서비스에 적용 됩니다. 특정 클러스터 에서 이러한 전역 설정을 재정의하려면 spec.clusterSpecList.externalAccess.externalService를 사용합니다.

spec.externalAccess를 추가하면 Kubernetes Operator는 복제본 세트의 각 Pod에 대한 외부 서비스를 생성합니다. 외부 서비스는 클러스터의 각 MongoDB 데이터베이스 Pod에 대한 외부 진입점을 제공합니다. 각 외부 서비스에는 외부 서비스를 특정 Pod와 일치시키는 셀렉터(selector)가 있습니다.

이 설정을 값없이 추가하면 Kubernetes Operator는 다음과 같은 기본값을 사용하여 외부 서비스를 생성합니다.

필드
설명

Name

<pod-name>-svc-external

외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.

Type

LoadBalancer

외부 LoadBalancer 서비스를 생성합니다.

Port

<Port Number>

A port for mongod.

publishNotReadyAddress

true

Specifies that DNS records are created even if the Pod isn't ready. Do not set to false for any database Pod.

참고

spec.clusterSpecList.externalAccess.externalDomain 을 설정하다 하면 외부 서비스가 백업을 위해 다른 포트(Port Number + 1)를 추가합니다.

members

유형: 숫자

MongoDB 복제본 세트의 멤버 수입니다.

memberConfig

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB deployment 의 각 MongoDB 샤드 및 해당 멤버에 대한 사양입니다.

샤드 객체 의 요소 순서는 복제본 세트 의 멤버 순서를 반영해야 합니다. 예를 예시 첫 번째 요소는 인덱스 0 에서 Pod에 영향을 주고, 두 번째 요소는 인덱스 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

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB deployment 에서 클러스터의 각 StatefulSet에 대한 StatefulSet 재정의 구성을 제공합니다. 다중 Kubernetes 클러스터 MongoDB deployment 의 모든 클러스터에 적용되는 글로벌 구성을 설정하다 하려면 spec.statefulSet.spec을 참조하세요.

이 설정은 다중 Kubernetes 클러스터 MongoDB 배포의 복제본 세트 리소스 유형에만 적용됩니다.

spec.shard.clusterSpecList

참고

이 필드 멀티 클러스터 샤딩된 클러스터 배포에만 사용할 수 있습니다.

유형: 객체 배열

topology=MultiCluster인 경우 필수

다음과 같은 최상위 필드가 있는 멀티 클러스터 샤딩된 클러스터 배포에 사용할 객체 배열 입니다.

clusterName

유형: 문자열

Kubernetes Operator용 MongoDB 컨트롤러가 StatefulSet를 예약하는 클러스터의 이름입니다.

externalAccess

유형: 컬렉션

외부 연결을 위해 다중 Kubernetes 클러스터 MongoDB deployment 를 노출하는 사양입니다. Kubernetes 클러스터 외부에서 멀티-Kubernetes 클러스터 MongoDB deployment 에 연결하는 방법을 학습 보려면 Kubernetes 외부 Kubernetes 멀티-클러스터 리소스에 연결하기를 참조하세요.

이러한 설정은 모든 클러스터의 서비스에 적용 됩니다. 특정 클러스터 에서 이러한 전역 설정을 재정의하려면 spec.clusterSpecList.externalAccess.externalService를 사용합니다.

spec.externalAccess를 추가하면 Kubernetes Operator는 복제본 세트의 각 Pod에 대한 외부 서비스를 생성합니다. 외부 서비스는 클러스터의 각 MongoDB 데이터베이스 Pod에 대한 외부 진입점을 제공합니다. 각 외부 서비스에는 외부 서비스를 특정 Pod와 일치시키는 셀렉터(selector)가 있습니다.

이 설정을 값없이 추가하면 Kubernetes Operator는 다음과 같은 기본값을 사용하여 외부 서비스를 생성합니다.

필드
설명

Name

<pod-name>-svc-external

외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.

Type

LoadBalancer

외부 LoadBalancer 서비스를 생성합니다.

Port

<Port Number>

A port for mongod.

publishNotReadyAddress

true

Specifies that DNS records are created even if the Pod isn't ready. Do not set to false for any database Pod.

참고

spec.clusterSpecList.externalAccess.externalDomain 을 설정하다 하면 외부 서비스가 백업을 위해 다른 포트(Port Number + 1)를 추가합니다.

members

유형: 숫자

MongoDB 복제본 세트의 멤버 수입니다.

memberConfig

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB deployment 의 각 MongoDB 샤드 및 해당 멤버에 대한 사양입니다.

샤드 객체 의 요소 순서는 복제본 세트 의 멤버 순서를 반영해야 합니다. 예를 예시 첫 번째 요소는 인덱스 0 에서 Pod에 영향을 주고, 두 번째 요소는 인덱스 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.clusterSpecListspec.shard.clusterSpecList 에 전달된 clusterSpecItem 객체에서만 사용할 수 있습니다. 지정된 클러스터 에 대한 기존 지속성 구성을 재정의합니다.

statefulSet

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB deployment 에서 클러스터의 각 StatefulSet에 대한 StatefulSet 재정의 구성을 제공합니다. 다중 Kubernetes 클러스터 MongoDB deployment 의 모든 클러스터에 적용되는 글로벌 구성을 설정하다 하려면 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.podTemplatespec.shard.clusterSpecList.statefulSet 에 대한 샤드별 재정의입니다.

  • members

    옵션

    topology=SingleCluster 경우에만 사용할 수 있습니다. spec.mongodsPerShardCount 에 대한 재정의를 위한 샤드별 재정의입니다.

  • memberConfig

    옵션

    topology=SingleCluster 경우에만 사용할 수 있습니다. spec.shard.memberConfig 에 대한 샤드별 재정의입니다.

spec.shardPodSpec.persistence.single

유형: 컬렉션

Kubernetes Operator가 하나의 퍼시스턴트 볼륨 클레임(Persistent Volume Claim, PVC)을 생성하고 데이터와 저널 및 로그에 대한 세 개의 디렉토리를 모두 동일한 퍼시스턴트 볼륨 마운트하도록 합니다.

참고

  • You must set the values in this collection if spec.persistent : true.

  • 이 컬렉션 또는 persistence.multiple 컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.

스칼라
데이터 유형
설명

labelSelector

문자열

마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.

storage

문자열

마운트해야 하는 영구 볼륨 의 최소 크기입니다. 이 값은 정수 뒤에 JEDEC 표기법으로 저장 단위를 붙여 표현합니다.

기본값은 16Gi입니다.

For example, if each sharded cluster shard member in requires 60 gigabytes of storage space, set this value to 60Gi.

storageClass

문자열

영구 볼륨 클레임에 지정된 저장 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.

Make sure to set the StorageClass reclaimPolicy to Retain. This ensures that data is retained when a Persistent Volume Claim is removed.

독립형 리소스, 복제본 세트 또는 샤딩된 클러스터와 함께 Prometheus를 사용할 수 있습니다. 자세히 알아보려면 Prometheus와 함께 사용할 리소스 배포를 참조하세요. 예시를 보려면 Prometheus와 함께 사용하는 MongoDB 리소스를 참조하세요.

Prometheus를 MongoDB 리소스와 함께 사용할 때 적용되는 설정은 다음과 같습니다:

spec.prometheus

유형: 배열

옵션

지표를 Prometheus에 노출하기 위한 매개변수가 포함된 목록입니다.

spec.prometheus.metricsPath

유형: 문자열

옵션

기본값: "/metrics"

지표 엔드포인트의 경로를 나타내는 사람이 읽을 수 있는 문자열입니다. 이 설정을 지정하지 않으면 기본값이 적용됩니다.

spec.prometheus.passwordSecretRef

유형: 객체

조건부

HTTP 인증을 위한 시크릿(secret)의 세부 정보가 포함된 객체입니다. MongoDB 리소스와 함께 Prometheus를 사용하려면 이 설정을 지정해야 합니다.

spec.prometheus.passwordSecretRef.key

유형: 문자열

옵션

기본값: "password"

기본 HTTP 인증을 위한 비밀번호를 저장하는 시크릿(secret)의 키를 식별하는 문자열로, 사람이 읽을 수 있습니다. 이 설정을 지정하지 않으면 기본값이 적용됩니다.

spec.prometheus.passwordSecretRef.name

유형: 문자열

조건부

기본 HTTP 인증을 위한 비밀번호를 저장하는 시크릿(secret)을 식별하는 인간 가독형 레이블입니다.MongoDB 리소스와 함께 Prometheus를 사용하려면 이 설정을 지정해야 합니다.

spec.prometheus.port

유형: integer

옵션

기본값: 9216

지표 엔드포인트가 바인딩할 포트를 식별하는 숫자입니다. 이 설정을 지정하지 않으면 기본값이 적용됩니다.

spec.prometheus.tlseSecretKeyRef

유형: 객체

옵션

시크릿 의 세부 정보가 포함된 객체 TLS 인증의 경우.

spec.prometheus.tlseSecretKeyRef.key

유형: 문자열

옵션

기본값: "password"

Human-readable string that indentifies the key in the secret that stores the password for TLS authentication. If you don't specify this setting, the default applies.

spec.prometheus.tlseSecretKeyRef.name

유형: 문자열

조건부

Human-readable label that identifies the secret that contains the password for TLS authentication. If you want to use Prometheus with your MongoDB resource and you want to use TLS authentication, you must specify this setting.

spec.prometheus.username

유형: 문자열

조건부

기본 HTTP 인증을 위해 사용자를 식별하는 사람이 읽을 수 있는 레이블입니다. MongoDB 리소스와 함께 Prometheus를 사용하려면 이 설정을 지정해야 합니다.

다음 보안 설정은 복제본 세트 및 샤딩된 클러스터 리소스 유형에만 적용됩니다.

spec.security.tls.ca

유형: 문자열

Provide the name of the ConfigMap that stores the CA for the MongoDB resource.

중요

If you use a custom CA to sign your TLS certificates for the MongoDB resource, you must specify this parameter.

Kubernetes Operator에서는 ConfigMap에서 MongoDB 리소스 인증서 ca-pem의 이름을 지정해야 합니다.

spec.security.certsSecretPrefix

유형: 문자열

생성한 쿠버네티스 시크릿의 앞에 붙는 텍스트. 복제본 세트 또는 샤딩된 클러스터의 TLS 키와 인증서를 포함합니다.

시크릿 앞에 <prefix>-<metadata.name> 을(를) 붙여야 합니다.

For example, if you call your deployment my-deployment and you set the prefix to mdb, you must name the TLS secret for the client TLS communications mdb-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.replicaSetHorizons instead.

참고

If you add this parameter to a TLS-enabled resource, Kubernetes displays an error when the resource reaches the Pending state. This error displays: Please manually remove the |csr| in order to proceed. To remedy this issue:

  1. Kubernetes가 새 CSR을 생성할 수 있도록 기존 CSR을 모두 제거합니다. 리소스를 삭제하는 방법에 대한 자세한 내용은 Kubernetes 설명서의 리소스 삭제를 참조하세요.

  2. Kubernetes가 CSR을 생성한 후 승인합니다.

spec.additionalMongodConfig.net.ssl.mode

유형: 문자열

기본값: requireSSL

네트워크 연결에 사용되는 sslMode를 지정합니다. 다음은 유효한 옵션입니다:

설명

allowSSL

서버 간 연결이 TLS를 사용하지 않습니다. 수신 연결의 경우 서버는 TLS와 비TLS를 모두 허용합니다.

preferSSL

서버 간 연결은 TLS를 사용합니다. 수신 연결의 경우 서버는 TLS와 비TLS를 모두 허용합니다.

requireSSL

서버가 TLS로 암호화된 연결만 사용하고 허용합니다.

spec.additionalMongodConfig.net.tls.disabledProtocols

유형: 문자열

MongoDB 버전 4.2의 새로운 기능.

TLS로 실행 중인 MongoDB 서버가 1개 또는 그 이상의 특정 프로토콜을 사용하는 수신 연결을 허용하지 않도록 방지합니다. 여러 프로토콜을 지정하려면 쉼표로 구분된 프로토콜 목록을 입력합니다. 예를 들면TLS1_0,TLS1_1입니다.

이 설정은 다음 프로토콜을 인식합니다: TLS1_0, TLS1_1, TLS1_2. MongoDB 4.0.4 버전부터는 (및 3.6.9) TLS1_3도 인식합니다. 인식할 수 없는 프로토콜을 지정하면 서버가 시작되지 않습니다.

macOS에서는 TLS1_1을 비활성화하고 TLS1_0TLS1_2를 모두 활성화할 수 없습니다. 최소 TLS1_0 또는 TLS1_2도 비활성화해야 합니다. 예를 들어 TLS1_0,TLS1_1은 macOS에서 TLS1_2를 비활성화합니다.

비활성화한 프로토콜 목록은 비활성화된 프로토콜의 기본 목록을 대체합니다.

MongoDB 버전 4.0부터 MongoDB 시스템에서 TLS 1.1+를 사용할 수 있는 경우 TLS 1.0의 사용을 비활성화합니다. 비활성화된 TLS 1.0를 활성화 하려면 spec.additionalMongodConfig.net.tls.disabledProtocols의 값으로 none을 지정합니다.

복제본 세트와 샤딩된 클러스터의 구성원은 적어 하나의 공통된 프로토콜을 사용해야 합니다.

spec.security.authentication

유형: 컬렉션

MongoDB 배포서버에 대한 인증 사양입니다.

spec.security.authentication.enabled

유형: 부울

기본값: false

Specifies whether authentication is enabled on the Cloud Manager or Ops Manager project. If set to true, you must set an authentication mechanism in spec.security.authentication.modes.

중요

이 설정을 포함하면 값이 false으로 설정되어 있더라도 Kubernetes Operator가 이 MongoDB 리소스에 대한 인증을 관리합니다. 이 설정이 리소스 사양에 있는 동안에는 Cloud Manager나 Ops Manager의 UI 또는 API를 사용하여 이 리소스에 대한 인증을 구성할 수 없습니다.

Cloud Manager, Ops Manager UI 또는 API를 사용하여 인증을 관리하려면 이 설정을 생략합니다.

spec.security.authentication.modes

유형: 배열

MongoDB deployment 에서 사용하는 인증 메커니즘 지정합니다. 유효한 값은 SCRAM, SCRAM-SHA-1, MONGODB-CR, X509, LDAPOIDC입니다. SCRAM-SHA-1보다 SCRAM-SHA-256 (SCRAM)를 권장합니다. SCRAM-SHA-1를 지정하는 경우 MONGODB-CR도 지정해야 합니다.

참고

X.509 내부 클러스터 인증

To enable X.509 internal cluster authentication for the Cloud Manager or Ops Manager project, set this value to ["X509"] and specify the following settings:

If you provide more than one value for spec.security.authentication.modes, you must also specify a value for spec.security.authentication.agents.mode.

spec.security.authentication.internalCluster

유형: 문자열

Specifies whether X.509 internal cluster authentication is enabled.

X.509 내부 클러스터 인증을 활성화하려면 "X509"으로 설정합니다. 다음 설정을 지정해야 합니다:

Kubernetes Operator는 다음 값을 허용합니다:

  • ["X509"]: X.509 내부 클러스터 인증이 활성화됩니다.

  • "" 또는 생략: 내부 클러스터 인증이 활성화되어 있지 않습니다.

중요

내부 클러스터 인증을 활성화한 후에는 비활성화할 수 없습니다.

spec.security.authentication.requireClientTLSAuthentication

유형: 부울

기본값: false

Specifies whether the MongoDB host requires clients to connect using a TLS certificate. Defaults to true if you enable TLS authentication.

To enable TLS authentication, provide a value for the spec.security.certsSecretPrefix setting.

spec.security.authentication.ldap

유형: 컬렉션

LDAP 인증에 필요합니다.

Configures LDAP authentication for the Cloud Manager or Ops Manager project. To enable LDAP authentication, set spec.security.authentication.modes to ["LDAP"].

spec.security.authentication.ldap.servers

유형: 문자열 배열

LDAP 인증에 필요합니다.

LDAP 서버의 호스트 이름 및 포트 목록. 다음 형식으로 해당 포트와 함께 호스트 이름을 지정합니다.

spec:
security:
authentication:
ldap:
servers:
- "<hostname1>:<port1>"
- "<hostname2>:<port2>"
spec.security.authentication.ldap.timeoutMS

유형: integer

인증 요청이 시간 초과되기까지 대기해야 하는 시간을 밀리초 단위로 지정합니다.

spec.security.authentication.ldap.transportSecurity

유형: 문자열

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 to none.

참고

none 또는 tls 이외의 문자열을 지정하는 경우, Kubernetes Operator는 여전히 설정을 tls로 설정합니다.

spec.security.authentication.ldap.caConfigMapRef

유형: 컬렉션

TLS를 사용한 LDAP 인증에 필요합니다.

ConfigMap 여기에는 LDAP 서버의 TLS 인증서의 유효성을 검사하는 CA 가 포함되어 있습니다.

spec.security.authentication.ldap.caConfigMapRef.name

유형: 문자열

TLS를 사용한 LDAP 인증에 필요합니다.

ConfigMap 의 이름 여기에는 LDAP 서버의 TLS 인증서의 유효성을 검사하는 CA 가 포함되어 있습니다.

spec.security.authentication.ldap.caConfigMapRef.key

유형: 문자열

TLS를 사용한 LDAP 인증에 필요합니다.

LDAP 서버의 TLS 인증서 유효성을 검사하는 인증 기관(CA)을 저장하는 필드의 이름입니다.

spec.security.authentication.ldap.bindQueryUser

유형: 문자열

LDAP 인증에 필요합니다.

LDAP 서버에 연결할 때 MongoDB가 바인딩하는 LDAP 고유 이름

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

유형: 문자열

LDAP 인증에 필요합니다.

Name of the secret that contains the password with which MongoDB binds when connecting to the LDAP server.

The secret must contain only one password field which stores the password.

spec.security.authentication.ldap.authzQueryTemplate

유형: 문자열

LDAP 인증에 필요합니다.

An RFC4515 and RFC4516 LDAP-formatted query URL template executed by MongoDB to obtain the LDAP groups that the user belongs to. The query is relative to the host or hosts specified in spec.security.authentication.ldap.servers. You can use the following tokens in the template:

  • {USER}

    Substitutes the authenticated username, or the transformed username, into the LDAP query.
  • {PROVIDED_USER}

    인증 또는 LDAP 변환 전에 제공된 사용자 이름을 LDAP 쿼리로 대체합니다. (MongoDB 버전 4.2부터 사용 가능)

MongoDB 매뉴얼의 LDAP 쿼리 템플릿

spec.security.authentication.agents.automationLdapGroupDN

유형: 문자열

MongoDB Agent 사용자가 속한 LDAP 그룹의 고유 이름(DN)입니다.

이 설정은 다음과 같은 경우에 필요합니다:

spec.security.authentication.ldap.userToDNMapping

유형: 문자열

Maps the username provided to mongod or mongos for authentication to a LDAP Distinguished Name (DN).

MongoDB 매뉴얼의 security.ldap.userToDNMapping

spec.security.authentication.ldap.userCacheInvalidationInterval

유형: integer

MongoDB가 LDAP 사용자 캐시를 플러시할 때까지 기다리는 시간(초)을 지정합니다. 기본값은 30초입니다.

spec.security.authentication.oidcProviderConfigs

유형: 컬렉션

필수 사항

  • MongoDB 버전은 7.0.11+ 또는 8.0.0+여야 합니다.

  • MongoDB 엔터프라이즈 만 지원됩니다.

참고

spec.security.authentication.mode 이(가) OIDC(으)로 설정하다 경우 컬렉션 에 요소가 하나 이상 필요합니다.

spec.security.authentication.oidcProviderConfigs.audience

유형: 문자열

필수 사항

외부 ID 제공자 (IdP)가 토큰을 사용하는 엔티티입니다. 외부 IdP에 등록한 앱 의 오디언스 값을 입력합니다. 둘 이상의 IdP가 정의된 경우 이는 issuerURI를 공유하는 각 구성에 대해 고유한 값이어야 합니다.

spec.security.authentication.oidcProviderConfigs.authorizationMethod

유형: 문자열

필수 사항

유효한 값은 WorkforceIdentityFederationWorkloadIdentityFederation 입니다. Workforce Identity Federation을 사용하여 사람이 배포에 액세스 있도록 싱글 사인온을 구성하세요. 프로그래밍 방식의 애플리케이션 으로 배포서버에 액세스 하려면 Workload Identity Federation을 사용하세요. MongoDB 리소스 당 하나의 Workforce Identity Federation IdP만 구성할 수 있습니다. 자세한 학습 은 OIDC/OAuth 를 사용한 인증 및 권한 부여 2 를0 참조하세요.

spec.security.authentication.oidcProviderConfigs.authorizationType

유형: 문자열

필수 사항

유효한 값은 GroupMembershipUserID입니다. IdP 사용자 그룹 멤버십을 기반으로 권한 부여 부여하려면 GroupMembership 를 선택하고, 개별 사용자에게 권한 부여 부여하려면 UserID 을 선택합니다.

spec.security.authentication.oidcProviderConfigs.clientId

유형: 문자열

필수 사항

등록된 애플리케이션 의 고유 식별자입니다. 외부 ID 제공자에 등록한 앱 의 clientId 값을 입력합니다.

spec.security.authentication.oidcProviderConfigs.configurationName

유형: 문자열

필수 사항

이 구성을 식별하는 고유 레이블입니다. 이 레이블은 MongoDB Ops Manager 사용자가 볼 수 있으며 권한 부여 위한 사용자 및 역할을 생성할 때 사용됩니다. 대소문자를 구분하며 다음 문자만 포함할 수 있습니다.

  • 영숫자(~z 및 0 ~ 9의 조합)

  • 하이픈(-)

  • 밑줄(_)

spec.security.authentication.oidcProviderConfigs.groupsClaim

유형: 문자열

옵션

사용자 보안 주체 ID를 포함하는 클레임의 식별자. IdP가 다른 클레임을 사용하지 않는 한 기본값을 그대로 사용합니다.

spec.security.authentication.oidcProviderConfigs.issuerURI

유형: 문자열

필수 사항

등록된 IdP 애플리케이션 에서 제공하는 발급자 값입니다. MongoDB 이 URI를 사용하여 /.wellknown/open-id-configuration 엔드포인트에서 사용할 수 있는 OpenID 제공자 구성 문서를 찾습니다. MongoDB 8.0+의 경우 issuerURI 와 대상의 조합은 OIDC 제공자 구성 전체에서 고유해야 합니다. 다른 MongoDB 버전의 경우 issuerURI 자체가 고유해야 합니다.

spec.security.roleRefs

유형: 배열

MongoDB deployment 대한 세분화된 액세스 제어를 제공하는 ClusterMongoDBRole 사용자 지정 리소스를 참조하는 배열입니다.

spec.security.roleRefs.kind

유형: 문자열

참조된 사용자 지정 리소스 의 종류입니다. 예시: ClusterMongoDBRole.

spec.security.roleRefs.kind

유형: 문자열

참조된 사용자 지정 리소스 의 종류입니다. 예시: ClusterMongoDBRole.

spec.security.authentication.oidcProviderConfigs.requestedScopes

유형: 문자열

옵션

사용자에게 권한 권한 부여 엔드포인트에서 데이터를 요청 수 있는 권한을 부여하는 토큰입니다. Workforce Identity Federation 권한 부여 방법에만 사용됩니다.

spec.security.authentication.oidcProviderConfigs.userClaim

유형: 문자열

필수 사항

사용자 보안 주체 ID를 포함하는 클레임의 식별자. IdP가 다른 클레임을 사용하지 않는 한 기본값을 그대로 사용합니다.

spec.security.authentication.agents

유형: 컬렉션

Cloud Manager 또는 Ops Manager 프로젝트에 대한 MongoDB 에이전트 인증 구성입니다.

spec.security.authentication.agents.mode

유형: 문자열

The authentication mechanism that the MongoDB Agents for your MongoDB deployment use. Valid values are SCRAM, SCRAM-SHA-1, MONGODB-CR, X509, OIDC, and LDAP. The value you specify must also be present in spec.security.authentication.modes. We recommend SCRAM-SHA-256 (SCRAM) over SCRAM-SHA-1. If you specify SCRAM-SHA-1, you must also specify MONGODB-CR.

This setting is required if you specified more than one value for spec.security.authentication.modes.

spec.security.authentication.agents.automationUserName

유형: 문자열

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.mode is LDAP.

spec.security.authentication.agents.automationPasswordSecretRef

유형: 컬렉션

Details of the secret that contains the password for the spec.security.authentication.agents.automationUserName user.

This setting is required if spec.security.authentication.agents.mode is LDAP.

spec.security.authentication.agents.automationPasswordSecretRef.name

유형: 문자열

Name of the secret that contains the password for the spec.security.authentication.agents.automationUserName user. 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.automationUserName user in your LDAP deployment.

This setting is required if spec.security.authentication.agents.mode is LDAP.

spec.security.authentication.agents.automationPasswordSecretRef.key

유형: 문자열

Key in the spec.security.authentication.agents.automationPasswordSecretRef.name secret that contains the password for the user in spec.security.authentication.agents.automationUserName.

This setting is required if spec.security.authentication.agents.mode is LDAP.

spec.security.authentication.agents.clientCertificateSecretRef.name

유형: 문자열

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.enabled must be true.

예시

이 예에서 customRole(이)라는 사용자 정의 역할은 이 역할이 할당된 사용자에게 허용됩니다.

  • pets 데이터베이스의 cats 컬렉션에 문서를 삽입합니다.

  • pets 데이터베이스의 dogs 컬렉션에 문서를 찾아 삽입합니다.

1---
2apiVersion: mongodb.com/v1
3kind: MongoDB
4metadata:
5 name: <my-replica-set>
6spec:
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.role

유형: 문자열

사용자 지정 역할의 이름입니다.

spec.security.roles.db

유형: 문자열

사용자 정의 역할을 저장할 데이터베이스입니다.

예시

admin

spec.security.roles.authenticationRestrictions

유형: 배열

Array that defines the IP address from which and to which users assigned this spec.security.roles.role can connect.

spec.security.roles.authenticationRestrictions.clientSource

유형: 배열

Array of IP addresses or CIDR blocks from which users assigned this spec.security.roles.role can connect.

MongoDB 서버는 이 배열에 없는 클라이언트에서 요청이 오는 경우 이 역할이 부여된 사용자의 연결 요청을 거부합니다.

spec.security.roles.authenticationRestrictions.serverAddress

유형: 배열

Array of IP addresses or CIDR blocks to which users assigned this spec.security.roles.role can connect.

MongoDB 서버는 클라이언트가 이 배열에 없는 서버에 연결을 요청하는 경우 이 역할이 부여된 사용자의 연결 요청을 거부합니다.

spec.security.roles.privileges

유형: 배열

이 역할이 부여된 사용자가 소유한 권한을 설명하는 배열입니다.

spec.security.roles.privileges.actions

유형: 배열

이 역할을 부여받은 사용자가 수행할 수 있는 작업 목록입니다. 허용되는 값의 목록은 Kubernetes Operator와 함께 배포한 MongoDB 버전에 대한 MongoDB 매뉴얼의 권한 조치를 참조하세요.

spec.security.roles.privileges.resource

유형: 컬렉션

Resources for which the privilege actions apply.

이 컬렉션에는 둘 중 하나가 포함되어야 합니다:

spec.security.roles.privileges.resource.database

유형: 문자열

Database for which the privilege actions apply.

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

유형: 문자열

Collection in the database for which the privilege actions apply.

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

유형: 부울

Default(기본값): False

Flag that indicates that the privilege actions apply to all databases and collections in the MongoDB deployment. If omitted, defaults to false.

If set to true, do not provide values for spec.security.roles.privileges.resource.database and spec.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
...

다음 StatefulSets 설정은 복제본 세트 및 샤딩된 클러스터 리소스 유형에만 적용됩니다.

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 MongoDB resources.

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.replicas

spec.selector

spec.podManagementPolicy

spec.revisionHistoryLimit

spec.updateStrategy.type

spec.updateStrategy.rollingUpdate

spec.serviceName

spec.template

spec.volumeClaimTemplates

spec.statefulSet.spec.serviceName

유형: 문자열

기본값: <resource_name>-svc<resource_name>-svc-external

StatefulSet에 생성하거나 사용할 Kubernetes 서비스의 이름입니다. 이 이름의 서비스가 이미 존재하는 경우, Kubernetes Operator용 MongoDB 컨트롤러는 해당 서비스를 삭제 하거나 다시 생성하지 않습니다. 이 설정을 사용하면 사용자 지정 서비스를 직접 생성하고 Kubernetes Operator가 이를 재사용할 수 있습니다.

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.

지원됨(유지됨)
지원되지 않음(제거됨)

metadata.namespace
metadata.labels
metadata.annotations
spec.volumeMode
spec.storageClassName
spec.accessModes [1]
spec.selector
spec.resources.limits
spec.resources.requests
spec.dataSource

spec.volumeAttributesClassName
spec.dataSourceRef
spec.volumeName

[1] Kubernetes 연산자는 지정한 액세스 모드를 기본 액세스 모드에 대체하는 대신 추가합니다.