중요
The settings on this page exist to support migrating a self-managed deployment into Kubernetes under Kubernetes Operator. Do not set them on a MongoDB resource that you deploy directly in Kubernetes without an accompanying migration.
This page documents the MongoDB resource fields, status conditions, and annotations that apply only during a migration from a self-managed, virtual-machine deployment into Kubernetes. For the full set of MongoDB resource settings, see MongoDB Database Resource Specification.
외부 멤버
These fields identify the source virtual machine or bare-metal processes that a migration is extending into Kubernetes. They apply to the MongoDB resource, apiVersion: mongodb.com/v1.
중요
These fields exist for migration only. Do not set them on a MongoDB resource for a greenfield Kubernetes deployment.
spec.externalMembersType: array of
ExternalMemberobjects마이그레이션 의 일부인 가상 머신 또는 베어메탈 소스 프로세스. 이 필드 마이그레이션 용으로만 존재합니다.
You may remove entries from this list, but you must never add entries once migration has started. An empty
spec.externalMemberslist means the migration is complete.
spec.externalMembers[].processName유형: 문자열
필수 사항
This field exists for migration only. The process name exactly as it appears in the
processesarray of the automation config.
spec.externalMembers[].hostname유형: 문자열
필수 사항
This field exists for migration only. The
host:portvalue for the process, exactly as it appears in the automation config.
이름 재정의
이러한 필드는 마이그레이션 용으로만 존재하며, 그렇지 않으면 Kubernetes Operator가 사용하거나 생성할 리소스 또는 자동화 구성 이름을 재정의합니다.
spec.replicaSetNameOverride유형: 문자열
This field exists for migration only. The automation config replica set name, when it differs from the Kubernetes resource name, or when the automation config replica set name is not a valid Kubernetes name. The
kubectl mongodb migrate-to-mckplugin sets this field for you through its--resource-name-overrideflag.
spec.shardNameOverridesType: array of
ShardNameOverrideobjectsThis field exists for migration only. Per-shard automation config replica set name and shard
_id.참고
Do not confuse
spec.shardNameOverrideswithspec.shardOverrides.spec.shardOverridesconfigures per-shard resource settings and is unrelated to migration naming.Kubernetes
StatefulSetnames are never affected by these overrides.
구성 가능한 자동화 구성 경로
Kubernetes Operator는 이전에 이러한 자동화 구성 설정을 하드 코딩했습니다. 마이그레이션하려면 Kubernetes 배포서버 소스 가상 머신에서 이미 사용 중인 경로와 일치할 수 있도록 구성해야 합니다.
spec.downloadBase유형: 문자열
기본값:
/var/lib/mongodb-mms-automationDirectory where the MongoDB Agent downloads the agent binary. Kubernetes Operator derives the keyfile path from this setting as
<downloadBase>/keyfile.
spec.security.tls.caFilePath유형: 문자열
기본값:
/mongodb-automation/tls/ca/ca-pemKubernetes Operator가 포드 내부에 CA 인증서를 프로젝션하는 절대 경로입니다. 이 경로에는 경로 세그먼트가 두 개 이상 포함되어야 합니다. 애플리케이션 데이터베이스는 지원되지 않습니다.
참고
If your pod template mounts a volume at or above this path, the mount can shadow the projected CA file. Review your
podTemplatevolume mounts before you set a custom value.
spec.security.authentication.agents.autoPEMKeyFilePath유형: 문자열
Absolute path of the MongoDB Agent's combined PEM file inside database pods. Setting this field sets the Ops Manager or Cloud Manager
tls.autoPEMKeyFilePathvalue, and mounts the secret referenced byspec.security.authentication.agents.clientCertificateSecretRefat that path.Requires
spec.security.authentication.agents.clientCertificateSecretRef.기본값은 Kubernetes Operator가 마이그레이션되지 않은 배포에 사용하는 해시 파생 에이전트 인증서 마운트 경로입니다.
상태 조건
status.conditionsType: array of Kubernetes Conditions
Standard Kubernetes conditions, keyed by
type. This field is new on theMongoDBresource and supports migration.
status.conditions[type=Migrating]유형: Kubernetes 조건
The top-level indicator of whether a migration is active.
statusisTruewhilespec.externalMembersis non-empty, and flips toFalsewith reasonMigrationCompleteonce you remove the last external member.이유상태의미ValidatingTrue테스트 실행 주석이 설정하다 되었습니다.
ExtendingTrue원하는 Kubernetes 멤버 수가 마지막으로 조정된 수를 초과했습니다.
PruningTrueThe
externalMemberscount dropped belowstatus.migrationObservedExternalMembersCount.InProgressTrue외부 멤버가 있지만 변경되는 것은 없습니다. 이것이 첫 번째 화해의 이유이기도 합니다.
MigrationCompleteFalse모든 외부 멤버가 제거되었습니다.
Precedence is
Validating>Extending>Pruning>InProgress. A prune that also grows the Kubernetes side reportsExtending, which is another reason to make one change at a time.가지 치기와 확장은 동시에 허용되지 않습니다.
To script against migration completion, use
kubectl wait --for=condition=Migrating=Falserather than pollingstatus.phase.
status.conditions[type=NetworkConnectivityVerified]Type: Kubernetes condition
The result of the dry-run connectivity check. Kubernetes Operator removes this condition from
status.conditionsentirely once no external members remain.유효성 검사기 작업 종료 코드조건 상태이유의미작업이 아직 실행 .
UnknownRunningThe
status.phaseisConnectivityCheckRunning.0TrueNetworkValidationPassed모든 외부 멤버에 연결할 수 있고 인증됩니다.
2FalseAuthenticationFailedCredentials, the authentication mechanism, or a missing
__system@localrole.3FalseNetworkFailedDNS, TLS, 시간 초과 또는 연결할 수 없는 멤버. Job Pod 로그를 확인합니다.
1또는 기타FalseUnknownError분류되지 않은 오류입니다. Job Pod 로그를 확인합니다.
Failures that occur before the Job starts use the reasons
OperatorImageUnknown,BuildStatefulSetOptions,AgentCertSecretFailed, andAgentCertSubject.Kubernetes Operator removes the
NetworkConnectivityVerifiedcondition fromstatus.conditionsentirely once no external members remain.
status.migrationObservedExternalMembersCount유형: integer
The number of
spec.externalMembersentries that Kubernetes Operator observed on the last reconcile. Kubernetes Operator compares this value against the currentspec.externalMemberscount on the next reconcile to detect that you pruned an external member. This field is unset when no external members remain.참고
This field also appears in the
MongoDBOpsManagercustom resource schema, as a side effect of Go struct embedding. On theMongoDBOpsManagerresource, the field is always null. Ignore it there.
주석
metadata.annotations.mongodb.com/migration-dry-run유형: 문자열(부울 값)
The
kubectl mongodb migrate-to-mckplugin sets this annotation totrue. While this annotation is present, Kubernetes Operator makes no automation config changes and performs connectivity validation only. Removing the annotation starts the real migration.
마이그레이션 관련 주의가 필요한 관련 필드
The following existing MongoDB resource fields are not migration-only, but require specific values or review during a migration:
spec.members,spec.mongodsPerShardCount,spec.configServerCount, andspec.mongosCountall start at0in the resource that thekubectl mongodb migrate-to-mckplugin generates.spec.memberConfig[].votes(integer, default1) andspec.memberConfig[].priority(string containing a float, default"1"). You must provide at least as manyspec.memberConfigentries asspec.members. Kubernetes Operator ignores the top-levelspec.memberConfigfor sharded clusters. Thekubectl mongodb migrate-to-mckplugin does not generatespec.memberConfig, and Kubernetes Operator does not default new members to non-voting, so the CRD defaults of1and"1"are exactly wrong while a new member is syncing.경고
멤버 수를 늘리기 전에 spec.memberConfig를 설정하세요.
By default, new Kubernetes members join as voting members. The CRD defaults are
votes: 1andpriority: "1", which let a still-syncing member participate in an election before it has finished its initial sync.MongoDB recommends that you write one
spec.memberConfigentry per new Kubernetes member withvotes: 0andpriority: "0"before you raise the member count, so that a still-syncing member cannot win an election.votesis an integer.priorityis a string.Fields that must match the source deployment exactly:
spec.version,spec.featureCompatibilityVersion,spec.additionalMongodConfig.net.port,spec.security.authentication.modes, andspec.security.authentication.internalCluster.