Docs Menu
Docs Home
/
MongoDB Enterprise Kubernetes Operator
/

MongoDB Plugin Reference

On this page

  • setup Subcommand
  • recover Subcommand

Use the kubectl mongodb plugin to:

  • Set up multi-Kubernetes-cluster Deployments

  • Run automatic and manual disaster recovery

Before you begin, install the kubectl mongodb plugin.

The kubectl mongodb plugin has the following subcommands:

  • setup Subcommand

  • recover Subcommand

The kubectl mongodb multicluster setup subcommand sets up the initial multi-Kubernetes cluster MongoDB deployment. It performs the following actions:

The setup subcommand of the kubectl mongodb plugin has the following options:

Option
Data Type
Description
central-cluster
string

Required. Central cluster that the Kubernetes Operator will be deployed in, such as: --central-cluster="MDB_CENTRAL_CLUSTER_FULL_NAME".

central-cluster-namespace
string

Required. Namespace that the Kubernetes Operator will be deployed to, such as: --central-cluster-namespace="mongodb".

cleanup
boolean

Optional. Flag that indicates whether to delete all previously created resources except for namespaces. Default value is false.

cluster-scoped
boolean

Optional. Flag that indicates whether to create ClusterRole and ClusterRoleBindings for member clusters. Default value is false.

create-service-account-secrets
boolean
Optional. Flag that indicates whether to create secrets for the service accounts in the Kubernetes API server. Default value is false.
install-database-roles
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 false.
image-pull-secrets
boolean
Optional. Flag that indicates whether the service accounts that the kubectl mongodb plugin creates should reference the secret you specified in the registry.imagePullSecrets setting. Default value is false. To learn more, see Helm installation settings.
member-clusters
string
Required. Comma-separated list that contains member clusters, such as: -member-clusters="${MDB_CLUSTER_2_FULL_NAME}, ${MDB_CLUSTER_3_FULL_NAME}, ${MDB_CLUSTER_4_FULL_NAME}".
member-cluster-namespace
string
Required. Namespace that the member cluster resources will be deployed to, such as: -member-cluster-namespace="mongodb".
service-account
string
Optional. Name of the service account for the Kubernetes Operator to use to communicate with the member clusters. Default value is mongodb-enterprise-operator-multi-cluster.

For a full example of the kubectl mongodb plugin setup subcommand's usage, see the multi-Kubernetes-cluster quick start.

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.

The recover subcommand of the kubectl mongodb plugin has the following options:

Option
Data Type
Description
central-cluster
string

Required. Central cluster that the Kubernetes Operator will be deployed in, such as: --central-cluster="MDB_CENTRAL_CLUSTER_FULL_NAME".

central-cluster-namespace
string

Required. Namespace that the Kubernetes Operator will be deployed to, such as: --central-cluster-namespace="mongodb".

cleanup
boolean

Optional. Flag that indicates whether to delete all previously created resources except for namespaces. Default value is false.

cluster-scoped
boolean

Optional. Flag that indicates whether to create ClusterRole and ClusterRoleBindings for member clusters. Default value is false.

For a full example of the kubectl mongodb plugin recover subcommand's usage, see the manual disaster recovery procedure.

Back

Disaster Recovery