Nomploy Nomad Packs

← All packs

ferretdb v0.1.0

Databases

FerretDB — an open-source (Apache-2.0) MongoDB-compatible database built on PostgreSQL, a drop-in for apps using the MongoDB wire protocol without the SSPL licensing. Deployed all-in-one with its DocumentDB-enabled PostgreSQL in a single host-networked Nomad job.

nomad-pack run ferretdb --registry nomploy
2 tasks mongo 27017db 5432 1 volume image ghcr.io/ferretdb/ferretdb:2
Variables 13
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run ferretdb -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "ferretdb"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The FerretDB image (v2). Pin a tag in production.
image = "ghcr.io/ferretdb/ferretdb:2"

# Host port for the MongoDB wire protocol — point your Mongo client/driver here.
port = 27017

# The DocumentDB-enabled PostgreSQL image FerretDB v2 requires. Keep the major (17/16/15) matched to a tested FerretDB version; pin a full tag in production.
postgres_image = "ghcr.io/ferretdb/postgres-documentdb:17"

# Host port PostgreSQL listens on. FerretDB connects on 127.0.0.1.
db_port = 5432

# PostgreSQL user FerretDB connects as — this is also the MongoDB username your clients use.
db_user = "ferretdb"

# Password for db_user (also the MongoDB password). CHANGE THIS.
db_password = "ferretdb"

# Docker named volume for the Postgres data dir (all your documents). A fresh volume inherits the image's data-dir ownership. Back it up.
db_data_volume = "ferretdb_db_data"

# Resources for the FerretDB task.
ferretdb_resources = {
    cpu    = 500
    memory = 512
  }

# Resources for the PostgreSQL (DocumentDB) task.
postgres_resources = {
    cpu    = 1000
    memory = 1024
  }

# Placement constraints — pin the job to one node so the Postgres local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
NameTypeDefaultDescription
job_name string
"ferretdb"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"ghcr.io/ferretdb/ferretdb:2"
The FerretDB image (v2). Pin a tag in production.
port number
27017
Host port for the MongoDB wire protocol — point your Mongo client/driver here.
postgres_image string
"ghcr.io/ferretdb/postgres-documentdb:17"
The DocumentDB-enabled PostgreSQL image FerretDB v2 requires. Keep the major (17/16/15) matched to a tested FerretDB version; pin a full tag in production.
db_port number
5432
Host port PostgreSQL listens on. FerretDB connects on 127.0.0.1.
db_user string
"ferretdb"
PostgreSQL user FerretDB connects as — this is also the MongoDB username your clients use.
db_password key string
"ferretdb"
Password for db_user (also the MongoDB password). CHANGE THIS.
db_data_volume string
"ferretdb_db_data"
Docker named volume for the Postgres data dir (all your documents). A fresh volume inherits the image's data-dir ownership. Back it up.
ferretdb_resources object
{
    cpu    = 500
    memory = 512
  }
Resources for the FerretDB task.
postgres_resources object
{
    cpu    = 1000
    memory = 1024
  }
Resources for the PostgreSQL (DocumentDB) task.
constraints list
[]
Placement constraints — pin the job to one node so the Postgres local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
Readme

ferretdb

FerretDB — an open-source, Apache-2.0 database that speaks the MongoDB wire protocol, built on PostgreSQL. A drop-in for apps and tools that use MongoDB drivers, without MongoDB's SSPL license. All-in-one: FerretDB v2 plus its required DocumentDB-enabled PostgreSQL in a single host-networked Nomad job (Postgres as a prestart sidecar). FerretDB is stateless — all data lives in Postgres.

Usage

nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run ferretdb --registry nomploy --var db_password=<secret>

In nomploy: create a Compose service, type Nomad Pack, pack ferretdb, set db_password, then Deploy.

Connect any MongoDB client/driver:

mongodb://ferretdb:<db_password>@<node-ip>:27017/

Key variables

Variable Default Notes
image ghcr.io/ferretdb/ferretdb:2 FerretDB v2. Pin a full tag in production.
postgres_image ghcr.io/ferretdb/postgres-documentdb:17 Required DocumentDB image; keep the major matched to a tested FerretDB version.
port 27017 MongoDB wire protocol.
db_user / db_password ferretdb / ferretdb Also the Mongo username/password. Change the password.
db_data_volume ferretdb_db_data All documents. Back it up.
db_port 5432 Bundled Postgres host port.
constraints [] Pin to a node so the volume stays put.

Per-task resources: ferretdb_resources, postgres_resources.

Notes