Skip to content

Commit 03477ab

Browse files
committed
fix(hosting): derive the docker clickhouse url username from CLICKHOUSE_USER
The bundled ClickHouse creates only the user named by CLICKHOUSE_USER (the official image removes the built-in default user when it differs), but the webapp CLICKHOUSE_URL and RUN_REPLICATION_CLICKHOUSE_URL hardcoded 'default', so a custom CLICKHOUSE_USER left the app unable to authenticate while the healthcheck (which already honours the var) stayed green. Derive the username in both URLs from CLICKHOUSE_USER. Also document, for the Helm chart, that inline external ClickHouse credentials are now percent-encoded (store the raw value), and that existingClaim should be pinned once a bitnami volume is adopted so client-side renders stay deterministic.
1 parent f95ad01 commit 03477ab

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

docs/self-hosting/kubernetes.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ redis:
334334
(`data-<release>-clickhouse-shard0-0`) to keep your data — auto-detection can't run there, and
335335
skipping this starts ClickHouse on a fresh empty volume. If that happened, your old data is
336336
still on the old PVC: delete the ClickHouse StatefulSet with `--cascade=orphan` (its volume
337-
configuration is immutable), set `existingClaim`, and sync again.
337+
configuration is immutable), set `existingClaim`, and sync again. If you render without cluster
338+
access, pin `clickhouse.persistence.existingClaim` for good once the volume is adopted: a later
339+
render where the lookup can't see the PVC would otherwise try to re-add `volumeClaimTemplates`,
340+
which the API server rejects on an existing StatefulSet.
338341
</Note>
339342

340343
<Note>
@@ -364,6 +367,13 @@ clickhouse:
364367
password: "my-password"
365368
```
366369

370+
<Note>
371+
An inline external `username`/`password` is percent-encoded into the connection URL for you, so
372+
store the **raw** value - special characters like `@ : / %` are handled automatically. If you
373+
previously percent-encoded the password by hand to work around this, switch back to the raw value.
374+
(Credentials from `existingSecret` are injected at runtime and are unaffected.)
375+
</Note>
376+
367377
**Using existing secrets (recommended):**
368378

369379
```yaml

hosting/docker/webapp/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ services:
8080
TRIGGER_BOOTSTRAP_WORKER_GROUP_NAME: bootstrap
8181
TRIGGER_BOOTSTRAP_WORKER_TOKEN_PATH: /home/node/shared/worker_token
8282
# ClickHouse configuration
83-
CLICKHOUSE_URL: ${CLICKHOUSE_URL:-http://default:${CLICKHOUSE_PASSWORD}@clickhouse:8123?secure=false}
83+
CLICKHOUSE_URL: ${CLICKHOUSE_URL:-http://${CLICKHOUSE_USER:-default}:${CLICKHOUSE_PASSWORD}@clickhouse:8123?secure=false}
8484
CLICKHOUSE_LOG_LEVEL: ${CLICKHOUSE_LOG_LEVEL:-info}
8585
# Run replication
8686
RUN_REPLICATION_ENABLED: ${RUN_REPLICATION_ENABLED:-1}
87-
RUN_REPLICATION_CLICKHOUSE_URL: ${RUN_REPLICATION_CLICKHOUSE_URL:-http://default:${CLICKHOUSE_PASSWORD}@clickhouse:8123}
87+
RUN_REPLICATION_CLICKHOUSE_URL: ${RUN_REPLICATION_CLICKHOUSE_URL:-http://${CLICKHOUSE_USER:-default}:${CLICKHOUSE_PASSWORD}@clickhouse:8123}
8888
RUN_REPLICATION_LOG_LEVEL: ${RUN_REPLICATION_LOG_LEVEL:-info}
8989
# Limits
9090
# TASK_PAYLOAD_OFFLOAD_THRESHOLD: 524288 # 512KB

0 commit comments

Comments
 (0)