cube

by QuenchWorks

Helm chartv0.0.3App 1.8.21Apache-2.0Verified publisher

Cube, the semantic layer server: REST, GraphQL and a Postgres-protocol SQL API over your database, driven by a data model. Hardened by QuenchWorks: built from source (native addon with cargo auditable), nonroot, CVE-gated, cosign-signed and pinned by digest.

About this chart

Quenchworks Cube

Hardened Cube, the semantic layer server: a data model over your database, served as REST, GraphQL and a Postgres-protocol SQL API that BI tools connect to. One Deployment serves the API on port 4000 and the SQL API on 15432.

The image is built from the upstream release tag: the npm server with the postgres, mysql and clickhouse drivers on Node 24, and the native addon (which carries the SQL API) compiled from source with cargo auditable, so the scanner sees every Rust crate in it. It runs as nonroot uid 1001, is CVE-gated (the build fails on any fixable CVE), and is cosign-signed and pinned by digest. It does not include Cube Store.

Install

helm install bi oci://ghcr.io/quenchworks/charts/cube \
  --set database.host=my-postgres --set database.name=analytics \
  --set database.user=cube --set database.existingSecret=my-postgres-secret \
  --set-file model.orders\\.yml=orders.yml
kubectl port-forward svc/bi-cube 4000:4000 15432:15432

Clients call the REST API with a JWT signed (HS256) by the API secret:

kubectl get secret bi-cube -o jsonpath='{.data.api-secret}' | base64 -d; echo

BI tools connect to the SQL API as cube with the generated password (key sql-password).

Verify the image

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

gh attestation verify oci://ghcr.io/quenchworks/images/cube@<digest> --owner quenchworks

Values

KeyDefaultDescription
image.repositoryghcr.io/quenchworks/images/cube
image.digest(CI-maintained)Pinned image digest; never a tag.
replicaCount1API pods; stateless.
database.typepostgrespostgres, mysql or clickhouse (the drivers in the image).
database.host / port / name / user""Connection settings.
database.existingSecret / existingSecretPasswordKey"" / passwordSecret holding the database password.
database.password""Plain password, stored in the chart's Secret (prefer existingSecret).
database.sslfalseTLS to the database.
auth.apiSecret""JWT signing secret. Empty: generated and kept across upgrades.
auth.existingSecret""Secret with keys api-secret and sql-password.
sqlApi.enabled / port / user / passwordtrue / 15432 / cube / ""Postgres-protocol SQL API; empty password is generated.
cubestore.host""Cube Store host for shared cache, queue and pre-aggregations. Empty: in-memory per pod.
model{}Data model files (file name to YAML), mounted at /cube/conf/model.
service.type / service.portClusterIP / 4000
ingress.enabledfalseOptional Ingress for the API.
networkPolicy.enabled / networkPolicy.allowExternaltrue / trueIngress to the API ports; allowExternal=false confines it to the namespace.
resources100m / 256Mi requests, 2 CPU / 1Gi limits

The common QuenchWorks knobs (podLabels, nodeSelector, tolerations, extraEnvVars, extraVolumes, security-context overrides, probe overrides) work as in every QuenchWorks chart. Any other Cube setting is a CUBEJS_* variable in extraEnvVars.

Design

  • In-memory cache by default. The image runs with NODE_ENV=production, where Cube expects a Cube Store and fails queries without one; the chart sets CUBEJS_CACHE_AND_QUEUE_DRIVER=memory unless cubestore.host is set.
  • Readiness is the database. /readyz tests the database connection and the cache driver, so a pod is Ready only when Cube can query; /livez needs no database.
  • One mount per model file. Each model key is a subPath mount: a whole-ConfigMap mount also exposes the kubelet's ..data copies, which Cube's recursive loader reads as duplicate cubes. subPath mounts do not live-update, so the pod template carries a checksum of model and a change rolls the pods.
  • Read-only root filesystem. The model is a ConfigMap; scratch space is an emptyDir at /tmp.
  • Secrets survive upgrades. The generated API secret and SQL password are read back from the existing Secret, so an upgrade does not invalidate issued JWTs or BI connections.

Cube is Apache-2.0 licensed.

Deploy cube with OpenTenant

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