Importante
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.
Miembros externos
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.
Importante
These fields exist for migration only. Do not set them on a MongoDB resource for a greenfield Kubernetes deployment.
spec.externalMembersType: array of
ExternalMemberobjectsLos procesos de origen de la máquina virtual o del hardware físico que forman parte de la migración. Este campo existe únicamente para la migración.
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[].processNameTipo: string
Requerido
This field exists for migration only. The process name exactly as it appears in the
processesarray of the automation config.
spec.externalMembers[].hostnameTipo: string
Requerido
This field exists for migration only. The
host:portvalue for the process, exactly as it appears in the automation config.
Anulaciones de nombres
Estos campos existen únicamente para la migración y anulan el nombre del recurso o de la configuración de automatización que Kubernetes Operator utilizaría o generaría de otro modo.
spec.replicaSetNameOverrideTipo: string
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.configServerNameOverrideTipo: string
Este campo existe únicamente para la migración. El nombre del conjunto de réplicas del servidor de configuración aparece tal como figura en la configuración de automatización.
spec.shardNameOverridesType: array of
ShardNameOverrideobjectsThis field exists for migration only. Per-shard automation config replica set name and shard
_id.Nota
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.
Rutas de configuración de automatización configurables
Anteriormente, Kubernetes Operator tenía estos ajustes de configuración de automatización codificados de forma fija. La migración requiere que sean configurables para que una implementación de Kubernetes pueda coincidir con las rutas que ya se utilizan en las máquinas virtuales de origen.
spec.downloadBaseTipo: string
Por defecto:
/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.caFilePathTipo: string
Por defecto:
/mongodb-automation/tls/ca/ca-pemRuta absoluta donde el operador de Kubernetes proyecta el certificado CA dentro del pod. Esta ruta debe contener al menos dos segmentos. No es compatible con la base de datos de la aplicación.
Nota
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.autoPEMKeyFilePathTipo: string
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.Por defecto, utiliza la ruta de montaje del certificado de agente derivado del hash que usa Kubernetes Operator para las implementaciones no migradas.
Condiciones de estado
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]Tipo:condición de 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.RazónEstadoSignificadoValidatingTrueLa anotación de prueba está configurada.
ExtendingTrueEl número deseado de miembros de Kubernetes supera el último recuento conciliado.
PruningTrueThe
externalMemberscount dropped belowstatus.migrationObservedExternalMembersCount.InProgressTrueExisten miembros externos, pero nada cambia. Esta es también la razón de la primera reconciliación.
MigrationCompleteFalseTodos los miembros externos han sido eliminados.
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.No está permitido podar y alargar al mismo tiempo.
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.Código de salida del trabajo del validadorEstado de la condiciónRazónSignificadoEl trabajo sigue en marcha.
UnknownRunningThe
status.phaseisConnectivityCheckRunning.0TrueNetworkValidationPassedTodos los miembros externos son accesibles y están autenticados.
2FalseAuthenticationFailedCredentials, the authentication mechanism, or a missing
__system@localrole.3FalseNetworkFailedProblemas con DNS, TLS, tiempos de espera o miembros inaccesibles. Consulte los registros del Job Pod.
1u otroFalseUnknownErrorError no clasificado. Compruebe los registros del 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.migrationObservedExternalMembersCountTipo: entero
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.Nota
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.
Anotaciones
metadata.annotations.mongodb.com/migration-dry-runTipo: cadena (valor booleano)
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.
Áreas relacionadas que requieren atención específica en materia de migración
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.Advertencia
Establezca spec.memberConfig antes de aumentar el número de miembros.
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.