Repository navigation
Reload user passwords from a Secret without restarting ClickHouse - #2100
Merged
Merged
Conversation
valueFrom.hotReload publishes those users in a CHI-owned Secret mounted beside chop-generated-users.xml, so a later password change is picked up from users.d instead of a Pod recreate. Co-authored-by: Cursor <cursoragent@cursor.com>
The plan is stored on chi-storage-{chi} and is gone once the namespace is deleted.
Co-authored-by: Cursor <cursoragent@cursor.com>
alex-zaitsev
force-pushed
the
hot-reload-user-passwords
branch
from
October 15, 2026 13:41
e15e67c to
88ff4ca
Compare
Conflict resolutions:
- pkg/interfaces/interfaces-main.go, pkg/model/common/creator/secret.go: kept both
CreateHotReloadUsersSecret (this PR) and CreateBackupSecret (0.28.0).
- pkg/controller/chi/worker-secret.go: took 0.28.0's backup Secret reconcile
(prepare/ensure/reconcileSecretKeepValues) and appended this PR's hot-reload
users Secret functions; merged imports.
- pkg/controller/chi/worker-secret_test.go (add/add): kept both test sets; aliased
k8s types import as k8stypes to avoid clashing with pkg/apis/common/types.
- pkg/controller/chi/worker-reconcile-gate{,_test}.go, worker-reconciler-chi.go: kept
both gatePasswordSecretChanged and gateBackupSecretChanged (decision, input,
switch case, test table).
- pkg/controller/chi/worker.go: shouldForceRestartHost keeps 0.28.0's
RollingUpdate / configurationChangeRequiresReboot (reloadability cache) ahead of
recovery cases; the password-only shortcut is a guarded case placed first and is
skipped for hosts needing recovery (crashed or stuck NotReady), preserving the
PR's "recovery beats password shortcut" rule. Extracted the recovery predicates
into helpers. Kept both passwordOnlyRefresh and the reloadability cache types.
- deploy/operator/*-v1beta1.yaml: took 0.28.0 and re-applied only this PR's CRD
description change (build_manifests.sh is not usable here).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slach
reviewed
Nov 3, 2026
Collaborator
There was a problem hiding this comment.
Review of the hot-reload passwords PR: three issues worth addressing before merge (see inline comments): the ClickHouse container lookup for the projected volume, an auth gap for users during the hotReload on/off transition, and the memory footprint of the unfiltered cluster-wide Secret informer.
🤖 Generated with Claude Code
Collaborator
|
LGTM. The container lookup fix and the metadata-only Secret informer look good; unit tests pass locally. |
Slach
approved these changes
Nov 3, 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.
Summary
valueFrom.hotReload: truefor ClickHouse userpassword,password_sha256_hex, andpassword_double_sha1_hexfields to support password rotation from Kubernetes Secrets without restarting Pods.chop-generated-hot-reload-users.xmlinside the CHI-owned Secretchi-<chi>-users. Other users remain in the existing users ConfigMap. Both files are projected intousers.dwithoutsubPath, allowing ClickHouse to reload updated credentials.from_envbehavior whenhotReloadis omitted. Enabling hot reload requires a one-time Pod rollout; subsequent password rotations do not.hotReloadon unsupported fields, including settings, profiles, quotas, files, and Keeper configuration. Automatic Secret-change detection supports references declared directly in the CHI; template-inherited references require manual reconciliation.Resolves #2092.
Test plan
test_010011_6: verify password rotation on both replicas, rejection of previous passwords, unchanged passwords for users withouthotReload, and no Pod restarts.