This directory contains production-ready deployment examples for MongoDB Operator. Each category provides tailored manifests for different use cases.
Simple, production-ready deployments with minimal resource requirements. Ideal for development, testing, or production workloads with modest needs.
- mongodb-replicaset.yaml: 3-member ReplicaSet with 10Gi storage, SCRAM-SHA-256 authentication
- mongodb-sharded.yaml: 2-shard cluster (3 members each) with 50Gi storage
Enterprise-grade deployments with resource limits, monitoring, TLS, and high availability features.
- mongodb-replicaset-prod.yaml: 5-member ReplicaSet with resource limits, pod disruption budget, network policies
- mongodb-sharded-prod.yaml: 3-shard cluster (3 members each) with HA mongos, anti-affinity rules
Backup and restore configurations for automated data protection.
- s3-backup.yaml: MongoDBBackup CRD with S3-compatible storage, compression, and scheduling
Prometheus and Grafana integration for comprehensive observability.
- prometheus-stack.yaml: Prometheus, Grafana, and ServiceMonitor for MongoDB metrics
-
Deploy the operator (if not already installed):
helm install mongodb-operator mongodb-operator/mongodb-operator \ --namespace mongodb-operator-system --create-namespace
-
Choose an example and customize it for your environment:
- Update
storageClassNamefor your cluster - Adjust resource requests/limits as needed
- Configure secrets with your credentials
- Update
-
Deploy:
kubectl apply -f examples/minimal/mongodb-replicaset.yaml
For complete documentation, see:
- Main README - Overview and architecture
- Project Documentation - GitHub repository
- CRD Reference - Available configuration options
- Kubernetes 1.26+
- MongoDB Operator installed
- Appropriate StorageClass configured
- Secret resources for credentials (create before deploying)
All examples include comments explaining key configuration options. Modify values based on your requirements:
- Storage: Adjust
spec.storage.sizeandstorageClassName - Resources: Update
spec.resourcesfor CPU/memory limits - Replicas: Change
spec.membersorspec.shards.count - Monitoring: Enable/disable
spec.monitoring.enabled - TLS: Configure
spec.tls.enabledand cert-manager settings
- Never commit credentials to version control
- Use Kubernetes Secrets for sensitive data
- Enable TLS for production deployments
- Use strong passwords with SCRAM-SHA-256 authentication
- Configure network policies to restrict access