fix(clickhouse): load profile settings via users.d in customConfig#290
Merged
Conversation
customConfig was mounted only into /etc/clickhouse-server/config.d/, which ClickHouse uses for server-level settings. Profile/user settings (e.g. max_memory_usage, max_bytes_before_external_group_by, max_bytes_before_external_sort) are read only from the users config tree (users.d), so a <profiles> block placed in customConfig was silently ignored. Mount the same customConfig file into /etc/clickhouse-server/users.d/ as well, so ClickHouse picks up server settings from config.d and profile settings from users.d. Each tree ignores the sections it does not own, so a single document can carry both. No change to deploy values is required. Verified on minikube with the official clickhouse/clickhouse-server:25.3 image: server and profile settings both load (changed=1), the pod starts with 0 restarts, no config errors, and the limits apply to non-default service users (e.g. aggregator_*) created without an explicit settings profile, since they inherit the server default_profile.
arunesh-j
previously requested changes
Jun 17, 2026
arunesh-j
left a comment
Contributor
There was a problem hiding this comment.
Update to a newer version and package it ..
Contributor
Author
|
Done @arunesh-j — bumped the chart to v0.0.3 and packaged it the same way as the last release (#289):
|
c2f46ee to
e30a792
Compare
aryanmehrotra
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
customConfigin the ClickHouse chart was mounted only into/etc/clickhouse-server/config.d/. ClickHouse reads server-level settings fromconfig.d, but profile/user settings are read only from the users config tree (users.d). So a<profiles>block placed incustomConfigwas silently ignored — no error, no warning, just no effect.Observed live on the
zopnightrelease:max_server_memory_usage_to_ram_ratio(server-level) applied correctly, butmax_memory_usage,max_bytes_before_external_group_by, andmax_bytes_before_external_sort(profile-level) never loaded (changed=0,defaultprofile empty). This contributed to ClickHouse OOMs (code 241) on heavy aggregation queries, since the intended per-query cap and spill-to-disk thresholds were never in effect.This is standard ClickHouse behavior on the official image (not a Bitnami/chart quirk) —
config.dandusers.dare separate trees read by different parts of the server.Fix
Mount the same
customConfigdocument into both trees:/etc/clickhouse-server/config.d/custom.xml— server-level settings/etc/clickhouse-server/users.d/custom.xml— profile/user settingsClickHouse reads the relevant sections from each tree and ignores the rest, so a single document can carry both. No change to deploy values is required — existing
customConfigblobs start working after ahelm upgrade.Verification (minikube, official
clickhouse/clickhouse-server:25.3)customConfig→ no ConfigMap/mounts; server-only / profiles-only / mixed → both mounts render.Running 1/1, 0 restarts; no config-related errors/warnings in logs.max_server_memory_usage_to_ram_ratio=0.9→changed=1.max_memory_usage=1.5G,max_bytes_before_external_group_by=750M,max_bytes_before_external_sort=750M→ allchanged=1;defaultprofile populated; enforced viagetSetting().aggregator_tpbhexactly as the chart does (SQLCREATE USER, no settings profile) and confirmed it inherits all three limits via the serverdefault_profile.Changes
templates/statefulset.yaml— addusers.d/custom.xmlmount of the existingcustom-configConfigMap.values.yaml— document both mount paths in thecustomConfigcomment.README.md— document dual-mount behavior with example.🤖 Generated with Claude Code