Para agentes de IA: hay un índice de documentación disponible en https://www.mongodb.com/es/docs/llms.txt — versiones en markdown de todas las páginas están disponibles agregando .md a cualquier ruta URL.
Docs Menu

Configuración de recursos de migración de MongoDB

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.

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

Type: array of ExternalMember objects

Los 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.externalMembers list means the migration is complete.

spec.externalMembers[].processName

Tipo: string

Requerido

This field exists for migration only. The process name exactly as it appears in the processes array of the automation config.

spec.externalMembers[].hostname

Tipo: string

Requerido

This field exists for migration only. The host:port value for the process, exactly as it appears in the automation config.

spec.externalMembers[].type

Type: enum: mongod or mongos

Requerido para clústeres fragmentados

This field exists for migration only. A replica set has only mongod external members.

spec.externalMembers[].replicaSetName

Tipo: string

Opcional

This field exists for migration only. Required for a sharded-cluster mongod external member. Identifies whether the process belongs to the config server replica set or to a specific shard's replica set.

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

Tipo: 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-mck plugin sets this field for you through its --resource-name-override flag.

spec.configServerNameOverride

Tipo: 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.shardNameOverrides

Type: array of ShardNameOverride objects

This field exists for migration only. Per-shard automation config replica set name and shard _id.

Nota

Do not confuse spec.shardNameOverrides with spec.shardOverrides. spec.shardOverrides configures per-shard resource settings and is unrelated to migration naming.

Kubernetes StatefulSet names are never affected by these overrides.

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

Tipo: string

Por defecto: /var/lib/mongodb-mms-automation

Directory where the MongoDB Agent downloads the agent binary. Kubernetes Operator derives the keyfile path from this setting as <downloadBase>/keyfile.

spec.security.tls.caFilePath

Tipo: string

Por defecto: /mongodb-automation/tls/ca/ca-pem

Ruta 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 podTemplate volume mounts before you set a custom value.

spec.security.authentication.agents.autoPEMKeyFilePath

Tipo: 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.autoPEMKeyFilePath value, and mounts the secret referenced by spec.security.authentication.agents.clientCertificateSecretRef at 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.

status.conditions

Type: array of Kubernetes Conditions

Standard Kubernetes conditions, keyed by type. This field is new on the MongoDB resource and supports migration.

status.conditions[type=Migrating]

Tipo:condición de Kubernetes

The top-level indicator of whether a migration is active. status is True while spec.externalMembers is non-empty, and flips to False with reason MigrationComplete once you remove the last external member.

Razón
Estado
Significado

Validating

True

La anotación de prueba está configurada.

Extending

True

El número deseado de miembros de Kubernetes supera el último recuento conciliado.

Pruning

True

The externalMembers count dropped below status.migrationObservedExternalMembersCount.

InProgress

True

Existen miembros externos, pero nada cambia. Esta es también la razón de la primera reconciliación.

MigrationComplete

False

Todos los miembros externos han sido eliminados.

Precedence is Validating > Extending > Pruning > InProgress. A prune that also grows the Kubernetes side reports Extending, 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=False rather than polling status.phase.

status.conditions[type=NetworkConnectivityVerified]

Type: Kubernetes condition

The result of the dry-run connectivity check. Kubernetes Operator removes this condition from status.conditions entirely once no external members remain.

Código de salida del trabajo del validador
Estado de la condición
Razón
Significado

El trabajo sigue en marcha.

Unknown

Running

The status.phase is ConnectivityCheckRunning.

0

True

NetworkValidationPassed

Todos los miembros externos son accesibles y están autenticados.

2

False

AuthenticationFailed

Credentials, the authentication mechanism, or a missing __system@local role.

3

False

NetworkFailed

Problemas con DNS, TLS, tiempos de espera o miembros inaccesibles. Consulte los registros del Job Pod.

1 u otro

False

UnknownError

Error no clasificado. Compruebe los registros del Job Pod.

Failures that occur before the Job starts use the reasons OperatorImageUnknown, BuildStatefulSetOptions, AgentCertSecretFailed, and AgentCertSubject.

Kubernetes Operator removes the NetworkConnectivityVerified condition from status.conditions entirely once no external members remain.

status.migrationObservedExternalMembersCount

Tipo: entero

The number of spec.externalMembers entries that Kubernetes Operator observed on the last reconcile. Kubernetes Operator compares this value against the current spec.externalMembers count 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 MongoDBOpsManager custom resource schema, as a side effect of Go struct embedding. On the MongoDBOpsManager resource, the field is always null. Ignore it there.

metadata.annotations.mongodb.com/migration-dry-run

Tipo: cadena (valor booleano)

The kubectl mongodb migrate-to-mck plugin sets this annotation to true. While this annotation is present, Kubernetes Operator makes no automation config changes and performs connectivity validation only. Removing the annotation starts the real migration.

metadata.annotations.mongodb.com/migrate-tool-version

Tipo: string

Records the version of the kubectl mongodb migrate-to-mck plugin that generated the resource. Kubernetes Operator validates this annotation against its own version on every reconcile, including during the dry run.

The following existing MongoDB resource fields are not migration-only, but require specific values or review during a migration: