Large Cluster Configmap Limits
Hi All, I recently hit an issue where I was trying to provision a large Clickhouse cluster (1000 shards) and hit a limit on the amount of nodes that could exist in the relevant configmap. After 807 nodes are provisioned the configmap is larger than 1MB in size which is a hard limit in K8S/etcd. I am wondering if there is a workaround or ideas on how to partition the config maps appropriately to work around this issue.
I looked into this issue and it seems the failure occurs because the remote_servers topology for very large CHIs ends up exceeding Kubernetes' ConfigMap size limits (~1 MiB enforced by the API server/etcd).
The idea is to split the generated remote_servers configuration into deterministic fragments instead of storing the entire topology in a single ConfigMap. Each fragment would correspond to a shard range within a cluster, producing multiple ConfigMaps like:
chi-<chi>-<cluster>-remote-servers-shard-<startShard>
Each fragment would contain a file such as
chop-generated-remote_servers-part-<startShard>.xml mounted into /etc/clickhouse-server/config.d/.
Since ClickHouse merges all XML files under config.d, this should behave identically from the server’s perspective while keeping each ConfigMap well below the 1 MiB limit.
Fragments would be built per cluster by grouping shards sequentially until a configurable size threshold is reached. The fragment identity would be based on (clusterName, shardStart) so resource names remain deterministic across reconciliations. We could also add a hash annotation on the StatefulSet template so pods roll when the fragment layout changes.
If this direction sounds reasonable, I can start working on a PR for it.