documentdb

by QuenchWorks

Helm chartv0.0.23App 0.114.0MITVerified publisher

Self-contained MongoDB-compatible server bundling PostgreSQL, the DocumentDB extension, and a wire gateway. Hardened by QuenchWorks as a minimal, nonroot, CVE-gated image, cosign-signed and pinned by digest.

About this chart

Quenchworks DocumentDB

A self-contained MongoDB-compatible server: PostgreSQL 17, the DocumentDB extension, and the Rust pg_documentdb_gw gateway, all in one nonroot, CVE-gated container pinned by digest. A mongo client connects directly to it, with no FerretDB and no separate backend.

On first boot the image runs initdb, CREATE EXTENSION documentdb CASCADE, and creates the Mongo admin user via documentdb_api.create_user. Clients then speak the MongoDB wire protocol on port 10260 and authenticate with SCRAM-SHA-256.

Install

helm install docdb oci://ghcr.io/quenchworks/charts/documentdb \
  --set auth.password='change-me'

A password is generated into a Secret if you do not set one.

Connect

The gateway enforces TLS with an auto-generated self-signed certificate, so clients must pass tls=true&tlsAllowInvalidCertificates=true.

PW=$(kubectl get secret docdb-documentdb -o jsonpath='{.data.documentdb-password}' | base64 -d)
mongosh "mongodb://default_user:${PW}@docdb-documentdb:10260/?tls=true&tlsAllowInvalidCertificates=true&authMechanism=SCRAM-SHA-256"

Verify the image

cosign verify ghcr.io/quenchworks/images/documentdb \
  --certificate-identity-regexp 'https://github.com/quenchworks/.+' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Each build also ships an SPDX SBOM and SLSA provenance attestation. Verify them with gh attestation verify oci://ghcr.io/quenchworks/images/documentdb --owner quenchworks.

Values

KeyDefaultNotes
image.repositoryghcr.io/quenchworks/images/documentdb
image.digest(CI-written)Required. Charts pin by digest, never a tag.
auth.enabledtrueMongo admin user is created on first boot.
auth.usernamedefault_userDOCUMENTDB_USER.
auth.password""Generated into a Secret if empty.
auth.existingSecret""Use an existing Secret instead.
primary.persistence.enabledtrue8Gi PVC for PGDATA (/var/lib/postgresql/data).
primary.shmVolume.enabledtrueMemory-backed /dev/shm for parallel queries.
service.port10260MongoDB wire-protocol port. PostgreSQL (9712) is never exposed.
networkPolicy.enabledtrueRestricts ingress to the release namespace, port 10260.
podDisruptionBudget.enabledtrueminAvailable: 1.
tls.enabledfalseThe gateway serves the chart certificate (verifiable) instead of its self-signed one
tls.existingSecret""a kubernetes.io/tls Secret to use (1st choice)
tls.certManager.enabledfalserequest a cert-manager Certificate from tls.certManager.issuerRef (2nd choice)
tls.selfSigned.validityDays365otherwise Helm generates a CA + certificate, kept across upgrades

Plus the shared quench-common knobs (scheduling, probes, sidecars, extra env/volumes, security contexts).

Security

Runs nonroot (uid 1001) on a read-only root filesystem with all capabilities dropped. PGDATA, the socket dir (/var/run/postgresql), the gateway runtime dir (/var/lib/documentdb/gateway), /tmp, and /dev/shm are the only writable mounts.

Notes

Single primary. The gateway's TLS cert is self-signed and auto-generated on first start (PemAutoGenerated); templating operator-supplied certificates is a tracked follow-up. Streaming replication is a tracked follow-up. Depends on the quench-common library chart, pulled from oci://ghcr.io/quenchworks/charts/quench-common.

Deploy documentdb with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has documentdb 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 chartdocumentdb is pinned at v0.0.23 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