documentdb
by QuenchWorks
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
| Key | Default | Notes |
|---|---|---|
image.repository | ghcr.io/quenchworks/images/documentdb | |
image.digest | (CI-written) | Required. Charts pin by digest, never a tag. |
auth.enabled | true | Mongo admin user is created on first boot. |
auth.username | default_user | DOCUMENTDB_USER. |
auth.password | "" | Generated into a Secret if empty. |
auth.existingSecret | "" | Use an existing Secret instead. |
primary.persistence.enabled | true | 8Gi PVC for PGDATA (/var/lib/postgresql/data). |
primary.shmVolume.enabled | true | Memory-backed /dev/shm for parallel queries. |
service.port | 10260 | MongoDB wire-protocol port. PostgreSQL (9712) is never exposed. |
networkPolicy.enabled | true | Restricts ingress to the release namespace, port 10260. |
podDisruptionBudget.enabled | true | minAvailable: 1. |
tls.enabled | false | The 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.enabled | false | request a cert-manager Certificate from tls.certManager.issuerRef (2nd choice) |
tls.selfSigned.validityDays | 365 | otherwise 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartdocumentdb is pinned at v0.0.23 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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