From 59dd629b0e96a9b4dc6fd2a093afbffe1833a320 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Tue, 31 Mar 2026 17:31:17 +0200 Subject: [PATCH] fix: create cameleer database on ClickHouse startup ClickHouse only has the 'default' database out of the box. The JDBC URL connects to 'cameleer', so the database must exist before the server starts. Uses /docker-entrypoint-initdb.d/ init script via ConfigMap. Co-Authored-By: Claude Opus 4.6 (1M context) --- deploy/clickhouse.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deploy/clickhouse.yaml b/deploy/clickhouse.yaml index 861feff4..f9347556 100644 --- a/deploy/clickhouse.yaml +++ b/deploy/clickhouse.yaml @@ -25,6 +25,8 @@ spec: volumeMounts: - name: data mountPath: /var/lib/clickhouse + - name: initdb + mountPath: /docker-entrypoint-initdb.d resources: requests: memory: "2Gi" @@ -48,6 +50,10 @@ spec: periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 + volumes: + - name: initdb + configMap: + name: clickhouse-initdb volumeClaimTemplates: - metadata: name: data @@ -73,3 +79,12 @@ spec: - port: 9000 targetPort: 9000 name: native +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: clickhouse-initdb + namespace: cameleer +data: + 01-create-database.sql: | + CREATE DATABASE IF NOT EXISTS cameleer;