Navigation

Multi-Cluster Overview

Important

Use the beta release of the multi-cluster deployments only in development environments.

Overview

Using multi-cluster deployments, you can deploy MongoDB Enterprise Kubernetes Operator to manage MongoDB deployments that span more than one Kubernetes cluster.

This tutorial demonstrates how you can use the Kubernetes Operator to deploy a MongoDB replica set across three Kubernetes member clusters, using GKE (Google Kubernetes Engine) and Istio service mesh.

Note

The procedure in this Quick Start relies on Istio, but you can use another service mesh solution as long as you ensure that cross-cluster service FQDNs are resolvable.

The beta release of the multi-cluster deployments offers you different layers of availability, depending on the needs of your enterprise application. You can use this tutorial to deploy:

  • Single Region, Multi AZ. One or more Kubernetes clusters where each cluster has nodes deployed in different zones in the same region. Such deployments protect MongoDB instances backing your enterprise applications against failures and offer increased availability, disaster recovery, and data distribution within one cloud region.

  • Multi Region. One or more Kubernetes clusters where you:

    • Deploy each cluster in a different region, and
    • Within each region, deploy cluster nodes in different availability zones.

    Such deployments allow you to add MongoDB instances in global clusters that span multiple geographic regions for increased availability and global distribution of data.

Central Cluster and Member Clusters

Istio or another service mesh manages the discovery of MongoDB nodes deployed in different Kubernetes member clusters. Each multi-cluster deployment that uses Istio or another service mesh comprises one Kubernetes central cluster and one or more member clusters.

  • Central cluster in Kubernetes contains:
    • MongoDB Enterprise Kubernetes Operator
    • Ops Manager, if you deploy it with the Kubernetes Operator
    • Kubernetes Operator MongoDBMulti CustomResource spec for the MongoDB replica set.
  • Member clusters in Kubernetes host the MongoDB replica sets.

You can host your application on any of the member clusters inside the Istio service mesh, either on Kubernetes clusters outside of the ones that you deploy with the Kubernetes Operator, or on the member clusters that you deploy as part of this tutorial.

To learn more, see the Multi-Cluster Deployment Architecture.

Services and Tools

This tutorial relies on the following services, tools, and their documentation:

  • Kubernetes clusters. This tutorial uses GKE (Google Kubernetes Engine) to provision multiple Kubernetes clusters. Each Kubernetes member cluster hosts a MongoDB replica set deployment and represents a data center that serves your application.
  • MongoDB Enterprise Kubernetes Operator repository with configuration files that the Kubernetes Operator needs to deploy a Kubernetes cluster.
  • MongoDB Helm Charts for Kubernetes with charts for multi-cluster deployments.
  • Istio service mesh. This tutorial uses Istio to facilitate DNS resolution for MongoDB replica sets deployed in different Kubernetes clusters. You can use another service mesh solution as long as you ensure that cross-cluster service FQDNs are resolvable.
  • Documentation from Istio to Install Multicluster.
  • install_istio_separate_network script that is based on Istio documentation and provides an example installation that uses the multi-primary mode on different networks. If you use another service mesh solution, create your own script for configuring separate networks to facilitate DNS resolution.
  • multi-cluster kubeconfig creator tool that performs the following actions:
    • Creates a single mongodb namespace in the central cluster and each member cluster.
    • Creates Service Accounts, Roles, and RoleBindings in the central cluster and each member cluster.
    • Puts Service Account token secrets from each member cluster into a single kubeconfig file and saves the file in the central cluster. This enables authorized access from the Kubernetes Operator installed in the central cluster to the member clusters.