Use the kubectl mongodb plugin to:
Before you begin, install the kubectl mongodb plugin.
The kubectl mongodb plugin has the following subcommands:
setup Subcommand
The kubectl mongodb multicluster setup subcommand sets up the initial multi-Kubernetes cluster MongoDB deployment.
It performs the following actions:
Creates a default ConfigMap named
mongodb-enterprise-operator-member-listthat contains all the member clusters of the multi-Kubernetes cluster MongoDB deployment. This name is hard-coded and you can't change it. See Known Issues.Creates ServiceAccounts, Roles, ClusterRoles, RoleBindings and ClusterRoleBindings in the operator cluster and each member cluster.
Applies the correct permissions for service accounts.
Uses the preceding settings to create your multi-Kubernetes cluster MongoDB deployment.
setup Subcommand Options
The setup subcommand of the kubectl mongodb plugin has the following options:
Option | Data Type | Description |
|---|---|---|
| string | Required. Central cluster that the Kubernetes Operator
will be deployed in, such as:
|
| string | Required. Namespace that the Kubernetes Operator
will be deployed to, such as:
|
| boolean | Optional. Flag that indicates whether to
delete all previously created resources
except for namespaces.
Default value is |
| boolean | Optional. Flag that indicates whether to
create ClusterRole and ClusterRoleBindings
for member clusters. Default value is |
| boolean | Optional. Flag that indicates whether to create secrets
for the service accounts in the Kubernetes API server.
Default value is |
| boolean | Optional. Flag that indicates whether to install
the Service accounts and roles required for running
MongoDB workloads on the member clusters.
Default value is |
| boolean | Optional. Flag that indicates whether the service accounts
that the |
| string | Required. Comma-separated list that contains
member clusters, such as:
|
| string | Required. Namespace that the member cluster resources
will be deployed to, such as:
|
| string | Optional. Name of the service account for the
Kubernetes Operator to use to communicate with the
member clusters. Default value is
|
For a full example of the kubectl mongodb plugin setup subcommand's usage,
see the multi-Kubernetes-cluster quick start.
recover Subcommand
The kubectl mongodb multicluster subcommand can automatically recover a
failed cluster topology in some cases. In other cases, you must
manually recover from a failure. To
learn more, see Disaster Recovery.
recover Subcommand Options
The recover subcommand of the kubectl mongodb plugin has the following options:
Option | Data Type | Description |
|---|---|---|
| string | Required. Central cluster that the Kubernetes Operator
will be deployed in, such as:
|
| string | Required. Namespace that the Kubernetes Operator
will be deployed to, such as:
|
| boolean | Optional. Flag that indicates whether to
delete all previously created resources
except for namespaces.
Default value is |
| boolean | Optional. Flag that indicates whether to
create ClusterRole and ClusterRoleBindings
for member clusters. Default value is |
For a full example of the kubectl mongodb plugin recover subcommand's usage,
see the manual disaster recovery procedure.