The managed-clickhouse module manages instances of ClickHouse in Deckhouse Platform (DP). ClickHouse is a high-performance Open Source columnar DBMS designed for online analytical processing (OLAP) of large volumes of data in real time. The module provides:

  • Automatic Deployment: Creates a ClickHouse instance using a simple YAML configuration.
  • Standalone: Supports deployment of a standalone instance.
  • Configuration Management: Separate ClickhouseClass resource for templating service creation and flexible validation of user parameters.
  • Status: Displays the current status of the deployed ClickHouse instance.

For more details about module settings and usage examples, refer to the module documentation.

Module architecture

The following assumptions are used to simplify the diagram:

  • The diagram shows direct communication between containers in different Pods. In practice, components communicate through Kubernetes Services (internal load balancers). Service names are omitted when obvious from context. In other cases, a service name is shown above the arrow.
  • Pods can run with multiple replicas, but only one replica of each Pod is shown in the diagram.

The level-2 C4 architecture of the managed-clickhouse module and its interactions with other components of DP are shown in the following diagram:

Managed-clickhouse module architecture

Module components

The module consists of the following components:

  1. Managed-clickhouse-operator (Deployment): Kubernetes operator consisting of a single container manager that performs the following operations:

    • Reconciles Clickhouse custom resources in all user namespaces. The Clickhouse and ClickhouseClass custom resources define the settings of the ClickHouse instance.

    • Creates and manages the Certificate custom resource and StatefulSet, Secret, Service, ConfigMap, and PersistentVolumeClaim resources related to the ClickHouse instance.

    • Validates and mutates Clickhouse custom resources using the Validating/Mutating Admission Controllers mechanism.

  2. D8ms-ch-<INSTANCE_NAME> (StatefulSet): A component consisting of a single clickhouse container that starts and runs the ClickHouse instance. It is created by the managed-clickhouse-operator component for each Clickhouse custom resource.

Module interactions

The module interacts with the kube-apiserver component:

  • Manages Clickhouse and Certificate custom resources.
  • Watches ClickhouseClass custom resources.
  • Manages StatefulSet, Secret, Service, ConfigMap, and PersistentVolumeClaim resources.

The following external components interact with the module:

  1. Kube-apiserver: Validates and mutates Clickhouse custom resources.

  2. User applications: Send requests to the ClickHouse instance.

Additional resources