Skip to content

MikeJansen/mongodb-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDB Kubernetes Operator Test Repository

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.

Prerequisites

Before using this repository, ensure you have the following tools installed:

Required Tools

  • minikube - Local Kubernetes cluster for testing
  • kubectl - Kubernetes command-line tool
  • Helm (v3.x) - Kubernetes package manager
  • Docker - Container runtime (required by minikube)

Optional Tools

  • k9s - Terminal-based UI for Kubernetes clusters (recommended for monitoring)

Quick Start

1. Initialize Minikube Environment

Run the initialization script to set up your complete MongoDB Kubernetes environment:

chmod +x init-minikube.sh
./init-minikube.sh

2. Verify Installation

Check 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 mongodb

What does init-minikube.sh do?

The init-minikube.sh script automates the complete setup of a MongoDB Kubernetes environment. Here's what it does step by step:

1. Minikube Setup

  • Starts a local minikube cluster
  • Enables the ingress addon for external access
  • Enables the metrics-server addon for resource monitoring

2. MongoDB Kubernetes Operator

  • Adds the official MongoDB Helm repository
  • Installs the MongoDB Kubernetes Operator (v1.5.0) in the mongodb namespace
  • This operator manages MongoDB deployments, replica sets, and sharded clusters

3. External DNS Configuration

  • Installs External DNS (v1.19.0) with CoreDNS provider
  • Enables automatic DNS record creation for ingress resources
  • Deployed in the external-dns namespace

4. Certificate Management

  • Installs cert-manager (v1.19.1) for automatic TLS certificate provisioning
  • Installs trust-manager for certificate bundle management
  • Both deployed in the cert-manager namespace with CRDs enabled

5. Custom Certificate Setup

  • Deploys the ca-crt chart for Certificate Authority setup
  • Installs the mongodb-crt chart for MongoDB-specific certificates
  • Ensures proper TLS encryption for MongoDB connections

6. Operations Manager

  • Deploys the ops-manager chart for MongoDB cluster management
  • Provides a web interface for monitoring and managing MongoDB deployments

Repository Structure

├── 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

Usage Notes

  • The script uses --wait flags to ensure each component is fully deployed before proceeding
  • All MongoDB-related components are deployed in the mongodb namespace
  • Certificate management components use the cert-manager namespace
  • The setup includes both development certificates and production-ready certificate management

Cleanup

To remove the entire environment:

minikube delete

This will completely remove the minikube cluster and all deployed components.

Contributing

This is a test repository for MongoDB Kubernetes operator experimentation. Feel free to modify the charts and scripts to test different configurations.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages