couchdb

by QuenchWorks

Helm chartv0.0.22App 3.5.2MITVerified publisher

Document database with an HTTP/JSON API and multi-master replication, designed for offline-first sync across nodes and devices. Hardened by QuenchWorks as a minimal, nonroot, CVE-gated image, cosign-signed and pinned by digest.

About this chart

Quenchworks CouchDB

Hardened Apache CouchDB 3.x on a minimal, nonroot, CVE-gated image pinned by digest. CouchDB is built from source on Wolfi onto the Erlang runtime. The JavaScript view server is the bundled QuickJS engine (no SpiderMonkey/mozjs, which removes that entire CVE surface). Fauxton (the web UI) and the docs are not bundled to keep Node and Python/Sphinx off the scan surface. The clustered HTTP API is served on port 5984. Single node by default.

Install

helm install db oci://ghcr.io/quenchworks/charts/couchdb

CouchDB 3.x refuses to start in admin-party mode, so an admin user is required. The admin password, the Erlang cookie and the cookie-auth secret are stored in a Secret (generated if you do not supply them, and preserved across upgrades). After the StatefulSet is ready, a post-install hook Job creates the system databases (_users, _replicator, _global_changes), which the image does not create on its own; a single-node CouchDB is not functional without them.

Connect

# admin password
kubectl get secret db-couchdb -o jsonpath="{.data.adminPassword}" | base64 -d

Create a database, put a document, and query a JavaScript map view (admin creds in $USER/$PASS):

HOST=http://db-couchdb:5984
curl -fsS "$HOST/"                                   # {"couchdb":"Welcome",...}
curl -fsS -u "$USER:$PASS" -X PUT "$HOST/demo"
curl -fsS -u "$USER:$PASS" -X PUT "$HOST/demo/doc1" \
  -H 'Content-Type: application/json' -d '{"name":"quench","n":7}'
curl -fsS -u "$USER:$PASS" -X PUT "$HOST/demo/_design/d" \
  -H 'Content-Type: application/json' \
  -d '{"views":{"by_name":{"map":"function(doc){ if(doc.name){ emit(doc.name, doc.n); } }"}}}'
curl -fsS -u "$USER:$PASS" "$HOST/demo/_design/d/_view/by_name"   # row from the JS view

Verify the image

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

Each image also ships an SPDX SBOM and SLSA build provenance as attestations. Verify them with the GitHub CLI:

gh attestation verify oci://ghcr.io/quenchworks/images/couchdb \
  --owner quenchworks

Values

KeyDefaultNotes
image.repositoryghcr.io/quenchworks/images/couchdb
image.digest(CI-written)Required. Charts pin by digest, never a tag.
replicaCount1Single node ([email protected]).
auth.usernameadminAdmin user; the image will not start without one.
auth.password(generated)24-char random if empty; stored in the Secret.
auth.erlangCookie(generated)32-char random if empty; shared cluster cookie.
auth.secret(generated)32-char random if empty; [chttpd_auth] secret.
auth.existingSecret""Use an existing Secret for the credentials.
systemDatabases.createtruePost-install hook Job creates _users/_replicator/_global_changes.
systemDatabases.image.*curlimages/curl:8.11.1Stock curl image for the init Job (runtime image has no HTTP client).
persistence.enabledtrue8Gi PVC at /var/lib/couchdb.
service.port5984Clustered HTTP API.
service.httpsPort6984HTTPS API, only with tls.enabled.
tls.enabledfalseHTTPS on httpsPort beside plain HTTP ([ssl] drop-in, cert at /tls).
tls.existingSecret""Use this kubernetes.io/tls Secret (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.
networkPolicy.enabledtrueRestricts HTTP ingress to the release namespace.
podDisruptionBudget.enabledtrueminAvailable: 1.
ingress.enabledfalseCreate an Ingress for this chart. HTTP only.
ingress.className""IngressClass to claim it. Empty leaves it unset, so the cluster default applies.
ingress.annotations{}Controller annotations (rewrite targets, body size, cert-manager issuer, ...).
ingress.servicePortnullBackend port. Unset resolves service.port, then service.ports.http / .https.
ingress.hosts[]e.g. [{host: app.example.com}]. A host with no paths gets a single / Prefix path.
ingress.tls[]Standard Ingress TLS list, e.g. [{hosts: [app.example.com], secretName: app-tls}].

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. All writable state (data dirs, the layered local.ini/local.d, and the Erlang cookie via HOME) lives on the writable /var/lib/couchdb volume; /tmp is an emptyDir. Credentials live in a Kubernetes Secret. The QuickJS view server means there is no SpiderMonkey/mozjs on the image. Readiness and liveness use the unauthenticated GET / welcome endpoint (/_up requires admin auth once an admin is set). Keep CouchDB behind the NetworkPolicy for internal use.

Notes

Single node by default ([email protected], no extra ports). The system-database Job is idempotent (it treats an "already exists" 412 as success), so it is safe on restarts and upgrades. Depends on the quench-common library chart, pulled from oci://ghcr.io/quenchworks/charts/quench-common.

Deploy couchdb with OpenTenant

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