Para agentes de IA: um índice de documentação está disponível em https://www.mongodb.com/pt-br/docs/llms.txt — as versões de markdown de todas as páginas estão disponíveis anexando .md a qualquer caminho de URL.
Menu Docs

Referência de comando do plug-in migration-to-mck

The kubectl mongodb plugin's migrate-to-mck command generates the Kubernetes custom resources you need to migrate a self-managed deployment into Kubernetes under Kubernetes Operator. It has two subcommands: mongodb, which generates the MongoDB resource, and users, which generates MongoDBUser resources.

Ambos os subcomandos validam a configuração da automação de origem antes de produzir qualquer saída e saem com um status diferente de zero em qualquer problema de bloqueio. Ambos suportam solicitação interativa para valores ausentes e um modo totalmente não interativo quando você fornece todos os sinalizadores necessários.

Generates the MongoDB custom resource for the migration target.

bandeira
Obrigatório
Descrição

--config-map-name

Sim

Name of the Ops Manager or Cloud Manager project ConfigMap.

--secret-name

Sim

Name of the Secret that holds the Ops Manager or Cloud Manager API key.

--namespace

No

Kubernetes namespace for the generated resource. Defaults to default.

-o, --output

No

Caminho do arquivo para gravar o recurso gerado.

--certs-secret-prefix

Somente quando o TLS está ativado

Sets spec.security.certsSecretPrefix on the generated resource, and suppresses the interactive prompt for this value.

--prometheus-secret-name

Somente quando Prometeus está ativado

Name of a pre-created Secret that contains a password key, used for Prometheus scraping credentials.

--resource-name-override

No

Sets metadata.name on the generated resource. When the source replica set name is not a valid Kubernetes name, the plugin normalizes it automatically and sets spec.replicaSetNameOverride for you.

Generates MongoDBUser resources for the migration target's authenticated users.

bandeira
Obrigatório
Descrição

--config-map-name

Sim

Name of the Ops Manager or Cloud Manager project ConfigMap.

--secret-name

Sim

Name of the Secret that holds the Ops Manager or Cloud Manager API key.

--namespace

No

Kubernetes namespace for the generated resources. Defaults to default.

-o, --output

No

Caminho do arquivo para gravar os recursos gerados.

--users-secrets-file

No

Path to a CSV file that maps SCRAM users to Secrets. Each line uses the form username:database,secret-name. If you omit this flag, the plugin prompts you for a Secret name for each user, and suggests <username>-password as the default.

--resource-name-override

No

Name of the MongoDB resource that the generated MongoDBUser resources reference through mongodbResourceRef.name. Defaults to the normalized replica set name.

Observação

O plugin gera recursos MongoDBUser para X.509 e usuários LDAP no banco de dados$external. O plugin ignora o usuário do agente de automação.

Antes de executar qualquer subcomando, crie os seguintes objetos do Kubernetes:

  • A project ConfigMap with baseUrl, orgId, and projectName keys.

  • An API-key Secret with publicKey and privateKey keys.

  • One Secret per SCRAM user, each with a password key.

  • If Prometheus is enabled, a Secret with a password key for the Prometheus scrape credentials.

  • Se o TLS estiver habilitado:

    • A <resourceName>-ca ConfigMap with a ca-pem key.

    • A kubernetes.io/tls Secret named <certsSecretPrefix>-<resourceName>-cert.

  • Se a autenticação do agente X.509 estiver habilitada, um Secret chamado <certsSecretPrefix>-<resourceName>-agent-certs.