mongodb-cluster

by genofire

Helm chartv0.3.0App 0.3.0

Provides easy MongoDB cluster setup definitions for Kubernetes services, and deployment.

About this chart

MongoDB Cluster

MongDB is a NoSQL based distributed database, this helm chart is for only standalone setup. This helm chart needs MongoDB Operator inside Kubernetes cluster. The mongodb definition can be modified or changed by values.yaml.

$ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/
$ helm install <my-release> ot-helm/mongodb-cluster --namespace <namespace>

Redis setup can be upgraded by using helm upgrade command:-

$ helm upgrade <my-release> ot-helm/mongodb-cluster --install --namespace <namespace>

For uninstalling the chart:-

$ helm delete <my-release> --namespace <namespace>

Pre-Requisities

  • Kubernetes => 1.15
  • Helm => 3.X
  • MongoDB Operator => 0.1.0

Parameters

NameValueDescription
clusterSize3Size of the MongoDB cluster
image.namequay.io/opstree/mongoName of the MongoDB image
image.tagv5.0Tag for the MongoDB image
image.imagePullPolicyIfNotPresentImage Pull Policy of the MongoDB
image.pullSecret""Image Pull Secret for private registry
resources{}Request and limits for MongoDB statefulset
storage.enabledtrueStorage is enabled for MongoDB or not
storage.accessModes["ReadWriteOnce"]AccessMode for storage provider
storage.storageSize1GiSize of storage for MongoDB
storage.storageClassgp2Name of the storageClass to create storage
mongoDBMonitoring.enabledtrueMongoDB exporter should be deployed or not
mongoDBMonitoring.image.namebitnami/mongodb-exporterName of the MongoDB exporter image
mongoDBMonitoring.image.tag0.11.2-debian-10-r382Tag of the MongoDB exporter image
mongoDBMonitoring.image.imagePullPolicyIfNotPresentImage Pull Policy of the MongoDB exporter image
serviceMonitor.enabledfalseServicemonitor to monitor MongoDB with Prometheus
serviceMonitor.interval30sInterval at which metrics should be scraped.
serviceMonitor.scrapeTimeout10sTimeout after which the scrape is ended
serviceMonitor.namespacemonitoringNamespace in which Prometheus operator is running
nodeSelector{}Nodeselector for the MongoDB statefulset
priorityClassName""Priority class name for the MongoDB statefulset
affinity{}Affinity for node and pods for MongoDB statefulset
tolerations[]Tolerations for MongoDB statefulset

Deploy mongodb-cluster with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mongodb-cluster on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmongodb-cluster is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply