Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
Click here >
Docs Menu
Docs Home
/ /

MongoDB Controllers for Kubernetes Operator Architecture Overview

The MongoDB Controllers for Kubernetes Operator is a Kubernetes controller that extends the Kubernetes API with custom resource definitions (CRDs) for MongoDB database deployments and Ops Manager. Understanding how these custom resources map to Kubernetes primitives, how the Kubernetes Operator reconciles changes, and how components connect to each other is essential before you plan your first deployment.

This section covers the architecture of every resource the Kubernetes Operator manages, from a single-cluster standalone deployment through a multi-cluster Ops Manager topology with backup infrastructure.

The Kubernetes Operator runs as a Deployment in a dedicated namespace. It watches for custom resources of type MongoDB, MongoDBOpsManager, MongoDBUser, and MongoDBMultiCluster. When you create or update one of these resources, the Kubernetes Operator reads the specification, validates it, and reconciles the Kubernetes objects (StatefulSets, Services, Secrets, ConfigMaps) needed to bring the actual state in line with your declared state.

The Kubernetes Operator provides a container image for the MongoDB Agent in Ops Manager, which allows you to manage and deploy MongoDB database clusters with full monitoring, backups, and automation. The Kubernetes container serves as a host on which Ops Manager orchestrates the installation of mongod processes and deploys the cluster configuration.

As part of deployment, the Kubernetes Operator creates PersistentVolumes for the StatefulSets. The containers use these PersistentVolumes to maintain cluster state between restarts.

The following diagram illustrates the flow of configuration for a Kubernetes instance using the Kubernetes Operator:

Diagram showing the flow of configuration for a Kubernetes
instance using the Kubernetes Operator.
click to enlarge

The Kubernetes Operator's architecture consists of two primary resource families:

  • The MongoDBOpsManager custom resource, through which the Kubernetes Operator deploys Ops Manager components: the Application Database, the Ops Manager application, and the Backup Daemon. After the deployment is operational, the Ops Manager components reconcile updates that you make to the MongoDB cluster configuration. To learn more, see Ops Manager Resource Architecture.

  • The MongoDB custom resource, through which the Kubernetes Operator deploys database instances (standalone, replica set, or sharded cluster) and the MongoDBUser resources. After deployment, these resources reconcile updates you make to the user or MongoDB cluster configuration. To learn more, see MongoDB Database Resource Architecture.

MongoDB Database Resource Architecture
Deployment types (Standalone, ReplicaSet, ShardedCluster), StatefulSet composition, MongoDB and MongoDBUser reconciliation workflows with diagrams.
Ops Manager Resource Architecture
Application Database, Ops Manager Application, Backup Daemon component architecture, topology considerations, and the MongoDBOpsManager reconciliation workflow.
Multi-Cluster Architecture
Single- vs. multi-cluster modes, limitations, capability differences, deployment diagrams (with and without service mesh), Ops Manager multi-cluster diagram, networking, load balancing, service mesh requirements, and performance considerations.

Tip

Back

Quick Start

On this page