Guidance for running a MongoDB database cluster on the Kubernetes orchestration framework, leveraging Docker containers. StatetfulSets is a key dependency, to provide stable dedicated network storage volumes and hostnames, enabling data to outlive the lifetime of ephemeral containers. Note: The MongoDB Operator for Kubernetes incorporates these and other best practices in an easy to deploy way.
Introduction To Running MongoDB on Kubernetes
- Deploying a MongoDB Replica Set as a Kubernetes StatefulSet
- Configuring Some Key Production Settings for MongoDB on Kubernetes
- Using the Enterprise Version of MongoDB on Kubernetes
- Deploying a MongoDB Sharded Cluster using Kubernetes StatefulSets
- MongoDB and Kubernetes Home Page
- MongoDB Operator for Kubernetes (by Robert Walters & Andrey Belik)
WARNING: Some online resources advocate deploying a sidecar, called mongo-k8s-sidecar, to help “auto-configure” a MongoDB cluster. Do NOT employ that approach in Production environments, because this will result in non-deterministic behaviour, adversely affecting database resiliency.
Example Quickstart GitHub Projects
- Deploying a MongoDB Replica Set to the Google Kubernetes Engine (GKE)
- Deploying a MongoDB Sharded Cluster to the Google Kubernetes Engine (GKE)
- Deploying a MongoDB Replica Set to the Azure Container Service (ACS)
- Deploying a MongoDB Replica Set to a local Minikube environment
- Deploying a MongoDB Replica Set to an OpenShift environment
- Deploying a MongoDB Replica Set to GKE Using MongoDB Cloud/Ops Manager
Getting Help on Stack Overflow
- “kubernetes” tagged questions
- “google-kubernetes-engine” tagged questions
- “azure-container-service” tagged questions
- “minikube” tagged questions
- “openshift” tagged questions
- “mongodb” tagged questions
RECOMMENDED: When creating a new Stack Overflow question, define at least 2 tags: “mongodb” + a tag relating to the type of host Kubernetes environment.
Useful Kubernetes Resources
- Kubernetes Manual
- Kubernetes Up and Running book (Hightower, Burns & Beda - Free 2nd Ed. - 2019)
- Google Kubernetes Engine (GKE) for Kubernetes Manual
- Azure Container Service (ACS) for Kubernetes Manual
- Minikube (Kubernetes locally) Manual
- OpenShift with Kubernetes Manual
Useful Docker Resources
- Docker Manual
- Docker MongoDB Image Repository
- Docker MongoDB Image GitHub Project (inc. building Enterprise version)
Useful MongoDB Resources
- MongoDB Manual
- MongoDB and Kubernetes Home Page
- MongoDB Enterprise Kubernetes Operator
- MongoDB Community Kubernetes Operator
- MongoDB Production Notes
- MongoDB Operations Checklist
- MongoDB Security Checklist
Suggesting Changes To This Website
If you have a suggested change or addition to the content of this web page, please create a new “issue”, with a short description.