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

Kubernetes 클러스터 리소스 사양

The MongoDBMultiCluster resource defines your multi-Kubernetes cluster MongoDB deployment and gives the MongoDB Controllers for Kubernetes Operator the information it needs to create or update your clusters, Ops Manager deployment, statefulSets, services, and other Kubernetes resources.

다음 예제는 다중 Kubernetes 클러스터 MongoDB 배포에 대한 리소스 사양을 보여줍니다.

1# This example provides statefulSet overrides per cluster.
2
3apiVersion: mongodb.com/v1
4kind: MongoDBMultiCluster
5metadata:
6 name: multi-replica-set
7spec:
8 version: 8.0.0
9 type: ReplicaSet
10 duplicateServiceObjects: false
11 credentials: my-credentials
12 opsManager:
13 configMapRef:
14 name: my-project
15 clusterSpecList:
16 - clusterName: cluster1.example.com
17 members: 2
18 statefulSet:
19 spec:
20 template:
21 spec:
22 containers:
23 # Example of custom sidecar containers. Remove it before using the file in production.
24 - name: sidecar1
25 image: busybox
26 command: [ "sleep" ]
27 args: [ "infinity" ]
28 # Use the following settings to override the default storage size of the "data" Persistent Volume.
29 volumeClaimTemplates:
30 - metadata:
31 name: data
32 spec:
33 resources:
34 requests:
35 storage: 1Gi
36 - clusterName: cluster2.example.com
37 members: 1
38 statefulSet:
39 spec:
40 template:
41 spec:
42 containers:
43 # Example of custom sidecar containers. Remove it before using the file in production.
44 - name: sidecar2
45 image: busybox
46 command: [ "sleep" ]
47 args: [ "infinity" ]
48 volumeClaimTemplates:
49 - metadata:
50 name: data
51 spec:
52 resources:
53 requests:
54 storage: 1Gi
55 - clusterName: cluster3.example.com
56 members: 1
57 statefulSet:
58 spec:
59 template:
60 spec:
61 containers:
62 # Example of custom sidecar containers. Remove it before using the file in production.
63 - name: sidecar3
64 image: busybox
65 command: [ "sleep" ]
66 args: [ "infinity" ]
67 volumeClaimTemplates:
68 - metadata:
69 name: data
70 spec:
71 resources:
72 requests:
73 storage: 1Gi
74
75...

이 섹션에서는 MongoDBMultiCluster 리소스에 사용해야 하는 설정에 대해 설명합니다.

apiVersion

유형: 문자열

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

kind

유형: 문자열

생성할 MongoDB Kubernetes 리소스의 종류입니다. 이를 MongoDBMultiCluster 으로 설정합니다.

metadata.name

유형: 문자열

생성 중인 MongoDB Kubernetes 리소스의 이름입니다.

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

spec.credentials

유형: 문자열

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

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

중요

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

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

spec.type

유형: 문자열

생성할 MongoDB Kubernetes 리소스의 유형입니다. 다중 Kubernetes cluster MongoDB deployment에 허용되는 유일한 값은 ReplicaSet 입니다.

spec.version

유형: 문자열

MongoDBMultiCluster 리소스에 대해 설치된 MongoDB의 버전입니다.

중요

호환되는 MongoDB Server 버전을 선택하도록 합니다.

호환되는 버전은 MongoDB database 리소스가 사용하는 기본 이미지에 따라 다릅니다.

MongoDBMultiCluster 리소스는 다음 설정을 사용할 수 있습니다.

spec.additionalMongodConfig

유형: 컬렉션

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

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

  • net.port

  • net.tls.certificateKeyFile

  • net.tls.clusterFile

  • replication.replSetName

  • security.clusterAuthMode

  • sharding.clusterRole

  • storage.dbPath

  • systemLog.destination

  • systemLog.path

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

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

spec.agent

유형: 컬렉션

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

spec.agent.startupOptions

유형: 컬렉션

MongoDB 데이터베이스 리소스를 시작하는 데 사용할 MongoDB Agent 설정입니다.

MongoDB Agent 설정을 키-값 쌍으로 제공해야 합니다. 값은 문자열이어야 합니다. 지원되는 MongoDB Agent 설정 목록은 다음을 참조하세요.

spec.backup

유형: 컬렉션

