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.
Both subcommands validate the source automation config before producing any output, and exit with a non-zero status on any blocking issue. Both support interactive prompting for missing values, and a fully non-interactive mode when you supply all required flags.
kubectl mongodb migrate-to-mck mongodb
Generates the MongoDB custom resource for the migration target.
Flag | Required | Description |
|---|---|---|
| Yes | Name of the Ops Manager or Cloud Manager project |
| Yes | Name of the |
| No | Kubernetes namespace for the generated resource. Defaults to |
| No | File path to write the generated resource to. |
| Only when TLS is enabled | Sets |
| Only when Prometheus is enabled | Name of a pre-created |
| No | Sets |
kubectl mongodb migrate-to-mck users
Generates MongoDBUser resources for the migration target's authenticated users.
Flag | Required | Description |
|---|---|---|
| Yes | Name of the Ops Manager or Cloud Manager project |
| Yes | Name of the |
| No | Kubernetes namespace for the generated resources. Defaults to |
| No | File path to write the generated resources to. |
| No | Path to a CSV file that maps SCRAM users to |
| No | Name of the |
Note
The plugin generates MongoDBUser resources for X.509 and LDAP users against the $external database. The plugin skips the automation agent user.
Pre-Creation Requirements
Before you run either subcommand, create the following Kubernetes objects:
A project
ConfigMapwithbaseUrl,orgId, andprojectNamekeys.An API-key
SecretwithpublicKeyandprivateKeykeys.One
Secretper SCRAM user, each with apasswordkey.If Prometheus is enabled, a
Secretwith apasswordkey for the Prometheus scrape credentials.If TLS is enabled:
A
<resourceName>-caConfigMapwith aca-pemkey.A
kubernetes.io/tlsSecretnamed<certsSecretPrefix>-<resourceName>-cert.
If X.509 agent authentication is enabled, a
Secretnamed<certsSecretPrefix>-<resourceName>-agent-certs.