clickhouse-operator

by QuenchWorks

Helm chartv0.0.3App 0.27.4Apache-2.0Verified publisher

Altinity ClickHouse Operator: run ClickHouse installations and ClickHouse Keeper from Kubernetes custom resources, with sharding, replication, schema propagation and rolling upgrades. The four CRDs and upstream's default operator and ClickHouse configuration ship with the chart. Hardened by QuenchWorks: the operator and metrics exporter are built from source, nonroot, CVE-gated, cosign-signed and pinned by digest.

About this chart

Quenchworks clickhouse-operator

The Altinity ClickHouse Operator 0.27.4 on QuenchWorks images (built from source, nonroot, CVE-gated at build, pinned by digest, cosign-signed). It runs ClickHouse installations and ClickHouse Keeper from Kubernetes resources: shards and replicas as StatefulSets, schema propagation to new replicas, rolling configuration changes and upgrades.

The chart installs the four CRDs (ClickHouseInstallation, ClickHouseInstallationTemplate, ClickHouseOperatorConfiguration, ClickHouseKeeperInstallation), the operator with its metrics exporter, upstream's RBAC, and upstream's default operator and ClickHouse/Keeper configuration, all from the release tag's install bundle.

Install

helm install clickhouse-operator oci://ghcr.io/quenchworks/charts/clickhouse-operator -n clickhouse --create-namespace

Then a one-node ClickHouse:

apiVersion: clickhouse.altinity.com/v1
kind: ClickHouseInstallation
metadata: { name: main }
spec:
  configuration:
    clusters: [{ name: main, layout: { shardsCount: 1, replicasCount: 1 } }]

Values

KeyDefaultNotes
watchNamespaces[]WATCH_NAMESPACES (names or regexps); empty watches every namespace
metricsExporter.enabledtruePrometheus metrics for every managed ClickHouse on port 8888
metricsExporter.imageour imagepinned by digest
rbac.createtrueupstream's ClusterRole and Role

The operator's own metrics are on port 9999; Service <release>-clickhouse-operator-metrics exposes both ports.

Notes

  • ClickHouse pods run upstream's clickhouse/clickhouse-server image unless a podTemplate sets one. The default is compiled into the operator, so the chart cannot change it. Only the operator and the metrics exporter are QuenchWorks images in this release.
  • The operator logs in to every ClickHouse it manages as clickhouse_operator. Upstream ships a fixed password for that user; this chart generates one into Secret clickhouse-operator on first install and keeps it. The name is fixed by the operator's configuration, so run one operator per namespace.
  • To change the operator configuration, edit the files/ tree in a fork of this chart, or apply a ClickHouseOperatorConfiguration resource.
  • Helm installs the CRDs on first install and never upgrades or deletes them. Apply the new crds/crds.yaml yourself before upgrading across operator releases.

Deploy clickhouse-operator with OpenTenant

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