clickhouse

by QuenchWorks

Helm chartv0.0.48App 26.7.37.6MITVerified publisher

Column-oriented OLAP database for real-time analytical queries over very large datasets, with high ingest rates and fast aggregations. Hardened by QuenchWorks as a minimal, nonroot, CVE-gated image, cosign-signed and pinned by digest.

About this chart

Quenchworks ClickHouse

Hardened ClickHouse on a minimal, nonroot, CVE-gated image pinned by digest. Ships ClickHouse's own official self-contained static binary (the multi-call clickhouse: server/client/keeper/local), hardened on Wolfi and gated CVE-gated with Trivy. The HTTP API is served on port 8123 and the native TCP protocol on 9000. Single node.

Install

helm install ch oci://ghcr.io/quenchworks/charts/clickhouse

On first boot the entrypoint seeds a writable config dir from the upstream defaults and writes a users.d/ drop-in for the configured user. The password is stored as a sha256 hash (never plaintext) and lives in a Kubernetes Secret (generated if you do not supply one).

Connect

PASSWORD="$(kubectl get secret ch-clickhouse -o jsonpath='{.data.admin-password}' | base64 -d)"
HOST=http://ch-clickhouse:8123

curl -fsS "$HOST/ping"                                  # -> Ok.
curl -fsS "$HOST/?user=default&password=$PASSWORD" --data-binary 'SELECT version()'

curl -fsS "$HOST/?user=default&password=$PASSWORD" \
  --data-binary 'CREATE TABLE IF NOT EXISTS demo (id UInt32, name String) ENGINE = MergeTree ORDER BY id'
curl -fsS "$HOST/?user=default&password=$PASSWORD" --data-binary "INSERT INTO demo VALUES (1, 'quench')"
curl -fsS "$HOST/?user=default&password=$PASSWORD" --data-binary 'SELECT name FROM demo WHERE id = 1'

Verify the image

cosign verify ghcr.io/quenchworks/images/clickhouse \
  --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/clickhouse \
  --owner quenchworks

Values

KeyDefaultNotes
image.repositoryghcr.io/quenchworks/images/clickhouse
image.digest(CI-written)Required. Charts pin by digest, never a tag.
replicaCount1Single node.
auth.usernamedefaultFirst-run user.
auth.password(generated)24-char random if empty; stored (sha256) in the Secret.
auth.database""Optional initial database created on first boot.
auth.defaultAccessManagementtrueEnable SQL-driven access management for the user.
auth.existingSecret""Use an existing Secret for the password.
persistence.enabledtrue8Gi PVC at /var/lib/clickhouse.
service.httpPort8123HTTP API (primary client/service port).
service.nativePort9000Native TCP protocol.
service.httpsPort8443HTTPS, only with tls.enabled.
service.nativeTlsPort9440Native protocol over TLS, only with tls.enabled.
tls.enabledfalseHTTPS and native TLS beside the plain ports (a config.d drop-in copied by an initContainer; 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 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. The data lives on the writable /var/lib/clickhouse volume; the config dir /etc/clickhouse-server (regenerated from env each boot), the logs at /var/log/clickhouse-server, and /tmp are emptyDir. The password lives in a Kubernetes Secret. Keep ClickHouse behind the NetworkPolicy for internal use.

Notes

Single node. Clustering uses ClickHouse Keeper / ZooKeeper and is a follow-up (not implemented in this chart). The config dir is regenerated from env on every boot, so credential and bind changes apply on restart; the data dir persists. Depends on the quench-common library chart, pulled from oci://ghcr.io/quenchworks/charts/quench-common.

Deploy clickhouse with OpenTenant

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