feat(clickhouse)!: render a CredentialTemplate per user

Tenant passwords move to platform-minted credentials. The chart no
longer generates, looks up or renders any tenant password and ignores
users.<name>.password: it renders one CredentialTemplate per user, and
cozystack-controller keeps the account Secret holding the SHA-256 of
the password the Cozystack API mints.

The operator watches no Secrets, and a hash inline in the
ClickHouseInstallation is the only path it applies without a restart,
so the template asks for a valuesPath: the HelmRelease pulls each
stored hash into _accounts.u<digest of the user name>, the chart
renders it as password_sha256_hex, and the Flux watch label upgrades
the release when a mint changes the Secret. A user with no verifier in
the values is left out of the installation, because the operator would
give a passwordless user the password "default".

backup stays a platform account in <release>-credentials, which now
holds only it, is labelled not tenant visible and is no longer selected
by the ApplicationDefinition. The names backup, default and
clickhouse_operator are refused for tenant users. A rotation of the
backup password restarts the pods once, since the backup sidecar reads
it from its environment at start.

A user whose account name is longer than 63 characters, does not start
and end with a letter or a digit, or is shared with another user is
refused at render, as credentials-migrate refuses it, so an install and
an upgrade accept the same names. A users.<name>.password left in
values draws an admission warning that points at a mint on the user's
Credential.

Existing clients lose readable passwords; an administrator mints a new
one.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil committed 2026-12-01 14:30:31 +01:00
1 parent 85243d43f1
commit 2f4f82a36c
14 files changed
+399 -53

No files matched your search

@@ -29,8 +29,7 @@ spec:
resourcesPreset: nano
resources: {}
users:
testuser:
password: xai7Wepo
testuser: {}
backup:
enabled: true
useSystemBucket: false
+1 -2
View File
@@ -10,8 +10,7 @@ spec:
storageClass: ""
logTTL: 15
users:
testuser:
password: xai7Wepo
testuser: {}
backup:
enabled: false
s3Region: us-east-1