fix: emit CH_* ClickHouse connection keys in the clickhouse chart#289
Conversation
The per-service connection ConfigMap/Secret used MySQL-style DB_* keys, which GoFr's ClickHouse datasource doesn't read, so apps couldn't connect. Switch to the keys GoFr documents (https://gofr.dev/docs/datasources/clickhouse): - ConfigMap: HOSTS (host:port, native 9000), USERNAME, DATABASE. - Secret: PASSWORD, USERNAME (USERNAME kept here too so the generated credentials survive helm upgrade via lookup). - README Connection Config updated; bump chart to v0.0.2 + re-index.
…name The upgrade-preservation lookup only read the new USERNAME/PASSWORD keys, so upgrading a release that still had the old DB_USER/DB_PASSWORD secret keys would miss them and regenerate credentials (rotating the password and orphaning the existing ClickHouse user). Fall back to the legacy DB_* keys so the rename preserves existing credentials. Re-package + re-index.
|
Added upgrade-safety in Verified on minikube: installed published v0.0.1 (DB_* keys) → upgraded to this v0.0.2 → same user/password preserved and the original user still authenticates ( |
USERNAME is not sensitive, so it belongs in the connection ConfigMap; the Secret now holds only PASSWORD. Upgrade-preservation reads the username back from the existing ConfigMap and the password from the existing Secret, so credentials stay stable across upgrades. Drops the earlier legacy-key fallback. Re-package + re-index.
Emit the CH_* keys the consuming service reads: CH_HOST + CH_PORT (the app combines them into GoFr's ClickHouse Hosts), CH_USER, CH_DATABASE in the ConfigMap and CH_PASSWORD in the Secret. Upgrade-preservation reads CH_USER from the ConfigMap and CH_PASSWORD from the Secret. README + re-package + re-index.
arunesh-j
left a comment
There was a problem hiding this comment.
LGTM ✅
Fixes the connection-key mismatch from v0.0.1 (emitted MySQL-style DB_* keys that the consuming ClickHouse service doesn't read):
- ConfigMap now emits
CH_HOST/CH_PORT/CH_USER/CH_DATABASE; Secret emitsCH_PASSWORD. No lingeringDB_*refs. - Upgrade-preservation is correct for the new layout:
CH_USERread back from the existing ConfigMap (plaintext),CH_PASSWORDfrom the existing Secret (b64dec); init SQL uses the same$username/$password. - Object names are unchanged, so the #288
envFromwiring keeps working. helm lintpasses; version bumped0.0.1 → 0.0.2; packaging correct (docs/clickhouse-v0.0.2.tgzdigest matchesindex.yaml:2681560f…).
Note (non-blocking): the CH_* names are a contract with the consuming service code (outside this repo) — GoFr's public docs example uses unprefixed HOSTS/USERNAME/PASSWORD/DATABASE, so worth a final confirm that the service template reads CH_* and joins CH_HOST:CH_PORT into GoFr's Hosts.
Approving.
Description
The ClickHouse chart's per-service connection
ConfigMap/Secretemitted MySQL-styleDB_*keys, which the consuming service doesn't read — so an app attaching to this chart got no usable connection.This switches them to the
CH_*keys the service reads (which it combines into GoFr's ClickHouseHosts, see gofr.dev/docs/datasources/clickhouse):CH_HOST<release>-clickhouseCH_PORT9000(native TCP)CH_USERCH_DATABASECH_PASSWORDThe consumer forms
CH_HOST:CH_PORTas GoFr'sHosts.CH_USERlives in the ConfigMap (not sensitive);CH_PASSWORDin the Secret. Upgrade-preservation readsCH_USERfrom the existing ConfigMap andCH_PASSWORDfrom the existing Secret, so credentials stay stable across upgrades.Chart bumped to v0.0.2, re-packaged, index regenerated.
Type of Change
Testing (local minikube)
With
services: [{name: aggregator, database: zopnight_aggregator}]:helm lintpasses;docs/index.yamldigest matchesdocs/clickhouse-v0.0.2.tgzChecklist
helm lintpasses