spec.backup.mode 에 대한 컬렉션 컨테이너입니다. Kubernetes Operator에서 MongoDB 리소스에 대한 지속적인 백업을 가능하게 합니다.

spec.backup.assignmentLabels

유형: 배열

백업 데몬 서비스 프로세스에 대한 할당 레이블 목록입니다. 할당 레이블을 사용하여 특정 백업 데몬 프로세스가 특정 프로젝트와 연결되어 있는지 식별합니다. Kubernetes Operator를 사용하여 할당 레이블을 설정하는 경우, 할당 레이블에 대해 Kubernetes 구성 파일에서 설정한 값이 MongoDB Ops Manager UI에 정의된 값을 재정의합니다. Kubernetes Operator를 사용하여 설정하지 않은 할당 레이블은 MongoDB Ops Manager UI에 설정된 값을 계속 사용합니다.

spec.backup.autoTerminateOnDeletion

유형: 부울

Flag that indicates whether the Kubernetes Operator stops and terminates the backup when you delete a MongoDBMultiCluster resource. The default value is false. Setting this flag to true is useful when you want to delete the MongoDBMultiCluster resource while the spec.backup.mode setting is set to enabled.

spec.backup.encryption

유형: 객체

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

spec.backup.encryption.kmip

유형: 객체

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

spec.backup.encryption.kmip.client

유형: 객체

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

spec.backup.mode

유형: 문자열

MongoDBMultiCluster 리소스에 대한 연속 백업을 활성화합니다. 가능한 값은 enabled, disabledterminated 입니다.

참고

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

spec.backup.mode 를 사용하여 MongoDB 리소스에 대한 연속 백업을 활성화한 후 백업 상태를 확인할 수 있습니다.

spec.backup.snapshotSchedule

유형: 컬렉션

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

spec.backup.snapshotSchedule.dailySnapshotRetentionDays

유형: 숫자

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

spec.backup.snapshotSchedule.fullIncrementalDayOfWeek

유형: 문자열

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

spec.backup.snapshotSchedule.monthlySnapshotRetentionMonths

유형: 숫자

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

spec.backup.snapshotSchedule.pointInTimeWindowHours

유형: 숫자

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

spec.backup.snapshotSchedule.referenceHourOfDay

유형: 숫자

24 시간 시계를 사용하여 스냅샷을 예정 하루의UTC 시간입니다. 0 ~ 23 사이의 값을 설정하다 수 있습니다.

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

유형: 숫자

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

spec.backup.snapshotSchedule.snapshotRetentionDays

유형: 숫자

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

spec.backup.snapshotSchedule.weeklySnapshotRetentionWeeks

유형: 숫자

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

spec.cloudManager.configMapRef.name

유형: 문자열

spec.opsManager.configMapRef.name의 별칭입니다.

spec.clusterSpecList

유형: 컬렉션

MongoDBMultiCluster 리소스에 있는 각 Kubernetes cluster의 사양 목록입니다.

spec.clusterSpecList.clusterName

유형: 문자열

Name of the cluster where the MongoDB Controllers for Kubernetes Operator schedules the StatefulSet. When the Kubernetes Operator deploys this MongoDBMultiCluster resource, it creates a service account. This name is what the service account in the operator cluster uses to communicate with the workload clusters.

spec.clusterSpecList.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>-<cluster-idx>-<pod-idx>.<externalDomain>

예를 들면 다음과 같습니다.

multi-replica-set-0-1.cluster-0.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.

복제본 세트에 연결하기 위한 다른 호스트 이름을 지정하려면 spec.connectivity.replicaSetHorizons 설정을 사용할 수 있습니다. 그러나 다음 연결은 여전히 외부 도메인과 함께 호스트 이름을 사용합니다.

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.

중요

서비스 메시 없이 다중 Kubernetes 클러스터 MongoDB deployment 복제본 세트 배포할 때만 이 설정을 사용합니다. 멀티-Kubernetes 클러스터에 배포: 서비스 메시 없음을참조하세요.

spec.clusterSpecList.externalAccess.externalService

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB 배포에서 특정 클러스터를 외부에 노출하기 위한 구성입니다. 이러한 설정은 전역 spec.externalAccess.externalService 를 재정의합니다. 설정.

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.clusterSpecList.externalAccess.externalService.annotations

