cratedb
by QuenchWorks
CrateDB, the distributed SQL database for time series, logs and full-text search, as a StatefulSet with a PVC per node: PostgreSQL wire protocol and an HTTP SQL endpoint, one node or a cluster. Hardened by QuenchWorks, nonroot, CVE-gated, cosign-signed and pinned by digest.
About this chart
CrateDB
CrateDB is a distributed SQL database built on Lucene for time series, logs, geospatial and full-text search. Clients talk to it over the PostgreSQL wire protocol or an HTTP SQL endpoint. This chart runs it on the QuenchWorks cratedb image: the official distribution on a Wolfi Java 25 runtime, nonroot, read-only root filesystem, 0 fixable CVEs, cosign-signed and pinned by digest.
Install
helm install crate oci://ghcr.io/quenchworks/charts/cratedb
CrateDB's host-based auth trusts the crate superuser from local connections only, and a
kubectl port-forward counts as local. Create an application user through one, then
connect over the PostgreSQL protocol with it:
kubectl port-forward crate-cratedb-0 4200 &
curl -s -H 'Content-Type: application/json' localhost:4200/_sql \
-d "{\"stmt\":\"CREATE USER app WITH (password = 'change-me')\"}"
curl -s -H 'Content-Type: application/json' localhost:4200/_sql -d '{"stmt":"GRANT ALL TO app"}'
psql -h crate-cratedb -p 5432 -U app doc
Nodes
replicas: 1 runs a single node (discovery.type=single-node, which also skips the
production bootstrap checks). More replicas form a cluster over the headless Service with
the pods as initial master nodes. A cluster enforces the bootstrap checks, so every
Kubernetes node that runs CrateDB needs vm.max_map_count >= 262144; this chart does not
set that sysctl, because it would need a privileged container.
Values
| Key | Default | Meaning |
|---|---|---|
replicas | 1 | nodes; > 1 forms a cluster |
extraArgs | [] | extra -C<setting>=<value> flags |
extraEnv | [] | e.g. JDK_JAVA_OPTIONS to override the heap (default 50% of the limit) |
persistence.* | 16Gi PVC per node | data under /data |
service.httpPort / service.pgPort | 4200 / 5432 | HTTP SQL and PostgreSQL protocol |
tls.enabled | false | HTTPS only on 4200; PostgreSQL SSL with password logins required to use it (PKCS12 from an openssl init container) |
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 |
openssl.digest | (pinned) | init container that builds the PKCS12 keystore |
Probes are TCP: an HTTP probe from the kubelet is not a local connection and would be asked for a password.
The release gate installs one node on kind, creates a password user through a
port-forward, writes a table, reads it back over the PostgreSQL protocol with psql from
another pod (and requires a wrong password to be refused), deletes the pod, and requires
the rows back.
The chart depends on the quench-common chart from oci://ghcr.io/quenchworks/charts.
Deploy cratedb with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cratedb 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 chartcratedb is pinned at v0.0.15 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