This is a test repository for setting up and testing the MongoDB Kubernetes Operator in a local minikube environment. The repository contains Helm charts and automation scripts to deploy a complete MongoDB stack with certificate management and operations manager.
Before using this repository, ensure you have the following tools installed:
- minikube - Local Kubernetes cluster for testing
- kubectl - Kubernetes command-line tool
- Helm (v3.x) - Kubernetes package manager
- Docker - Container runtime (required by minikube)
- k9s - Terminal-based UI for Kubernetes clusters (recommended for monitoring)
Run the initialization script to set up your complete MongoDB Kubernetes environment:
chmod +x init-minikube.sh
./init-minikube.shCheck that all components are running:
# Check minikube status
minikube status
# Check all pods are running
kubectl get pods --all-namespaces
# Check MongoDB operator
kubectl get pods -n mongodbThe init-minikube.sh script automates the complete setup of a MongoDB Kubernetes environment. Here's what it does step by step:
- Starts a local minikube cluster
- Enables the ingress addon for external access
- Enables the metrics-server addon for resource monitoring
- Adds the official MongoDB Helm repository
- Installs the MongoDB Kubernetes Operator (v1.5.0) in the
mongodbnamespace - This operator manages MongoDB deployments, replica sets, and sharded clusters
- Installs External DNS (v1.19.0) with CoreDNS provider
- Enables automatic DNS record creation for ingress resources
- Deployed in the
external-dnsnamespace
- Installs cert-manager (v1.19.1) for automatic TLS certificate provisioning
- Installs trust-manager for certificate bundle management
- Both deployed in the
cert-managernamespace with CRDs enabled
- Deploys the
ca-crtchart for Certificate Authority setup - Installs the
mongodb-crtchart for MongoDB-specific certificates - Ensures proper TLS encryption for MongoDB connections
- Deploys the
ops-managerchart for MongoDB cluster management - Provides a web interface for monitoring and managing MongoDB deployments
├── init-minikube.sh # Main initialization script
├── charts/ # Helm charts directory
│ ├── ca-crt/ # Certificate Authority setup
│ ├── mongodb-crt/ # MongoDB certificate configuration
│ └── opsmanager/ # MongoDB Operations Manager
└── README.md # This file
- The script uses
--waitflags to ensure each component is fully deployed before proceeding - All MongoDB-related components are deployed in the
mongodbnamespace - Certificate management components use the
cert-managernamespace - The setup includes both development certificates and production-ready certificate management
To remove the entire environment:
minikube deleteThis will completely remove the minikube cluster and all deployed components.
This is a test repository for MongoDB Kubernetes operator experimentation. Feel free to modify the charts and scripts to test different configurations.