KubeBlocks
BlogsKubeBlocks Cloud
Overview
Quickstart

Operations

Lifecycle Management
Vertical Scaling
Horizontal Scaling
Volume Expansion
Manage MongoDB Services
MongoDB Switchover
Decommission MongoDB Replica

Backup And Restores

Create BackupRepo
Create Full Backup
Scheduled Backups
Scheduled Continuous Backup
Restore MongoDB Cluster
Restore with PITR

Custom Secret

Custom Password

tpl

  1. Supported Topologies
  2. Lifecycle Management
  3. Backup and Restore
  4. Supported Versions

Overview of KubeBlocks MongoDB Addon

MongoDB is a NoSQL document database designed for flexibility, scalability, and high performance. Unlike traditional relational databases (SQL), MongoDB stores data in JSON-like documents (BSON format), making it ideal for unstructured or semi-structured data.

Supported Topologies

replicaset

A MongoDB replica set is a group of MongoDB servers that maintain the same dataset, providing high availability and data redundancy. Replica sets are the foundation of MongoDB's fault tolerance and data reliability. By replicating data across multiple nodes, MongoDB ensures that if one server fails, another can take over seamlessly without affecting the application's availability.

In a replica set, there are typically three types of nodes:

  • Primary Node: Handles all write operations and serves read requests by default.
  • Secondary Nodes: Maintain copies of the primary's data and can optionally serve read requests.
  • Arbiter Node: Participates in elections but does not store data. It is used to maintain an odd number of voting members in the replica set.

And it is recommended to create a cluster with at least three nodes to ensure high availability, one primary and two secondary nodes.

Lifecycle Management

KubeBlocks simplifies MongoDB operations with comprehensive lifecycle management:

FeatureDescription
Horizontal ScalingScale replicas in/out to adjust capacity
Vertical ScalingAdjust CPU/memory resources for MongoDB instances
Volume ExpansionDynamically increase storage capacity without downtime
Restart OperationsControlled cluster restarts with minimal disruption
Start/StopTemporarily suspend/resume cluster operations
Password ManagementAbility to set and manage custom root password for the MongoDB cluster during creation
Custom ServicesExpose specialized database endpoints
SwitchoverPlanned primary-replica role changes
Replica ManagementSafely decommission or rebuild specific replicas
Version UpgradesPerform minor version upgrades seamlessly
Advanced SchedulingCustomize pod placement and resource allocation
MonitoringIntegrated Prometheus metrics collection
LoggingCentralized logs via Loki Stack

Backup and Restore

KubeBlocks supports multiple backup strategies for MongoDB:

FeatureMethodDescription
Full BackupdumpUses mongodump, a MongoDB utility used to create a binary export of the contents of a database
Full BackupdatafileBackup the data files of the database
Continuous Backuparchive-oplogContinuously archives MongoDB oplog using wal-g

Supported Versions

KubeBlocks MongoDB Addon supports these MongoDB versions:

Major VersionSupported Minor Versions
4.04.0.28,4.2.24,4.4.29
5.05.0.28
6.06.0.22,6.0.20,6.0.16
7.07.0.19,7.0.16,7.0.12
8.08.0.8,8.0.6,8.0.4

The list of supported versions can be found by following command:

kubectl get cmpv mongodb

© 2025 ApeCloud PTE. Ltd.