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 new MongoDB Operator for Kubernetes incorporates these and other best practices in an easy to deploy way.

Introduction To Running MongoDB on Kubernetes

  1. Deploying a MongoDB Replica Set as a Kubernetes StatefulSet
  2. Configuring Some Key Production Settings for MongoDB on Kubernetes
  3. Using the Enterprise Version of MongoDB on Kubernetes
  4. Deploying a MongoDB Sharded Cluster using Kubernetes StatefulSets
  5. MongoDB Operator for Kubernetes (by Robert Walters)

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

  1. Deploying a MongoDB Replica Set to the Google Kubernetes Engine (GKE)
  2. Deploying a MongoDB Sharded Cluster to the Google Kubernetes Engine (GKE)
  3. Deploying a MongoDB Replica Set to the Azure Container Service (ACS)
  4. Deploying a MongoDB Replica Set to a local Minikube environment
  5. Deploying a MongoDB Replica Set to an OpenShift environment
  6. Deploying a MongoDB Replica Set to GKE Using MongoDB Cloud/Ops Manager
  7. MongoDB Ops Manager Openshift “Developer Preview” (by Jason Mimick)

Getting Help on Stack Overflow

  1. “kubernetes” tagged questions
  2. “google-container-engine” tagged questions or “google-kubernetes-engine” tagged questions
  3. “azure-container-service” tagged questions
  4. “minikube” tagged questions
  5. “openshift” tagged questions
  6. “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

  1. Kubernetes Manual
  2. Kubernetes Up and Running book (Hightower, Burns & Beda - 2017)
  3. Google Kubernetes Engine (GKE) for Kubernetes Manual
  4. Azure Container Service (ACS) for Kubernetes Manual
  5. Minikube (Kubernetes locally) Manual
  6. OpenShift with Kubernetes Manual

Useful Docker Resources

  1. Docker Manual
  2. Docker MongoDB Image Repository
  3. Docker MongoDB Image GitHub Project (inc. building Enterprise version)

Useful MongoDB Resources

  1. MongoDB Manual
  2. MongoDB Enterprise Operator for Kubernetes
  3. MongoDB Production Notes
  4. MongoDB Operations Checklist
  5. 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.