The Mender server uses MongoDB as primary storage layer. It doesn't have any particular requirements about the setup of the database, and can use MongoDB both in a single node setup and as a replica set.

To install MongoDB on the Kubernetes cluster using the Helm chart, for example deploying a replica set with two members and an arbitrer using Helm, run:

On the Debian family of distributions you can install pwgen with apt-get install pwgen. On the RPM family of distributions, you can install it with yum install pwgen.

export MONGODB_ROOT_PASSWORD=$(pwgen 32 1)
export MONGODB_REPLICA_SET_KEY=$(pwgen 32 1)

cat >mongodb.yml <<EOF
architecture: "replicaset"
replicaCount: 2
  enabled: true
  rootPassword: ${MONGODB_ROOT_PASSWORD}
  tag: "4.4.6-debian-10-r29"
  size: "8Gi"

helm repo add bitnami
helm repo update
helm upgrade --install mongodb bitnami/mongodb --version 10.21.1 -f mongodb.yml

You can get the connection string to connect to your mongodb cluster running:

echo mongodb://root:${MONGODB_ROOT_PASSWORD}@mongodb-0.mongodb-headless.default.svc.cluster.local:27017,mongodb-1.mongodb-headless.default.svc.cluster.local:27017

Please refer to the MongoDB official documentation for further information about setting up a production-grade MongoDB cluster.

We welcome contributions to improve this documentation. To submit a change, use the Edit link at the top of the page or email us at .