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.
这两个子命令在生成任何输出之前都会验证源自动化配置,并在出现任何阻塞问题时以非零状态退出。两者都支持缺失值的交互式提示,以及当您提供所有必需标志时的完全非交互式模式。
kubectl mongodb migrate-to-mck mongodb
Generates the MongoDB custom resource for the migration target.
标记 | 必需 | 说明 |
|---|---|---|
| 是 | Name of the Ops Manager or Cloud Manager project |
| 是 | Name of the |
| No | Kubernetes namespace for the generated resource. Defaults to |
| No | 要写入生成的资源的文件路径。 |
| 仅当启用 TLS 时 | Sets |
| 仅当启用 Prometheus 时 | Name of a pre-created |
| No | Sets |
kubectl mongodb migrate-to-mck users
Generates MongoDBUser resources for the migration target's authenticated users.
标记 | 必需 | 说明 |
|---|---|---|
| 是 | Name of the Ops Manager or Cloud Manager project |
| 是 | Name of the |
| No | Kubernetes namespace for the generated resources. Defaults to |
| No | 要写入生成的资源的文件路径。 |
| No | Path to a CSV file that maps SCRAM users to |
| No | Name of the |
注意
该插件会根据 $external数据库为 X.509 和LDAP用户生成 MongoDBUser 资源。该插件会跳过自动化代理用户。
创建前要求
在运行任一子命令之前,请创建以下Kubernetes对象:
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.如果已启用 TLS:
A
<resourceName>-caConfigMapwith aca-pemkey.A
kubernetes.io/tlsSecretnamed<certsSecretPrefix>-<resourceName>-cert.
如果已启用 X.509代理身份验证,则会生成名为
<certsSecretPrefix>-<resourceName>-agent-certs的Secret。