Architecture

Alauda Data Services Analytical Database E1 is a single-Deployment operator that turns a ClickHouseInstallation (CHI) into a set of standard Kubernetes workload objects, and a ClickHouseKeeperInstallation (CHK) into the ClickHouse Keeper quorum that replicated clusters coordinate through. Nothing in the data path is custom: every ClickHouse® server instance is an ordinary Pod inside an ordinary StatefulSet.

The operator Deployment

One Deployment named clickhouse-operator in namespace operators, replicas: 1, with two containers:

ContainerBinaryRole
clickhouse-operatorcmd/operatorWatches the four CRDs and reconciles Kubernetes objects
metrics-exportercmd/metrics_exporterScrapes each ClickHouse® host and re-exposes Prometheus metrics

Pod and Service selector is the bare label app=clickhouse-operator, not app.kubernetes.io/name.

Which namespaces the operator reconciles is decided by its OperatorGroup at install time, through the WATCH_NAMESPACE environment variable. Installed for all namespaces, it reconciles a ClickHouseInstallation wherever it is created. Installed into a single namespace, it reconciles only that namespace — a ClickHouseInstallation created anywhere else is silently ignored: no error, no events, no status. If a new cluster never progresses, check the install mode before anything else.

Five ConfigMaps are mounted under /etc/clickhouse-operator (files, conf.d, config.d, templates.d, users.d) and supply the operator's own configuration and the baseline ClickHouse® config fragments.

Custom resources

KindShort nameAPI groupWhat the operator builds from it
ClickHouseInstallationchiclickhouse.altinity.com/v1One StatefulSet, one Service and one set of ConfigMaps per ClickHouse host, plus the instance Services
ClickHouseInstallationTemplatechitclickhouse.altinity.com/v1Nothing on its own; its content is merged into the instances that use it
ClickHouseOperatorConfigurationchopconfclickhouse.altinity.com/v1Nothing on its own; it changes the operator's behaviour
ClickHouseKeeperInstallationchkclickhouse-keeper.altinity.com/v1One StatefulSet and Service per Keeper member, a client Service and a PodDisruptionBudget

A ClickHouseInstallation that names a ClickHouseKeeperInstallation in spec.configuration.zookeeper.keeper waits until that quorum is ready, then writes the address of each Keeper member into the ClickHouse® configuration. The Keeper pods run the same server image as the ClickHouse® pods, so the quorum adds no image to the product.

Object graph


ClickHouse is a registered trademark of ClickHouse, Inc. https://clickhouse.com

Alauda is an independent vendor. This product is not affiliated with, endorsed by, or sponsored by ClickHouse, Inc. All trademarks are the property of their respective owners and are used here for identification purposes only.