참고
이 페이지의 어느 곳에서나 Ops Manager라고 표시된 곳에서는 Cloud Manager로 대체할 수 있습니다.
Kubernetes Operator용 MongoDB 컨트롤러 는 사용자가 쓰기 (write) 사양 파일에서 Kubernetes statefulSets 를 생성합니다.
Kubernetes Operator는 Kubernetes 에서 MongoDB 전용 리소스를 사용자 지정 리소스로생성합니다.
이러한 사용자 지정 리소스를 관리하려면 다음 프로세스를 사용하세요:
MongoDB리소스 사양을 만들거나 업데이트합니다.Kubernetes Operator용 MongoDB 컨트롤러에 지시하여 Kubernetes 환경에 적용 . 결과적으로 Kubernetes Operator는 다음 조치를 수행합니다.
정의된 StatefulSets, 서비스 및 기타 Kubernetes 리소스를 생성합니다.
변경 사항을 반영하도록 Ops Manager 배포 구성을 업데이트합니다.
각 MongoDB 리소스 YAML의 객체 사양을 사용하여 독립형, 복제본 세트 및 샤딩된 클러스터와 같은 MongoDB 객체 의 특성과 설정을 정의합니다.
공통 리소스 설정
모든 리소스 유형은 다음 설정을 사용해야 합니다:
필수 사항
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, andrunAsNonRoot = trueinsecurityContext. Kubernetes Operator setsfsgroupequal torunAsUserto make the volume writable for a user that runs the main process in the container. To learn more, see Configure a Security Context for a Pod or Container and the related discussion in the Kubernetes documentation. If redeploying the resource doesn't fix issues with your Persistent Volume, contact MongoDB Support.If you do not use Persistent Volumes, the Disk Usage and Disk IOPS charts cannot be displayed in either the Processes tab on the Deployment page or in the Metrics page when reviewing the data for this deployment.
spec.version유형: 문자열
MongoDB리소스에 설치한 MongoDB의 버전.참고
If you update this value to a later version of MongoDB for your database resources, the feature compatibility version remains at the MongoDB version you're upgrading from to give you the option to downgrade if necessary. If you want the feature compatibility version to match the new MongoDB version, you must manually set
spec.featureCompatibilityVersionto the new version or toAlwaysMatchVersion. To learn more, seespec.featureCompatibilityVersion.
조건부
모든 리소스는 다음 설정 중 하나를 사용해야 합니다.
spec.opsManager.configMapRef.name유형: 문자열
Name of the ConfigMap with the Cloud Manager or Ops Manager connection configuration. The
spec.cloudManager.configMapRef.namesetting is an alias for this setting and can be used in its place.이 값은 생성하려는 리소스와 동일한 네임스페이스에 존재해야 합니다.
중요
Operator가 ConfigMap의 변경 사항을 관리합니다.
Kubernetes Operator는 ConfigMap에 대한 모든 변경 사항을 추적하고
MongoDB리소스 상태를 조정합니다.
spec.cloudManager.configMapRef.name유형: 문자열
Alias for
spec.opsManager.configMapRef.name.
옵션
모든 리소스 유형은 다음 설정을 사용할 수 있습니다:
metadata.annotations.mongodb.com/v1.architecture유형: 문자열
특정 배포에서 사용하는 컨테이너 아키텍처를 결정합니다.
런타임에 MongoDB 바이너리를 다운로드하는 기본 비정적 컨테이너 또는
런타임에 변경되지 않는 정적 컨테이너(공개 미리 보기) 입니다.
허용되는 값은 다음과 같습니다.
staticnon-static
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-project annotations: mongodb.com/v1.architecture: "static"
spec.agent.backupAgent.logRotate.sizeThresholdMB유형: integer
MongoDB Agent 가 로그를 로테이션하기 전의 백업 로그 파일 의 최대 크기(MB)입니다.
spec.agent.backupAgent.logRotate.timeThresholdHrs유형: integer
MongoDB Agent 가 백업 로그 파일 을 로테이션하는 데 걸리는 시간(시간)입니다.
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.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
sizeThresholdMBor thespec.agent.mongod.logRotate.timeThresholdHrs.
spec.agent.mongod.logRotate.timeThresholdHrs유형: integer
다음 로테이션 전 개별 로그 파일의 최대 기간(단위: 시간)입니다. 시간은 마지막 회전 이후의 시간입니다.
Ops Manager rotates the log file once the file meets either this
timeThresholdHrsor thespec.agent.mongod.logRotate.sizeThresholdMB.
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
setFeatureCompatibilityVersionin 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.clusterDomainif your Kubernetes cluster has a default domain other than the defaultcluster.local. If you neither use the default nor set thespec.clusterDomainoption, the Kubernetes Operator might not function as expected.
spec.clusterName유형: 문자열
기본값: cluster.local
Domain name of the Kubernetes cluster where you deploy the Kubernetes Operator. When Kubernetes creates a StatefulSet, the Kubernetes assigns each Pod a FQDN. To update Cloud Manager or Ops Manager, the Kubernetes Operator calculates the FQDN for each Pod using a provided cluster name. Kubernetes doesn't provide an API to query these hostnames.
경고
You must set
spec.clusterDomainif your Kubernetes cluster has a default domain other than the defaultcluster.local. If you neither use the default nor set thespec.clusterDomainoption, the Kubernetes Operator might not function as expected.
metadata.namespace유형: 문자열
Kubernetes namespace where you create this
MongoDBresource and other objects.
spec.service유형: 문자열
기본값: <resource_name>+'-svc' 및 <resource_name>+'-svc-external'
StatefulSet에 생성하거나 사용할 Kubernetes 서비스의 이름입니다. 이 이름의 서비스가 이미 존재하는 경우, Kubernetes Operator용 MongoDB 컨트롤러는 해당 서비스를 삭제 하거나 다시 생성하지 않습니다. 이 설정을 사용하면 사용자 지정 서비스를 직접 생성하고 Kubernetes Operator가 이를 재사용할 수 있습니다.
spec.logLevel유형: 문자열
기본값: INFO
Configures the level of Automation Agent logging inside the Pod. Accepted values include:
DEBUGINFOWARNERRORFATAL
배포별 리소스 설정
MongoDB 리소스 사양에서 사용할 수 있고 사용해야 하는 기타 설정은 생성하려는 MongoDB 배포 항목에 따라 다릅니다.
독립형 설정
참고
모든 독립형 설정은 복제본 세트 리소스에도 적용됩니다.
spec.additionalMongodConfig유형: 컬렉션
MongoDB 프로세스를 시작할 때 사용하는 추가 구성 옵션입니다.
Kubernetes Operator는 MongoDB Agent를 통해 배포하는 MongoDB 버전의 모든 구성 옵션을 지원합니다. 단, 사용자가 다음 옵션에 제공한 값은 Kubernetes Operator에 의해 재정의됩니다.
Kubernetes Operator가 소유하는 구성 옵션에 대해 자세히 알아보려면 MongoDB Kubernetes Operator전용 설정을 참조하세요.
사용할 수 있는 구성 옵션에 대해 알아보려면 Ops 관리자 설명서에서 MongoDB 배포를 위한 고급 옵션을 참조하세요.
spec.agent.startupOptions유형: 컬렉션
MongoDB 데이터베이스 리소스를 시작하는 데 적합한 MongoDB Agent 설정.
MongoDB Agent 설정을 키-값 쌍으로 제공해야 합니다. 값은 문자열이어야 합니다.
지원되는 MongoDB Agent 설정 목록은 다음을 참조하세요.
Cloud Manager 프로젝트에 대한 MongoDB Agent 설정 .
Operator와 함께 배포한 MongoDB Ops Manager 버전에 대한MongoDB Agent 설정 입니다. Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-standalone 6 spec: 7 version: "8.0.0" 8 service: my-service 9 10 opsManager: 11 configMapRef: 12 name: my-project 13 credentials: my-credentials 14 type: Standalone 15 16 persistent: true 17 agent: 18 startupOptions: 19 maxLogFiles: "30" 20 dialTimeoutSeconds: "40" 21 ...
spec.podSpec유형: 객체
MongoDB CustomResourceDefinition 파드에 대한 사양이 포함된 객체입니다.
spec.externalAccess유형: 컬렉션
외부 연결을 위해 클러스터를 노출하는 사양입니다. Kubernetes 클러스터 외부에서 MongoDB 리소스에 연결하는 방법을 알아보려면 Kubernetes 외부에서 MongoDB 데이터베이스 리소스에 연결하기를 참조하세요.
spec.externalAccess를 추가하면 Kubernetes Operator는 복제본 세트의 각 Pod에 대한 외부 서비스를 생성합니다. 외부 서비스는 클러스터의 각 MongoDB 데이터베이스 Pod에 대한 외부 진입점을 제공합니다. 각 외부 서비스에는 외부 서비스를 특정 Pod와 일치시키는 셀렉터(selector)가 있습니다.이 설정을 값없이 추가하면 Kubernetes Operator는 다음과 같은 기본값을 사용하여 외부 서비스를 생성합니다.
필드값설명Name<pod-name>-svc-external외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.
TypeLoadBalancer외부 LoadBalancer 서비스를 생성합니다.
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.참고
If you set
spec.externalAccess.externalDomain, the external service adds another port (Port Number + 1) for backups.
spec.externalAccess.externalService유형: 컬렉션
Specification for overriding the default values in
spec.externalAccess.When you set the
spec.externalAccesssetting, the Kubernetes Operator automatically creates an external load balancer service with default values. You can override certain values or add new values depending on your needs. For example, if you intend to create NodePort services and don't need a load balancer, you must configure overrides in your Kubernetes specification:externalAccess: externalService: annotations: # cloud-specific annotations for the service spec: type: NodePort # default is LoadBalancer # you can specify other spec overrides if necessary Kubernetes 사양에 대한 자세한 내용은 Kubernetes 설명서의 ServiceSpec을 참조하세요.
spec.externalAccess.externalService.annotations유형: 컬렉션
배포서버 의 모든 클러스터에 cloud 제공자별 구성 설정을 추가할 수 있는 키-값 쌍입니다. 자세한 학습 은 주석 및 Kubernetes cloud 제공자 설명서를 참조하세요.
주석 을 사용하여 Kubernetes Operator 배포에서 사용하는 외부 서비스에 대한 자리 표시자 값을 지정할 수 있습니다. Kubernetes Operator는 다음 표에 설명된 대로 이러한 값을 올바른 값으로 자동으로 바꿉니다. 자리 표시자를 사용하면 특정 파드의 각 서비스에 특정 어노테이션을 제공할 수 있습니다.
값설명{resourceName}Equal to
metadata.name.{namespace}Equal to
metadata.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.externalDomainif specified. Otherwise, equal to the domain used for themongodprocess FQDN.예를 들어 프로세스 호스트 이름
mdb-rs-1.example.com의 경우example.com은 도메인 이름입니다.{mongodProcessFQDN}The
mongodprocess hostname set in the automation configuration.The process hostname depends on your deployment configuration. If you've configured your deployment to use
external domains, the process hostname uses the following format:{resourceName}-{podIndex}.{mongodProcessDomain}예를 들면 다음과 같습니다.
mdb-rs-1.example.com배포에서 외부 도메인을 사용하지 않는 경우 프로세스 호스트 이름은 다음 형식을 사용합니다.
{resourceName}-{podIndex}.{resourceName}-{podIndex}-svc.{namespace}.svc.cluster.local예를 들면 다음과 같습니다.
mdb-rs-1.mdb-rs-1-svc.ns.svc.cluster.local참고
표에 지정된 대로 알려진 자리 표시자 값만 사용해야 하며 자리 표시자가 비어 있거나 null 값을 사용하지 않도록 해야 합니다. 또한 단일 MongoDB 리소스 배포서버 에 다중 Kubernetes 클러스터 배포와 관련된 자리 표시자를 사용할 수 없습니다.
그렇지 않으면 Kubernetes Operator가 오류를 반환합니다. 예를 들어 다음과 같은 오류 메시지가 표시될 수 있습니다.
error replacing placeholders in map with key=external-dns.alpha.kubernetes.io/hostname, value={resourceName}-{podIndex}-{unknownPlaceholder}.{clusterName}-{clusterIndex}.example.com: missing values for the following placeholders: {clusterName}, {clusterIndex}, {unknownPlaceholder}`` 예시
다음 예제에서는
{resourceName},{podIndex}및{namespace}자리 표시자를 지정합니다.apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: mdb-rs namespace: ns spec: replicas: 3 externalAccess: externalService: annotations: external-dns.alpha.kubernetes.io/hostname: {resourceName}-{podIndex}-{namespace}.example.com Kubernetes Operator는 각 자리 표시자의 적절한 값을 기반으로 외부 서비스에 대한 주석을 자동으로 채웁니다. 예를 들면 다음과 같습니다.
mdb-rs-0-svc-external: annotations: external-dns.alpha.kubernetes.io/hostname: mdb-rs-0-ns.example.com mdb-rs-1-svc-external: annotations: external-dns.alpha.kubernetes.io/hostname: mdb-rs-1-ns.example.com mdb-rs-2-svc-external: annotations: external-dns.alpha.kubernetes.io/hostname: mdb-rs-2-ns.example.com
spec.externalAccess.externalService.spec유형: 컬렉션
Configuration for the ServiceSpec. To learn more, see
spec.externalAccess.externalService.
spec.podSpec.persistence.single유형: 컬렉션
Kubernetes Operator가 하나의 퍼시스턴트 볼륨 클레임(Persistent Volume Claim, PVC)을 생성하고 데이터와 저널 및 로그에 대한 세 개의 디렉토리를 모두 동일한 퍼시스턴트 볼륨 마운트하도록 합니다.
참고
You must set the values in this collection if
spec.persistent: true.이 컬렉션 또는
persistence.multiple컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.
스칼라데이터 유형설명labelSelector문자열
마운트된 볼륨을 디렉토리에 바인딩하는 데 사용되는 태그입니다.
storage문자열
storageClass문자열
영구 볼륨 클레임에 지정된 저장 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.podSpec.persistence.multiple.data유형: 컬렉션
Kubernetes Operator가 영구 볼륨 클레임 을 생성하도록 설정 자체 영구 볼륨 에 데이터의 디렉토리를 마운트합니다. .
참고
You must set the values in this collection if
spec.persistent: true.이 컬렉션 또는
persistence.single컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.
스칼라데이터 유형설명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
reclaimPolicyto 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
reclaimPolicyto 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
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.podSpec.podTemplate유형: 컬렉션
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for MongoDB database resources.
템플릿 값은
spec.podSpec에 지정된 값보다 우선합니다.참고
Kubernetes Operator가
spec.podSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.
spec.podSpec.podTemplate.metadata유형: 컬렉션
Kubernetes Operator용 MongoDB 컨트롤러가 MongoDB database 리소스에 대해 생성하는 Kubernetes Pods의 메타데이터입니다.
에추가할 수 있는 필드를 검토하려면
spec.podSpec.podTemplate.metadataKubernetes 설명서를 참조하세요.
spec.podSpec.podTemplate.spec유형: 컬렉션
Kubernetes 연산자용 MongoDB 컨트롤러가 MongoDB database 리소스에 대해 생성하는 Kubernetes 파드의 사양입니다.
에 추가할 수
spec.podSpec.podTemplate.spec있는 필드를 검토 하려면 Kubernetes PodSpec v1 핵심 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
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
복제본 세트 설정
참고
모든 독립형 설정은 복제본 세트 리소스에도 적용됩니다.
다음 설정은 복제본 세트 리소스 유형에 적용됩니다:
spec.backup유형: 컬렉션
The collection container for
spec.backup.mode, which enables continuous backups for MongoDB resources in Kubernetes Operator.
spec.backup.assignmentLabels유형: 배열
백업 데몬, oplog 저장소, 블록 저장소, S3 스냅샷 저장소 및 파일 시스템 저장소를 특정 프로젝트 또는 그룹에 할당하기 위한 쉼표로 구분된 레이블 목록입니다. 할당 레이블을 사용하여 특정 백업 저장소가 특정 프로젝트와 연결되어 있는지 식별합니다.
Kubernetes Operator를 사용하여 할당 레이블을 설정하는 경우 Kubernetes 설정 파일에서 설정한 할당 레이블 값이 Ops Manager UI에 정의된 값을 재정의합니다. Kubernetes Operator를 사용하여 설정하지 않은 할당 레이블은 Ops Manager UI에 설정된 값을 계속 사용합니다.
참고
If you set this parameter, the API key linked with the value of
spec.credentialsmust have aGlobal Ownerrole.
spec.backup.mode유형: 문자열
MongoDB 리소스에 대한 지속적인 백업을 활성화합니다. 가능한 값은
enabled,disabled,terminated입니다.참고
The
spec.backup.modesetting relies on Backup that is enabled in the Ops Manager and requires thatspec.backup.enabledvalue in the Ops Manager resource specification is set totrue.After you enable continuous backups for your MongoDB resource with
spec.backup.mode, you can check the backup status.
spec.backup.encryption.kmip유형: 객체
KMIP 백업 암호화 구성 설정을 포함하는 객체입니다. 자세히 알아보려면 Ops Manager에 대한 KMIP 백업 암호화 구성을 참조하세요.
spec.backup.snapshotSchedule유형: 컬렉션
Kubernetes Operator에서 MongoDB 리소스에 대한 연속 백업을 위한 스냅샷 일정 설정을 위한 collection 컨테이너입니다.
spec.backup.snapshotSchedule.snapshotIntervalHours유형: 숫자
스냅샷 사이의 시간 간격입니다.
6,8,12또는24값을 설정할 수 있습니다.
spec.backup.snapshotSchedule.dailySnapshotRetentionDays유형: 숫자
일일 스냅샷을 보관할 수 있는 일수입니다.
1에서365사이의 값을 설정할 수 있습니다. 값을0으로 설정하면 이 규칙이 비활성화됩니다.
spec.backup.snapshotSchedule.weeklySnapshotRetentionWeeks유형: 숫자
주간 스냅샷을 보관할 주 수입니다.
1에서52사이의 값을 설정할 수 있습니다. 값을0으로 설정하면 이 규칙이 비활성화됩니다.
spec.backup.snapshotSchedule.monthlySnapshotRetentionMonths유형: 숫자
월별 스냅샷을 보관하는 개월 수입니다.
1에서36사이의 값을 설정할 수 있습니다. 값을0으로 설정하면 이 규칙이 비활성화됩니다.
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
0and59, inclusive.
spec.backup.snapshotSchedule.fullIncrementalDayOfWeek유형: 문자열
Ops Manager가 전체 스냅샷을 찍는 요일입니다. 이 설정은 최근의 작업에 대한 완전한 백업을 보장합니다. Ops Manager의 기본값은
SUNDAY로 설정됩니다.
spec.clusterName유형: 문자열
기본값: cluster.local
Domain name of the Kubernetes cluster where you deploy the Kubernetes Operator. When Kubernetes creates a StatefulSet, the Kubernetes assigns each Pod a FQDN. To update Cloud Manager or Ops Manager, the Kubernetes Operator calculates the FQDN for each Pod using a provided cluster name. Kubernetes doesn't provide an API to query these hostnames.
경고
You must set
spec.clusterDomainif your Kubernetes cluster has a default domain other than the defaultcluster.local. If you neither use the default nor set thespec.clusterDomainoption, the Kubernetes Operator might not function as expected.
spec.connectivity.replicaSetHorizons유형: 컬렉션
클라이언트 애플리케이션 및 MongoDB Agent에 대해 다양한 DNS 설정을 제공할 수 있습니다. Kubernetes Operator는 복제본 세트 멤버에 대해 분할 수평 DNS를 사용합니다. 이 기능을 사용하면 Kubernetes 클러스터 내부와 Kubernetes 외부 모두에서 통신할 수 있습니다.
호스트당 여러 개의 외부 매핑을 추가할 수 있습니다.
스플릿 호라이즌 요구 사항:
이 배열의 각 값이 고유한지 확인합니다.
Make sure that the number of entries in this array matches the value given in
spec.members.Provide a value for the
spec.security.certsSecretPrefixsetting to enable TLS. This method to use split horizons requires the Server Name Indication extension of the TLS protocol.
예시
이 예에서 복제본 세트 멤버는
example-localhost경계에서 서로 통신합니다. 클라이언트는example-website경계를 사용하여 복제본 세트와 통신합니다.언급된 지평의 이름은 이 예시 의 목적에 따라 임의적입니다. 수평선의 이름은 무엇이든 지정할 수 있지만 해당 수평선의 일부인 모든 호스트 이름에 대해 수평선 이름이 동일해야 합니다.
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: <my-replica-set> 6 spec: 7 members: 3 8 version: "8.0.0" 9 type: ReplicaSet 10 opsManager: 11 configMapRef: 12 name: <configMap.metadata.name> 13 credentials: <mycredentials> 14 persistent: true 15 security: 16 tls: 17 enabled: true 18 connectivity: 19 replicaSetHorizons: 20 - "example-website": "web1.example.com:30907" 21 - "example-website": "web2.example.com:32350" 22 - "example-website": "web3.example.com:31185" 23 ...
spec.externalAccess.externalDomain유형: 문자열
복제본 세트 배포를 외부에 노출하는 데 사용되는 외부 도메인입니다.
By default, each replica set member uses the Kubernetes Pod's FQDN (
*.svc.cluster.local) as the default hostname. However, if you add an external domain to this setting, the replica set uses a hostname that is a subdomain of the specified domain instead. This hostname uses the following format:<replica-set-name>-<pod-idx>.<externalDomain>예를 들면 다음과 같습니다.
replica-set-1.example.comAfter you deploy the replica set with this setting, the Kubernetes Operator uses the hostname with the external domain to override the
processes[n].hostnamefield in the Ops Manager automation configuration. Then, the MongoDB Agent uses this hostname to connect tomongod.To specify other hostnames for connecting to the replica set, you can use the
spec.connectivity.replicaSetHorizonssetting. However, the following connections still use the hostname with the external domain:The MongoDB Agent to connect to
mongod.
WARNING: Specifying this field changes how Ops Manager registers
mongodprocesses. You can't change the value of this field or anyprocesses[n].hostnamefields in the Ops Manager automation configuration for a running replica set deployment.
spec.memberConfig유형: 컬렉션
MongoDB리소스에서 배포된 각 MongoDB 복제본 집합 구성원에 대한 사양입니다.배열의 요소 순서는 복제 세트의 멤버 순서를 반영해야 합니다. 예를 들어 배열의 첫 번째 요소는 인덱스
0에 있는 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.priority가1.5인 노드는memberConfig.priority가0.5인 노드보다 프라이머리 노드가 될 가능성이 큽니다.memberConfig.priority가0인 멤버는 프라이머리가 될 수 없습니다. 자세히 알아보려면 멤버 우선순위를 참조하세요.
spec.memberConfig.tags유형: 매핑
읽기 및 쓰기 작업을 MongoDB 복제본 세트의 특정 멤버로 전달하기 위한 복제본 세트 태그의 맵입니다.
spec.memberConfig.votes유형: 숫자
Determines whether a MongoDB replica set member can vote in an election. Set to
1to allow the member to vote. Set to0to exclude the member from an election.
다음 설정은 복제본 세트 리소스 유형에만 적용됩니다.
spec.backup.autoTerminateOnDeletion유형: 부울
Flag that controls whether the Kubernetes Operator stops and terminates the backup when you delete a MongoDB resource. If omitted, the default value is
false. Setting this flag totrueis useful when you want to delete the MongoDB custom resource while thespec.backup.modesetting is set toenabled.
샤딩된 클러스터 설정
참고
별도로 지정하지 않는 한 모든 복제본 세트 설정은 샤딩된 클러스터 리소스에도 적용됩니다.
다음 설정은 샤딩된 클러스터 리소스 유형에만 적용됩니다.
spec.backup.snapshotSchedule.clusterCheckpointIntervalMin유형: 숫자
연속 클러스터 체크포인트 사이의 시간(분)입니다. 이 설정은 기능 호환성 버전 이 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 설정 목록은 다음을 참조하세요.
Cloud Manager 프로젝트에 대한 MongoDB Agent 설정 .
Operator와 함께 배포한 MongoDB Ops Manager 버전에 대한MongoDB Agent 설정 입니다. Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-sharded-cluster-options 6 spec: 7 version: "8.0.0" 8 type: ShardedCluster 9 opsManager: 10 configMapRef: 11 name: my-project 12 credentials: my-credentials 13 persistent: true 14 shardCount: 2 15 mongodsPerShardCount: 3 16 mongosCount: 2 17 configServerCount: 1 18 19 mongos: 20 agent: 21 startupOptions: 22 maxLogFiles: "30" 23 24 configSrv: 25 agent: 26 startupOptions: 27 dialTimeoutSeconds: "40" 28 shard: 29 agent: 30 startupOptions: 31 serverSelectionTimeoutSeconds: "20" 32 ...
spec.configSrvPodSpec유형: 객체
MongoDB CustomResourceDefinition 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문자열
storageClass문자열
영구 볼륨 클레임에 지정된 저장 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.configSrvPodSpec.persistence.multiple.data유형: 컬렉션
Kubernetes Operator가 영구 볼륨 클레임 을 생성하도록 설정 자체 영구 볼륨 에 데이터의 디렉토리를 마운트합니다. .
참고
You must set the values in this collection if
spec.persistent: true.이 컬렉션 또는
persistence.single컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.
스칼라데이터 유형설명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
reclaimPolicyto 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
reclaimPolicyto 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
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.configSrvPodSpec.podTemplate유형: 컬렉션
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each config server member.
템플릿 값은
spec.configSrvPodSpec에 지정된 값보다 우선합니다.참고
Kubernetes Operator가
spec.configSrvPodSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.
spec.configSrvPodSpec.podTemplate.metadata유형: 컬렉션
Kubernetes Operator용 MongoDB 컨트롤러가 각 config 서버 멤버에 대해 생성하는 Kubernetes Pods의 메타데이터입니다.
에추가할 수 있는 필드를 검토하려면
spec.configSrvPodSpec.podTemplate.metadataKubernetes 설명서를 참조하세요.
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
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
spec.configSrvPodSpec.podTemplate.spec.affinity.nodeAffinity유형: 컬렉션
Kubernetes rule to place Pods for replica set on a specific range of nodes.
읽기-쓰기 성능을 최적화하려면 Pods 를 제한하는 노드 어피니티 규칙을 사용하세요. 특정 노드 에서 실행 또는 특정 노드 에서 실행하는 것을 선호합니다. .
spec.configSrvPodSpec.podTemplate.spec.affinity.podAntiAffinity유형: 문자열
Default: kubernetes.io/hostname
Sets a rule to spread Pods hosting
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.configSrvPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey유형: 문자열
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
mongosinstances 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
mongosinstance.
spec.mongos.agent.startupOptions유형: 컬렉션
MongoDB Agent settings with which you want to start each
mongosinstance.MongoDB Agent 설정을 키-값 쌍으로 제공해야 합니다. 값은 문자열이어야 합니다.
지원되는 MongoDB Agent 설정 목록은 다음을 참조하세요.
Cloud Manager 프로젝트에 대한 MongoDB Agent 설정 .
Operator와 함께 배포한 MongoDB Ops Manager 버전에 대한MongoDB Agent 설정 입니다. Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-sharded-cluster-options 6 spec: 7 version: "8.0.0" 8 type: ShardedCluster 9 opsManager: 10 configMapRef: 11 name: my-project 12 credentials: my-credentials 13 persistent: true 14 shardCount: 2 15 mongodsPerShardCount: 3 16 mongosCount: 2 17 configServerCount: 1 18 19 mongos: 20 agent: 21 startupOptions: 22 maxLogFiles: "30" 23 24 configSrv: 25 agent: 26 startupOptions: 27 dialTimeoutSeconds: "40" 28 shard: 29 agent: 30 startupOptions: 31 serverSelectionTimeoutSeconds: "20" 32 ...
spec.mongosPodSpec유형: 객체
MongoDB CustomResourceDefinition mongos 파드에 대한 사양이 포함된 객체입니다.
spec.mongosPodSpec.podTemplate유형: 컬렉션
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each
mongosinstance.템플릿 값은
spec.mongosPodSpec에 지정된 값보다 우선합니다.참고
Kubernetes Operator가
spec.mongosPodSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.
spec.mongosPodSpec.podTemplate.metadata유형: 컬렉션
Metadata for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each
mongosinstance.에추가할 수 있는 필드를 검토하려면
spec.mongosPodSpec.podTemplate.metadataKubernetes 설명서를 참조하세요.
spec.mongosPodSpec.podTemplate.spec유형: 컬렉션
Specifications of the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each
mongosinstance.To review which fields you can add to
spec.mongosPodSpec.podTemplate.spec, see the Kubernetes PodSpec v1 core API.참고
When you add containers to
spec.mongosPodSpec.podTemplate.spec.containers, the Kubernetes Operator adds them to the Kubernetes pod. These containers are appended to eachmongosinstance containers in the pod.이 설정을 사용하여 각 pod에 대한 CPU 및 RAM 할당을 지정합니다. 예시는 GitHub의 샘플을 참조하세요.
spec.mongosPodSpec.podTemplate.spec.affinity.podAffinity유형: 컬렉션
Optional. Kubernetes rule to determine if multiple
MongoDBresource Pods must be co-located with other Pods.
spec.mongosPodSpec.podTemplate.spec.affinity.nodeAffinity유형: 컬렉션
Kubernetes rule to place Pods for replica set on a specific range of nodes.
읽기-쓰기 성능을 최적화하려면 Pods 를 제한하는 노드 어피니티 규칙을 사용하세요. 특정 노드 에서 실행 또는 특정 노드 에서 실행하는 것을 선호합니다. .
spec.mongosPodSpec.podTemplate.spec.affinity.podAntiAffinity유형: 문자열
Default: kubernetes.io/hostname
Sets a rule to spread Pods hosting
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.mongosPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey유형: 문자열
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 설정 목록은 다음을 참조하세요.
Cloud Manager 프로젝트에 대한 MongoDB Agent 설정 .
Operator와 함께 배포한 MongoDB Ops Manager 버전에 대한MongoDB Agent 설정 입니다. Kubernetes
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: my-sharded-cluster-options 6 spec: 7 version: "8.0.0" 8 type: ShardedCluster 9 opsManager: 10 configMapRef: 11 name: my-project 12 credentials: my-credentials 13 persistent: true 14 shardCount: 2 15 mongodsPerShardCount: 3 16 mongosCount: 2 17 configServerCount: 1 18 19 mongos: 20 agent: 21 startupOptions: 22 maxLogFiles: "30" 23 24 configSrv: 25 agent: 26 startupOptions: 27 dialTimeoutSeconds: "40" 28 shard: 29 agent: 30 startupOptions: 31 serverSelectionTimeoutSeconds: "20" 32 ...
spec.shardPodSpec유형: 객체
MongoDB CustomResourceDefinition 샤드 파드에 대한 사양이 포함된 객체입니다.
spec.shardPodSpec.persistence.multiple.data유형: 컬렉션
Kubernetes Operator가 영구 볼륨 클레임 을 생성하도록 설정 자체 영구 볼륨 에 데이터의 디렉토리를 마운트합니다. .
참고
You must set the values in this collection if
spec.persistent: true.이 컬렉션 또는
persistence.single컬렉션을 설정할 수 있지만 둘 다 설정할 수는 없습니다.
스칼라데이터 유형설명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
reclaimPolicyto 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
reclaimPolicyto 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
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
spec.shardPodSpec.podTemplate유형: 컬렉션
Template for the Kubernetes Pods that the MongoDB Controllers for Kubernetes Operator creates for each sharded cluster shard member.
템플릿 값은
spec.shardPodSpec에 지정된 값보다 우선합니다.참고
Kubernetes Operator가
spec.shardPodSpec.podTemplate에 제공한 필드의 유효성을 검사하지 않습니다.
spec.shardPodSpec.podTemplate.metadata유형: 컬렉션
Kubernetes Operator용 MongoDB 컨트롤러가 각 샤딩된 클러스터 샤드 멤버에 대해 생성하는 Kubernetes Pods의 메타데이터입니다.
에추가할 수 있는 필드를 검토하려면
spec.shardPodSpec.podTemplate.metadataKubernetes 설명서를 참조하세요.
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
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
spec.shardPodSpec.podTemplate.spec.affinity.nodeAffinity유형: 문자열
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
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.shardPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey유형: 문자열
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.metadataKubernetes 설명서를 참조하세요.
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
MongoDBresource Pods must be co-located with other Pods. To learn more about the use cases, see Affinity and Anti-Affinity in the Kubernetes documentation.
spec.shardSpecificPodSpec.podTemplate.spec.affinity.podAntiAffinity유형: 문자열
Default: kubernetes.io/hostname
Sets a rule to spread Pods hosting
MongoDBresource to different locations. A location can be a single node, rack, or region. By default, Kubernetes Operator tries to spread pods across different nodes.
spec.shardSpecificPodSpec.podTemplate.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey유형: 문자열
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.clusterSpecListspec.configSrv.clusterSpecListspec.shard.clusterSpecList
다음 필드는
spec.<section>.clusterSpecList객체의 각 클러스터 에 대해 동등한 값이 전달되므로 무시됩니다.spec.mongodsPerShardCount는 다음에 정의되어 있습니다.spec.shard.clusterSpecList.membersspec.mongosCount는 다음에 정의되어 있습니다.spec.mongos.clusterSpecList.membersspec.configServerCount는 다음에 정의되어 있습니다.spec.configSrv.clusterSpecList.membersspec.shardOverrides.memberConfig는 다음에 정의되어 있습니다.spec.shardOverrides.clusterSpecList.memberConfigspec.shardOverrides.members는 다음에 정의되어 있습니다.spec.shardOverrides.clusterSpecList.membersspec.shardOverrides.statefulSet는 다음에 정의되어 있습니다.spec.shardOverrides.clusterSpecList.statefulSet
예시:
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: sc spec: shardCount: 3 # we don't specify mongodsPerShardCount, mongosCount and configServerCount as they don't make sense for multi-cluster topology: MultiCluster type: ShardedCluster version: 7.0.12 cloudManager: configMapRef: name: my-project credentials: my-credentials persistent: true shard: clusterSpecList: - clusterName: member-cluster-0 members: 2 # each shard will have 2 members in cluster 0, unless overriden - clusterName: member-cluster-1 members: 2 - clusterName: member-cluster-2 members: 1 shardOverrides: - shardNames: [sc-2] # this override will apply to the third shard (here, shards are indexed from 0 to 2 as we have 3 shards) clusterSpecList: - clusterName: member-cluster-0 # all other fields are optional, if not provided the fields from matching member cluster from shard.clusterSpecList will be taken by default members: 3 - clusterName: member-cluster-1 # we don't deploy this shard to member-cluster-1 # Note that it is also possible to make it explicit with members: 0 # we don't provide entry for clusterName: member-cluster-1, so it won't be deployed there - clusterName: member-cluster-2 members: 2 configSrv: clusterSpecList: - clusterName: member-cluster-0 members: 2 # config server will have 2 members in this cluster - clusterName: member-cluster-1 members: 1 - clusterName: member-cluster-2 members: 2 mongos: clusterSpecList: - clusterName: member-cluster-0 members: 2 # router will have 2 members in this cluster - clusterName: member-cluster-1 members: 1 다음 필드는
topology=MultiCluster인 배포에만 독점적으로 관련됩니다.spec.configSrv.clusterSpecList참고
이 필드 멀티 클러스터 샤딩된 클러스터 배포에만 사용할 수 있습니다.
유형: 객체 배열
topology=MultiCluster인 경우 필수다음과 같은 최상위 필드가 있는 멀티 클러스터 샤딩된 클러스터 배포에 사용할 객체 배열 입니다.
clusterName유형: 문자열
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외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.
TypeLoadBalancer외부 LoadBalancer 서비스를 생성합니다.
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.참고
spec.clusterSpecList.externalAccess.externalDomain 을 설정하다 하면 외부 서비스가 백업을 위해 다른 포트(
Port Number + 1)를 추가합니다.
members유형: 숫자
MongoDB 복제본 세트의 멤버 수입니다.
memberConfig유형: 컬렉션
다중 Kubernetes 클러스터 MongoDB 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.clusterSpecList및spec.shard.clusterSpecList에 전달된clusterSpecItem객체에서만 사용할 수 있습니다. 지정된 클러스터 에 대한 기존 지속성 구성을 재정의합니다.
statefulSet유형: 컬렉션
다중 Kubernetes 클러스터 MongoDB deployment 에서 클러스터의 각 StatefulSet에 대한 StatefulSet 재정의 구성을 제공합니다. 다중 Kubernetes 클러스터 MongoDB deployment 의 모든 클러스터에 적용되는 글로벌 구성을 설정하다 하려면 spec.statefulSet.spec을 참조하세요.
이 설정은 다중 Kubernetes 클러스터 MongoDB 배포의 복제본 세트 리소스 유형에만 적용됩니다.
spec.duplicateServiceObjects참고
이 필드 멀티 클러스터 샤딩된 클러스터 배포에만 사용할 수 있습니다.
유형: 부울
옵션
기본값:
true토폴로지 가
MultiCluster이(가) 아닌 경우 무시됩니다. 모든 샤딩된 클러스터 구성 요소에 대한 서비스에 적용됩니다:mongos,configSrv및shards.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외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.
TypeLoadBalancer외부 LoadBalancer 서비스를 생성합니다.
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.참고
spec.clusterSpecList.externalAccess.externalDomain 을 설정하다 하면 외부 서비스가 백업을 위해 다른 포트(
Port Number + 1)를 추가합니다.
members유형: 숫자
MongoDB 복제본 세트의 멤버 수입니다.
memberConfig유형: 컬렉션
다중 Kubernetes 클러스터 MongoDB 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외부 서비스의 이름입니다. 이 값은 변경할 수 없습니다.
TypeLoadBalancer외부 LoadBalancer 서비스를 생성합니다.
Port<Port Number>A port for
mongod.publishNotReadyAddresstrueSpecifies that DNS records are created even if the Pod isn't ready. Do not set to
falsefor any database Pod.참고
spec.clusterSpecList.externalAccess.externalDomain 을 설정하다 하면 외부 서비스가 백업을 위해 다른 포트(
Port Number + 1)를 추가합니다.
members유형: 숫자
MongoDB 복제본 세트의 멤버 수입니다.
memberConfig유형: 컬렉션
다중 Kubernetes 클러스터 MongoDB 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.clusterSpecList및spec.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.podTemplate및spec.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입니다.
예시 들어 의 각 샤딩된 클러스터 샤드 멤버에 60 기가바이트의 저장 공간이 필요한 경우 이 값을
60Gi로 설정하다 .storageClass문자열
영구 볼륨 클레임에 지정된 저장 유형입니다. 이 스토리지 유형을 StorageClass 객체로 생성한 후, 이 객체 사양에서 사용할 수 있습니다.
Make sure to set the StorageClass
reclaimPolicyto Retain. This ensures that data is retained when a Persistent Volume Claim is removed.
Prometheus 설정
독립형 리소스, 복제본 세트 또는 샤딩된 클러스터와 함께 Prometheus를 사용할 수 있습니다. 자세히 알아보려면 Prometheus와 함께 사용할 리소스 배포를 참조하세요. 예시를 보려면 Prometheus와 함께 사용하는 MongoDB 리소스를 참조하세요.
Prometheus를 MongoDB 리소스와 함께 사용할 때 적용되는 설정은 다음과 같습니다:
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.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.security.tls.ca유형: 문자열
Provide the name of the ConfigMap that stores the CA for the
MongoDBresource.중요
If you use a custom CA to sign your TLS certificates for the
MongoDBresource, you must specify this parameter.Kubernetes Operator에서는 ConfigMap에서
MongoDB리소스 인증서ca-pem의 이름을 지정해야 합니다.
spec.security.certsSecretPrefix유형: 문자열
생성한 쿠버네티스 시크릿의 앞에 붙는 텍스트. 복제본 세트 또는 샤딩된 클러스터의 TLS 키와 인증서를 포함합니다.
시크릿 앞에
<prefix>-<metadata.name>을(를) 붙여야 합니다.For example, if you call your deployment
my-deploymentand you set the prefix tomdb, you must name the TLS secret for the client TLS communicationsmdb-my-deployment-cert. Also, you must name the TLS secret for internal cluster authentication (if enabled)mdb-my-deployment-clusterfile.TLS 인증서가 포함된 시크릿을 명명하는 방법은 배포에 적용되는 복제본 세트 배포 주제를 참조하세요.
spec.security.tls.additionalCertificateDomains유형: 부울
List of every domain that should be added to TLS certificates to each pod in this deployment. When you set this parameter, every CSR that the Kubernetes Operator transforms into a TLS certificate includes a SAN in the form
<pod name>.<additional cert domain>.Replica set resources don't need this parameter. Use
spec.connectivity.replicaSetHorizonsinstead.참고
If you add this parameter to a TLS-enabled resource, Kubernetes displays an error when the resource reaches the
Pendingstate. This error displays:Please manually remove the |csr| in order to proceed.To remedy this issue:Kubernetes가 새 CSR을 생성할 수 있도록 기존 CSR을 모두 제거합니다. 리소스를 삭제하는 방법에 대한 자세한 내용은 Kubernetes 설명서의 리소스 삭제를 참조하세요.
Kubernetes가 CSR을 생성한 후 승인합니다.
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_0및TLS1_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.enabled유형: 부울
기본값:
falseSpecifies whether authentication is enabled on the Cloud Manager or Ops Manager project. If set to
true, you must set an authentication mechanism inspec.security.authentication.modes.중요
이 설정을 포함하면 값이
false으로 설정되어 있더라도 Kubernetes Operator가 이 MongoDB 리소스에 대한 인증을 관리합니다. 이 설정이 리소스 사양에 있는 동안에는 Cloud Manager나 Ops Manager의 UI 또는 API를 사용하여 이 리소스에 대한 인증을 구성할 수 없습니다.Cloud Manager, Ops Manager UI 또는 API를 사용하여 인증을 관리하려면 이 설정을 생략합니다.
spec.security.authentication.modes유형: 배열
MongoDB deployment 에서 사용하는 인증 메커니즘 지정합니다. 유효한 값은
SCRAM,SCRAM-SHA-1,MONGODB-CR,X509,LDAP및OIDC입니다.SCRAM-SHA-1보다SCRAM-SHA-256(SCRAM)를 권장합니다.SCRAM-SHA-1를 지정하는 경우MONGODB-CR도 지정해야 합니다.참고
X.509 내부 클러스터 인증
Cloud Manager 또는 Ops Manager 프로젝트 에 대해 X.509 내부 클러스터 인증 활성화 하려면 이 값을(으)로
["X509"]설정하다 하고 다음 설정을 지정합니다.provide a value for the
spec.security.certsSecretPrefixsetting.`
If you provide more than one value for
spec.security.authentication.modes, you must also specify a value forspec.security.authentication.agents.mode.
spec.security.authentication.internalCluster유형: 문자열
X. 내부509 클러스터 인증 사용할지 여부를 지정합니다.
X.509 내부 클러스터 인증을 활성화하려면
"X509"으로 설정합니다. 다음 설정을 지정해야 합니다:spec.security.authentication.modes: ["X509"]
Kubernetes Operator는 다음 값을 허용합니다:
["X509"]: X.509 내부 클러스터 인증이 활성화됩니다.""또는 생략: 내부 클러스터 인증이 활성화되어 있지 않습니다.
중요
내부 클러스터 인증을 활성화한 후에는 비활성화할 수 없습니다.
spec.security.authentication.requireClientTLSAuthentication유형: 부울
기본값:
falseSpecifies whether the MongoDB host requires clients to connect using a TLS certificate. Defaults to
trueif you enable TLS authentication.To enable TLS authentication, provide a value for the
spec.security.certsSecretPrefixsetting.
spec.security.authentication.ldap유형: 컬렉션
LDAP 인증에 필요합니다.
Configures LDAP authentication for the Cloud Manager or Ops Manager project. To enable LDAP authentication, set
spec.security.authentication.modesto["LDAP"].
spec.security.authentication.ldap.servers유형: 문자열 배열
LDAP 인증에 필요합니다.
LDAP 서버의 호스트 이름 및 포트 목록. 다음 형식으로 해당 포트와 함께 호스트 이름을 지정합니다.
spec: security: authentication: ldap: servers: - "<hostname1>:<port1>" - "<hostname2>:<port2>"
spec.security.authentication.ldap.transportSecurity유형: 문자열
LDAP 인증에 필요합니다.
LDAP 서버가 TLS를 허용하는지 여부를 지정합니다.
If the LDAP server accepts TLS, set the value to
tls. If the LDAP server doesn't accept TLS, leave this value blank or set the value tonone.참고
none또는tls이외의 문자열을 지정하는 경우, 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
passwordfield which stores the password.
spec.security.authentication.ldap.authzQueryTemplate유형: 문자열
LDAP 인증에 필요합니다.
사용자가 속한 LDAP 그룹을 가져오기 위해 MongoDB 가 실행하는 RFC4515 및 RFC LDAP 형식의 쿼리 URL 템플릿입니다. 쿼리 에 지정된 하나 이상의 호스팅하다 를 기준으로 합니다. 템플릿에서 다음 토큰을 사용할 수4516
spec.security.authentication.ldap.servers있습니다.{USER}- Substitutes the authenticated username, or the
transformedusername, 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.authzQueryTemplate가 포함되어 있고 동시에spec.security.authentication.agents.modeisLDAPorX509.
spec.security.authentication.ldap.userToDNMapping유형: 문자열
Maps the username provided to
mongodormongosfor 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유형: 문자열
필수 사항
유효한 값은
WorkforceIdentityFederation및WorkloadIdentityFederation입니다. Workforce Identity Federation을 사용하여 사람이 배포에 액세스 있도록 싱글 사인온을 구성하세요. 프로그래밍 방식의 애플리케이션 으로 배포서버에 액세스 하려면 Workload Identity Federation을 사용하세요. MongoDB 리소스 당 하나의 Workforce Identity Federation IdP만 구성할 수 있습니다. 자세한 학습 은 OIDC/OAuth 를 사용한 인증 및 권한 부여 2 를0 참조하세요.
spec.security.authentication.oidcProviderConfigs.authorizationType유형: 문자열
필수 사항
유효한 값은
GroupMembership및UserID입니다. 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 제공자 구성 문서를 찾습니다. MongoDB8.0+의 경우issuerURI와 대상의 조합은 OIDC 제공자 구성 전체에서 고유해야 합니다. 다른 MongoDB 버전의 경우issuerURI자체가 고유해야 합니다.
spec.security.roleRefs유형: 배열
MongoDB deployment 대한 세분화된 액세스 제어를 제공하는
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, andLDAP. The value you specify must also be present inspec.security.authentication.modes. We recommendSCRAM-SHA-256(SCRAM) overSCRAM-SHA-1. If you specifySCRAM-SHA-1, you must also specifyMONGODB-CR.This setting is required if you specified more than one value for
spec.security.authentication.modes.
spec.security.authentication.agents.automationUserName유형: 문자열
Name of the user that the MongoDB Agents use to interact with your MongoDB deployment. The username is mapped to an LDAP Distinguished Name (DN) according to
spec.security.authentication.ldap.userToDNMapping. The resulting DN must already exist in your LDAP deployment.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.automationPasswordSecretRef유형: 컬렉션
Details of the secret that contains the password for the
spec.security.authentication.agents.automationUserNameuser.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.automationPasswordSecretRef.name유형: 문자열
Name of the secret that contains the password for the
spec.security.authentication.agents.automationUserNameuser. You must create this secret in the same namespace to which you deploy the Kubernetes Operator:kubectl create secret generic ldap-agent-user \ --from-literal="password=<password>" -n <metadata.namespace> This secret must contain one key, the value of which matches the password of the
spec.security.authentication.agents.automationUserNameuser in your LDAP deployment.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.automationPasswordSecretRef.key유형: 문자열
Key in the
spec.security.authentication.agents.automationPasswordSecretRef.namesecret that contains the password for the user inspec.security.authentication.agents.automationUserName.This setting is required if
spec.security.authentication.agents.modeisLDAP.
spec.security.authentication.agents.clientCertificateSecretRef.name유형: 문자열
Specifies the secret that contains the MongoDB Agent's TLS certificate. If omitted, defaults to
agent-certs.이 시크릿은 Kubernetes Operator를 배포 동일한 네임스페이스 에 생성해야 하며 시크릿은
kubernetes.io/tls유형이어야 합니다.
spec.security.roles유형: 배열
MongoDB 배포에 대한 세분화된 액세스 제어를 제공하는 맞춤 설정 역할을 정의하는 배열입니다.
To enable user-defined roles, the
spec.security.authentication.enabledmust betrue.예시
이 예에서
customRole(이)라는 사용자 정의 역할은 이 역할이 할당된 사용자에게 허용됩니다.pets데이터베이스의cats컬렉션에 문서를 삽입합니다.pets데이터베이스의dogs컬렉션에 문서를 찾아 삽입합니다.
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: <my-replica-set> 6 spec: 7 members: 3 8 version: "8.0.0" 9 type: ReplicaSet 10 opsManager: 11 configMapRef: 12 name: <configMap.metadata.name> 13 credentials: <mycredentials> 14 persistent: true 15 security: 16 authentication: 17 enabled: true 18 modes: 19 - "SCRAM" 20 roles: 21 - role: "customRole" 22 db: admin 23 privileges: 24 - actions: 25 - insert 26 resource: 27 collection: cats 28 db: pets 29 - actions: 30 - insert 31 - find 32 resource: 33 collection: dogs 34 db: pets 35 ...
spec.security.roles.authenticationRestrictions유형: 배열
Array that defines the IP address from which and to which users assigned this
spec.security.roles.rolecan connect.
spec.security.roles.authenticationRestrictions.clientSource유형: 배열
Array of IP addresses or CIDR blocks from which users assigned this
spec.security.roles.rolecan connect.MongoDB 서버는 이 배열에 없는 클라이언트에서 요청이 오는 경우 이 역할이 부여된 사용자의 연결 요청을 거부합니다.
spec.security.roles.authenticationRestrictions.serverAddress유형: 배열
Array of IP addresses or CIDR blocks to which users assigned this
spec.security.roles.rolecan connect.MongoDB 서버는 클라이언트가 이 배열에 없는 서버에 연결을 요청하는 경우 이 역할이 부여된 사용자의 연결 요청을 거부합니다.
spec.security.roles.privileges.actions유형: 배열
이 역할을 부여받은 사용자가 수행할 수 있는 작업 목록입니다. 허용되는 값의 목록은 Kubernetes Operator와 함께 배포한 MongoDB 버전에 대한 MongoDB 매뉴얼의 권한 조치를 참조하세요.
spec.security.roles.privileges.resource유형: 컬렉션
Resources for which the privilege
actionsapply.이 컬렉션에는 둘 중 하나가 포함되어야 합니다:
The
spec.security.roles.privileges.resource.clustersetting with a value oftrue.
spec.security.roles.privileges.resource.database유형: 문자열
Database for which the privilege
actionsapply.If you provide a value for this setting, you must also provide a value for
spec.security.roles.privileges.resource.collection.
spec.security.roles.privileges.resource.collection유형: 문자열
Collection in the
databasefor which the privilegeactionsapply.If you provide a value for this setting, you must also provide a value for
spec.security.roles.privileges.resource.database.
spec.security.roles.privileges.resource.cluster유형: 부울
Default(기본값): False
Flag that indicates that the privilege
actionsapply to all databases and collections in the MongoDB deployment. If omitted, defaults tofalse.If set to true, do not provide values for
spec.security.roles.privileges.resource.databaseandspec.security.roles.privileges.resource.collection.
예시
다음 예에서는 모든 설정이 제공된 독립형 배포에 대한 리소스 사양을 보여줍니다.
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-standalone spec: version: "8.0.0" service: my-service opsManager: # Alias of cloudManager configMapRef: name: my-project credentials: my-credentials persistent: true type: Standalone additionalMongodConfig: systemLog: logAppend: true verbosity: 4 operationProfiling: mode: slowOp podSpec: persistence: single: storage: "12Gi" storageClass: standard labelSelector: matchExpressions: - {key: environment, operator: In, values: [dev]} podTemplate: metadata: labels: label1: mycustomlabel spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: "mykey" weight: 50 ...
다음 예시 는 모든 설정이 제공된 복제본 세트 에 대한 리소스 사양을 보여줍니다.
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-replica-set spec: members: 3 version: "8.0.0" service: my-service opsManager: # Alias of cloudManager configMapRef: name: my-project credentials: my-credentials persistent: true type: ReplicaSet podSpec: persistence: multiple: data: storage: "10Gi" journal: storage: "1Gi" labelSelector: matchLabels: app: "my-app" logs: storage: "500M" storageClass: standard podTemplate: metadata: labels: label1: mycustomlabel spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: "mykey" weight: 50 security: certsSecretPrefix: "prefix" tls: ca: custom-ca authentication: enabled: true modes: ["X509"] internalCluster: "X509" statefulSet: spec: serviceName: my-service additionalMongodConfig: net: ssl: mode: preferSSL ...
다음 예시 는 모든 설정이 제공된 샤딩된 클러스터 의 리소스 사양을 보여줍니다.
apiVersion: mongodb.com/v1 kind: MongoDB metadata: name: my-sharded-cluster spec: shardCount: 2 mongodsPerShardCount: 3 mongosCount: 2 configServerCount: 3 version: "8.0.0" service: my-service type: ShardedCluster ## Please Note: The default Kubernetes cluster name is ## `cluster.local`. ## If your cluster has been configured with another name, you can ## specify it with the `clusterDomain` attribute. opsManager: # Alias of cloudManager configMapRef: name: my-project credentials: my-credentials persistent: true configSrvPodSpec: # if "persistence" element is omitted then Operator uses the # default size (5Gi) for mounting single Persistent Volume podTemplate: spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: nodeId mongosPodSpec: podTemplate: spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: nodeId shardPodSpec: persistence: multiple: # if the child of "multiple" is omitted then the default size will be used. # 16GB for "data", 1GB for "journal", 3GB for "logs" data: storage: "20Gi" logs: storage: "4Gi" storageClass: standard podTemplate: spec: affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchExpressions: - key: security operator: In values: - S1 topologyKey: failure-domain.beta.kubernetes.io/zone nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/e2e-az-name operator: In values: - e2e-az1 - e2e-az2 podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: topologyKey: nodeId mongos: additionalMongodConfig: systemLog: logAppend: true verbosity: 4 configSrv: additionalMongodConfig: operationProfiling: mode: slowOp shard: additionalMongodConfig: storage: journal: commitIntervalMs: 50 security: certsSecretPrefix: "prefix" tls: ca: custom-ca authentication: enabled: true modes: ["X509"] internalCluster: "X509" statefulSet: spec: serviceName: my-service ...
StatefulSet 설정
다음 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
MongoDBresources.
StatefulSet 재정의 필드
The following fields are merged in and take precedence over default StatefulSet settings when you specify values in spec.statefulSet.spec. Field paths are relative to the StatefulSet definition, so spec.replicas corresponds to spec.statefulSet.spec.replicas in the MongoDB resource specification.
필드 |
|---|
|
|
|
|
|
|
|
|
|
spec.statefulSet.spec.serviceName유형: 문자열
기본값:
<resource_name>-svc및<resource_name>-svc-externalStatefulSet에 생성하거나 사용할 Kubernetes 서비스의 이름입니다. 이 이름의 서비스가 이미 존재하는 경우, Kubernetes Operator용 MongoDB 컨트롤러는 해당 서비스를 삭제 하거나 다시 생성하지 않습니다. 이 설정을 사용하면 사용자 지정 서비스를 직접 생성하고 Kubernetes Operator가 이를 재사용할 수 있습니다.
PVC(볼륨 요청 템플릿) 재정의 필드
The Kubernetes Operator merges a volume claim template that you specify in spec.statefulSet.spec.volumeClaimTemplates only if its metadata.name matches the name of an existing volume claim template. The following table shows which PVC fields the Kubernetes Operator preserves and which it drops when you specify values in spec.statefulSet.spec.volumeClaimTemplates. Field paths are relative to an individual volume claim template, so spec.volumeMode corresponds to spec.statefulSet.spec.volumeClaimTemplates.spec.volumeMode in the MongoDB resource specification.
지원됨(유지됨) | 지원되지 않음(제거됨) |
|---|---|
|
|
| [1] | Kubernetes 연산자는 지정한 액세스 모드를 기본 액세스 모드에 대체하는 대신 추가합니다. |