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.
Operator Overview
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:
The Kubernetes Operator's architecture consists of two primary resource families:
The
MongoDBOpsManagercustom 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
MongoDBcustom resource, through which the Kubernetes Operator deploys database instances (standalone, replica set, or sharded cluster) and theMongoDBUserresources. After deployment, these resources reconcile updates you make to the user or MongoDB cluster configuration. To learn more, see MongoDB Database Resource Architecture.
Architecture Guides
- 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
MongoDB Database Resource Specification — MongoDB database resource specification
Ops Manager Resource Specification — Ops Manager resource specification
Multi-Kubernetes-Cluster Resource Specification — Multi-cluster specification
Multi-Cluster Deployment Prerequisites — Multi-cluster prerequisites
Deploy Ops Manager Resources on Multiple Kubernetes Clusters — Deploy Ops Manager on multiple clusters
Disaster Recovery for Ops Manager and AppDB Resources — Disaster recovery procedures
Reference Architectures — Reference architectures