유형: 컬렉션

멀티 Kubernetes 클러스터 MongoDB deployment 의 특정 클러스터 에 cloud 제공자별 구성 설정을 추가할 수 있는 키-값 쌍입니다. 이 설정은 전역 설정인 spec.externalAccess.externalService.annotations를 재정의합니다. 자세한 학습 은 주석 및 Kubernetes cloud 제공자 설명서를 참조하세요.

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

설명

{resourceName}

{namespace}

{podIndex}

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

{podName}

{resourceName}-{clusterIndex}-{podIndex} 과 같습니다.

{clusterName}

The current cluster name set in spec.clusterSpecList.clusterName.

{clusterIndex}

The index initially assigned by the Kubernetes Operator for the current cluster name set in spec.clusterSpecList.clusterName.

This value might not reflect the order of the member clusters defined in spec.clusterSpecList. Although you can change the order of member clusters in spec.clusterSpecList, the Kubernetes Operator still uses the index that it initially assigned for the current cluster name.

{statefulSetName}

The StatefulSet. Equal to {resourceName}-{clusterIndex}.

{externalServiceName}

지정한 자리 표시자 값을 기반으로 외부 서비스의 생성된 이름입니다. {resourceName}-{clusterIndex}-{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 multi-Kubernetes cluster MongoDB deployment to use external domains, such as for a deployment without service mesh, the process hostname uses the following format:

{resourceName}-{clusterIndex}-{podIndex}.{mongodProcessDomain}

예를 들면 다음과 같습니다. mdb-rs-0-1.example.com

배포에서 외부 도메인을 사용하지 않는 경우 프로세스 호스트 이름은 다음 형식을 사용합니다.

{resourceName}-{clusterIndex}-{podIndex}-svc.{namespace}.svc.cluster.local

예를 들면 다음과 같습니다. mdb-rs-1-svc.ns.svc.cluster.local

참고

표에 지정된 대로 알려진 자리 표시자 값만 사용해야 하며 자리 표시자가 비어 있거나 null 값을 사용하지 않도록 해야 합니다. 그렇지 않으면 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.clusterSpecList.externalAccess.externalService.spec

유형: 컬렉션

ServiceSpec 구성 . 자세히 알아보려면 spec.clusterSpecList.externalAccess.externalService를 참조하세요.

spec.clusterSpecList.memberConfig

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB 배포의 각 MongoDB 복제본 세트 및 해당 멤버에 대한 사양입니다.

각 복제본 세트에 대한 객체 내 요소의 순서는 복제본 세트의 멤버 순서를 반영해야 합니다. 예를 들어 첫 번째 요소는 인덱스 0 에서 파드에 영향을 미치고, 두 번째 요소는 인덱스 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"
spec.clusterSpecList.memberConfig.priority

유형: 문자열

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

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

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

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

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

spec.clusterSpecList.memberConfig.tags

유형: 매핑

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

spec.clusterSpecList.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.clusterSpecList.members

유형: 숫자

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

spec.clusterSpecList.service

유형: 문자열

기본값: <resource_name>+"-service"

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

spec.clusterSpecList.statefulSet.spec

유형: 컬렉션

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

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

spec.connectivity.replicaSetHorizons

유형: 컬렉션

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

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

참고

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

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

유형: 부울

기본값: true

Specifies whether the Kubernetes Operator duplicates a Pod's service mesh object in each cluster to allow DNS resolution. Set to false if you configure a DNS proxy for your service mesh. For example, see DNS Proxying in the Istio documentation.

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

참고

If you set spec.clusterSpecList.externalAccess.externalDomain, the external service adds another port (Port Number + 1) for backups.

spec.externalAccess.externalService

유형: 컬렉션

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

유형: 컬렉션

멀티 Kubernetes 클러스터 MongoDB deployment 의 모든 클러스터에 cloud 제공자별 구성 설정을 추가할 수 있는 키-값 쌍입니다. 클러스터별 재정의는 spec.clusterSpecList.externalAccess.externalService.annotations를 참조하세요. 자세한 학습 은 Kubernetes 배포에 사용하는 cloud 제공자 에 대한 주석 및 설명서를 참조하세요.

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

설명

{resourceName}

{namespace}

{podIndex}

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

{podName}

{resourceName}-{clusterIndex}-{podIndex} 과 같습니다.

{clusterName}

The current cluster name set in spec.clusterSpecList.clusterName.

{clusterIndex}

The index initially assigned by the Kubernetes Operator for the current cluster name set in spec.clusterSpecList.clusterName.

This value might not reflect the order of the member clusters defined in spec.clusterSpecList. Although you can change the order of member clusters in spec.clusterSpecList, the Kubernetes Operator still uses the index that it initially assigned for the current cluster name.

{statefulSetName}

The StatefulSet. Equal to {resourceName}-{clusterIndex}.

{externalServiceName}

지정한 자리 표시자 값을 기반으로 외부 서비스의 생성된 이름입니다. {resourceName}-{clusterIndex}-{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 multi-Kubernetes cluster MongoDB deployment to use external domains, such as for a deployment without service mesh, the process hostname uses the following format:

{resourceName}-{clusterIndex}-{podIndex}.{mongodProcessDomain}

예를 들면 다음과 같습니다. mdb-rs-0-1.example.com

배포에서 외부 도메인을 사용하지 않는 경우 프로세스 호스트 이름은 다음 형식을 사용합니다.

{resourceName}-{clusterIndex}-{podIndex}-svc.{namespace}.svc.cluster.local

예를 들면 다음과 같습니다. mdb-rs-1-svc.ns.svc.cluster.local

참고

표에 지정된 대로 알려진 자리 표시자 값만 사용해야 하며 자리 표시자가 비어 있거나 null 값을 사용하지 않도록 해야 합니다. 그렇지 않으면 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

유형: 컬렉션

ServiceSpec에 대한 구성입니다. 자세히 학습 spec.externalAccess.externalService를 참조하세요.

spec.featureCompatibilityVersion

유형: 숫자

Limits changes to data that occur with an upgrade to a new major version. This allows you to downgrade to the previous major version. To learn more about feature compatibility, see setFeatureCompatibilityVersion in the MongoDB Manual.

spec.logLevel

유형: 문자열

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

  • DEBUG

  • INFO

  • WARN

  • ERROR

  • FATAL

spec.opsManager.configMapRef.name

유형: 문자열

Cloud Manager 또는 MongoDB Ops Manager 연결 구성이 있는 ConfigMap의 이름입니다. spec.cloudManager.configMapRef.name 설정은 이 설정의 별칭이며 대신 사용할 수 있습니다.

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

중요

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

Kubernetes Operator는 ConfigMap에 대한 모든 변경 사항을 추적하고 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.security.authentication

유형: 컬렉션

다중 Kubernetes 클러스터 MongoDB deployment 에 대한 인증 사양입니다.

spec.security.authentication.agents

유형: 컬렉션

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

spec.security.authentication.agents.automationLdapGroupDN

유형: 문자열

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

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

spec.security.authentication.agents.automationPasswordSecretRef

유형: 컬렉션

시크릿 의 세부 정보 spec.security.authentication.agents.automationUserName 의 비밀번호가 포함된 사용자.

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.automationPasswordSecretRef.name

유형: 문자열

spec.security 의 비밀번호가 포함된 시크릿의 이름입니다. 인증.agents.automationUserName 사용자. Kubernetes Operator를 배포 하는 동일한 네임스페이스 에 이 시크릿을 생성해야 합니다.

kubectl create secret generic ldap-agent-user \
--from-literal="password=<password>" -n <metadata.namespace>

이 시크릿에는 하나의 키가 포함되어야 하며, 그 값은 spec.security.authentication.agents.automationUserName 의 비밀번호와 일치합니다. LDAP 입니다.

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

spec.security.authentication.agents.automationPasswordSecretRef.optional

유형: 부울

이러한 옵션이 필수인지 선택 사항인지 지정합니다.

spec.security.authentication.agents.automationUserName

유형: 문자열

MongoDB Agent가 다중 Kubernetes 클러스터 MongoDB deployment와 상호 작용하는 데 사용하는 사용자의 이름입니다. 사용자 이름은 spec.security.authentication.ldap.userToDNMapping 에 따라 LDAP DN(고유 이름)에 매핑됩니다. 결과 DN은 LDAP 배포에 이미 존재해야 합니다.

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

spec.security.authentication.agents.clientCertificateSecretRef.name

유형: 문자열

기본값 : Agent-certs

Specifies the secret that contains the MongoDB Agent's TLS certificate.

이 시크릿에는 mms-automation-agent-pem 키가 포함되어야 합니다. 이 키의 값은 서버에서 유효성을 검사할 수 있는 TLS 인증서여야 합니다.

Kubernetes Operator를 배포하는 네임스페이스에 시크릿을 생성해야 합니다.

kubectl create secret generic agent-certs \
--from-file=mms-automation-agent-pem=<automation-cert.pem> \
--namespace=<metadata.namespace>
spec.security.authentication.enabled

유형: 부울

기본값: false

Cloud Manager 또는 MongoDB Ops Manager 프로젝트에서 인증을 활성화할지 여부를 지정합니다. true 로 설정하면 spec.security.authentication.modes에서 인증 메커니즘을 설정해야 합니다.

중요

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

Cloud Manager 또는 Ops Manager 사용자 인터페이스나 API를 사용하여 인증을 관리하려면 이 설정을 생략합니다.

spec.security.authentication.agents.mode

유형: 문자열

The authentication mechanism that the MongoDB Agents for your multi-Kubernetes cluster MongoDB deployment use. Valid values are SCRAM, SCRAM-SHA-1, MONGODB-CR, X509, 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.

spec.security에 둘 이상의 값을 지정한 경우 이 설정이 필요합니다. 인증.modes.

spec.security.authentication.ignoreUnknownUsers

유형: 부울

기본값: false

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

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

spec.security.authentication.internalCluster

유형: 문자열

X. 내부509 클러스터 인증 사용할지 여부를 지정합니다.

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

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

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

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

중요

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

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

유형: 문자열

LDAP 인증에 필요합니다.

사용자가 속한 LDAP 그룹을 가져오기 위해 MongoDB 가 실행하는 RFC4515RFC LDAP 형식의 쿼리 URL 템플릿입니다. 쿼리 에 지정된 하나 이상의 호스팅하다 를 기준으로 합니다. 템플릿에서 다음 토큰을 사용할 수4516 spec.security.authentication.ldap.servers 있습니다.

  • {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.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.bindQueryUser

유형: 문자열

LDAP 인증에 필요합니다.

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

spec.security.authentication.ldap.caConfigMapRef

유형: 컬렉션

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

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

spec.security.authentication.ldap.caConfigMapRef.key

유형: 문자열

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

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

spec.security.authentication.ldap.caConfigMapRef.name

유형: 문자열

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

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

spec.security.authentication.ldap.caConfigMapRef.optional

유형: 부울

이러한 옵션이 필수인지 선택 사항인지 지정합니다.

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

유형: integer

MongoDB LDAP 사용자 캐시 플러시하기 위해 대기하는 시간(초)을 지정합니다. 기본값은 30초입니다.

spec.security.authentication.ldap.userToDNMapping

유형: 문자열

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

자세한 내용은 MongoDB 매뉴얼의 security.ldap.userToDNMapping 을 참조하세요.

spec.security.authentication.modes

유형: 배열

다중 Kubernetes 클러스터 MongoDB 배포에서 사용하는 인증 메커니즘을 지정합니다. 유효한 값은 SCRAM, SCRAM-SHA-1, MONGODB-CR, X509LDAP 입니다. SCRAM-SHA-256 (SCRAM) 보다 을(를)SCRAM-SHA-1 권장합니다. SCRAM-SHA-1 을 지정하는 경우 MONGODB-CR 도 지정해야 합니다.

참고

Cloud Manager 또는 Ops Manager 프로젝트 에 대해 X.509 내부 클러스터 인증 활성화 하려면 이 값을(으)로 ["X509"] 설정하다 하고 다음 설정을 지정합니다.

spec.security.authentication.modes 에 둘 이상의 값을 제공하는 경우 spec.security.authentication.agents.mode에 대한 값도 지정해야 합니다.

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.

TLS 인증을 활성화하려면 spec.security.certsSecretPrefix 설정.

spec.security.certsSecretPrefix

유형: 문자열

Kubernetes 시크릿 에 접두사로 붙일 텍스트 복제본 세트의 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 인증서가 포함된 시크릿 이름을 지정하는 방법에 대해 자세히 알아보려면 배포에 적용되는 다중 Kubernetes cluster 퀵 스타트 의 주제를 참조하세요.

spec.security.roles

유형: 배열

다중 Kubernetes 클러스터 MongoDB 배포에 대한 세분화된 액세스 제어를 제공하는 사용자 정의 역할 을 정의하는 배열입니다.

To enable user-defined roles, the spec.security.authentication.enabled must be true.

예시

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

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

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

1 security:
2 authentication:
3 enabled: true
4 modes:
5 - "SCRAM"
6 roles:
7 - role: "customRole"
8 db: admin
9 privileges:
10 - actions:
11 - insert
12 resource:
13 collection: cats
14 db: pets
15 - actions:
16 - insert
17 - find
18 resource:
19 collection: dogs
20 db: pets
21...
spec.security.roles.authenticationRestrictions

유형: 배열

spec.security.roles.role 이 할당된 사용자가 연결할 수 있는 IP 주소를 정의하는 배열입니다.

spec.security.roles.authenticationRestrictions.clientSource

유형: 배열

spec.security.roles.role 이 할당된 사용자가 연결할 수 있는 IP 주소 또는 CIDR 블록의 배열입니다.

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

spec.security.roles.authenticationRestrictions.serverAddress

유형: 배열

spec.security.roles.role 이 할당된 사용자가 연결할 수 있는 IP 주소 또는 CIDR 블록의 배열입니다.

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

spec.security.roles.db

유형: 문자열

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

예시

admin

spec.security.roles.privileges

유형: 배열

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

spec.security.roles.privileges.actions

유형: 배열

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

spec.security.roles.privileges.resource

유형: 컬렉션

spec.security.roles.privileges.actions 권한이 적용되는 리소스입니다.

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

spec.security.roles.privileges.resource.cluster

유형: 부울

기본값: false

spec.security.roles.privileges.actions 권한이 MongoDB 배포의 모든 데이터베이스 및 컬렉션에 적용됨을 나타내는 플래그입니다.

true로 설정된 경우 spec.security.roles.privileges.resource.dbspec.security.roles.privileges.resource.collection에 대한 값을 제공하지 마세요.

spec.security.roles.privileges.resource.collection

유형: 문자열

spec.security.roles.privileges.actions 권한이 적용되는 spec.security.roles.privileges.resource.db 의 컬렉션입니다.

이 설정에 값을 제공하는 경우 spec.security.roles.privileges에 대한 값도 제공해야 합니다. 리소스.db.

spec.security.roles.privileges.resource.db

유형: 문자열

spec.security.roles.privileges.actions 권한이 적용되는 데이터베이스입니다.

이 설정에 값을 제공하는 경우 spec.security.roles.privileges에 대한 값도 제공해야 합니다. 리소스. 컬렉션.

spec.security.roles.role

유형: 문자열

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

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

복제본 세트 리소스에는 이 매개 변수가 필요하지 않습니다. spec.connectivity.replicaSetHorizons 사용 대신.

참고

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.security.tls.ca

유형: 문자열

ConfigMap 의 이름을 입력합니다.CA 를 저장합니다.

중요

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

Kubernetes 연산자를 사용하려면 ConfigMap에서 MongoDBMultiCluster 리소스 ca-pem 에 대한 인증서 이름을 지정해야 합니다.

spec.security.tls.enabled

유형: 부울

중요

spec.security.tls.enabled 는 더 이상 사용되지 않으며 향후 Kubernetes Operator 출시하다 에서 제거될 예정입니다. TLS를 활성화 하려면 spec.security.certsSecretPrefix 설정.

TLS 인증서를 사용하여 통신을 암호화합니다:

  • 복제본 세트 또는 샤딩된 클러스터 구성의 MongoDB 호스트

  • Clients (mongo shell, drivers, MongoDB Compass, and others) and the MongoDB deployment

spec.statefulSet.spec

유형: 컬렉션

Kubernetes Operator용 MongoDB 컨트롤러가 다중 Kubernetes 클러스터 MongoDB deployment 위해 생성하는 StatefulSet 에 대한 글로벌 사양입니다.

에 추가할 수 있는 필드를 spec.statefulSet.spec 검토 하려면 Kubernetes 문서에서 StatefulSetSpec v1 앱을 참조하세요.