From 46b396c28495159e99abf3cb6d06ef43d56b80ff Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 25 Nov 2026 12:46:05 +0500 Subject: [PATCH] stand: deploy single-node ClickHouse with persistent storage --- clusters/stand/20-data/kustomization.yaml | 1 + .../clickhouse/stand/clickhouse.yaml | 65 +++++++++++++++++++ .../clickhouse/stand/databases.yaml | 8 +++ .../clickhouse/stand/kustomization.yaml | 6 ++ .../clickhouse/stand/namespace.yaml | 6 ++ 5 files changed, 86 insertions(+) create mode 100644 infrastructure/clickhouse/stand/clickhouse.yaml create mode 100644 infrastructure/clickhouse/stand/databases.yaml create mode 100644 infrastructure/clickhouse/stand/kustomization.yaml create mode 100644 infrastructure/clickhouse/stand/namespace.yaml diff --git a/clusters/stand/20-data/kustomization.yaml b/clusters/stand/20-data/kustomization.yaml index 77498c9..0306570 100644 --- a/clusters/stand/20-data/kustomization.yaml +++ b/clusters/stand/20-data/kustomization.yaml @@ -4,3 +4,4 @@ resources: - ../../../infrastructure/postgresql/contour-template - ../../../infrastructure/kafka/contour-template - ../../../infrastructure/rabbitmq/contour-template + - ../../../infrastructure/clickhouse/stand diff --git a/infrastructure/clickhouse/stand/clickhouse.yaml b/infrastructure/clickhouse/stand/clickhouse.yaml new file mode 100644 index 0000000..7f91ce6 --- /dev/null +++ b/infrastructure/clickhouse/stand/clickhouse.yaml @@ -0,0 +1,65 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: clickhouse + namespace: clickhouse +spec: + interval: 5m + timeout: 15m + chart: + spec: + chart: clickhouse-altinity + version: "0.2.1" + sourceRef: + kind: HelmRepository + name: yc-oci-charts + namespace: flux-system + interval: 10m + install: + crds: CreateReplace + remediation: + retries: 3 + upgrade: + crds: CreateReplace + remediation: + retries: 3 + values: + operator: + enabled: true + altinity-clickhouse-operator: + watchNamespaces: + - clickhouse + installations: + clickhouse-stand: + cluster: default + replicas: 1 + usersSecret: clickhouse-stand-users + initDatabases: true + admin: true + nodeSelector: + dedicated: generic + resources: + requests: + cpu: 250m + memory: 1Gi + limits: + memory: 3Gi + settings: + max_server_memory_usage: 2147483648 + max_thread_pool_size: 1000 + background_move_pool_size: 2 + background_schedule_pool_size: 16 + background_message_broker_schedule_pool_size: 4 + background_distributed_schedule_pool_size: 4 + storage: + size: 20Gi + storageClass: local-path + keeper: + enabled: false + users: + - name: stand + databases: + - values_db + settings: + max_memory_usage: "1073741824" + max_threads: "4" diff --git a/infrastructure/clickhouse/stand/databases.yaml b/infrastructure/clickhouse/stand/databases.yaml new file mode 100644 index 0000000..9ff2daf --- /dev/null +++ b/infrastructure/clickhouse/stand/databases.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: clickhouse-stand-databases + namespace: clickhouse +data: + databases.txt: | + values_db diff --git a/infrastructure/clickhouse/stand/kustomization.yaml b/infrastructure/clickhouse/stand/kustomization.yaml new file mode 100644 index 0000000..3d64966 --- /dev/null +++ b/infrastructure/clickhouse/stand/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - namespace.yaml + - clickhouse.yaml + - databases.yaml diff --git a/infrastructure/clickhouse/stand/namespace.yaml b/infrastructure/clickhouse/stand/namespace.yaml new file mode 100644 index 0000000..edb2f11 --- /dev/null +++ b/infrastructure/clickhouse/stand/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: clickhouse + labels: + istio-injection: disabled