- Deploy Multiple Clusters (Beta) >
- Multi-Cluster Quick Start >
- Quick Start Procedure
Quick Start Procedure¶
Before you begin, learn about multi-cluster deployments implementation, multi-cluster services and tools <multi-cluster-services-tools-ref>, and complete the prerequisite steps:
Note
The following procedure scopes your multi-cluster deployment to a single
namespace named mongodb
. You can set scope for your
deployment and use another namespace,
multiple, or all namespaces.
Run the multi-cluster kubeconfig creator
tool.¶
By default, the Kubernetes Operator is scoped to the mongodb
namespace.
The following command creates one central cluster, three member clusters,
and a namespace labeled mongodb
in each of the clusters.
Change to the directory to which you cloned the Kubernetes Operator repository, and then to the directory that has the
multi-cluster kubeconfig creator
tool.Run the multi-cluster kubeconfig creator tool:
Set the Istio injection webhook in each member cluster.¶
Run the following command on the central cluster, specifying the context
for each of the member clusters in the deployment. These commands add
the istio-injection=enabled
label to the mongodb
namespace on
each member cluster. This label configures Istio’s injection webhook
which enables adding a sidecar to any Pods that you create in this
namespace. To learn more, see Automatic sidecar injection
in the Istio documentation.
Configure kubectl
to use the central cluster’s namespace.¶
If you have not done so already, run the following commands to run
all kubectl
commands on the central cluster in the default
namespace. In the following steps, you will install the Kubernetes Operator
into this namespace.
Add the MongoDB Helm Charts for Kubernetes repository to Helm.¶
Install the MongoDB Enterprise Kubernetes Operator in the central cluster.¶
Use the MongoDB Helm Charts for Kubernetes for multi-cluster deployments to install Kubernetes Operator for managing your multi-cluster deployment:
Deploy the MongoDB resource.¶
On the central cluster, create a secret so that the Kubernetes Operator can create and update objects in your Ops Manager project. To learn more, see Create Credentials for the Kubernetes Operator.
On the central cluster, create a ConfigMap to link the Kubernetes Operator to your Ops Manager project. To learn more, see Create One Project using a ConfigMap.
On the central cluster, configure the required service accounts for each member cluster:
Set
spec.credentials
andspec.opsManager.configMapRef.name
and deploy the MongoDB resource. In the following code sample,duplicateServiceObjects
is set totrue
to enable DNS proxying in Istio.Note
To enable the cross-cluster DNS resolution by the Istio service mesh, this tutorial creates service objects with a single ClusterIP address per each Kubernetes Pod.
Verify that the MDB resources are running.¶
For member clusters, run the following commands to verify that the MongoDB Pods are in the running state:
In the central cluster, run the following commands to verify that the
MongoDBMulti
custom resource is in the running state: