Files
cozystack/hack/testdata/migration-65-clickhouse-credentials
Andrei Kvapil 6d72324818 feat(platform): migration 65 converts ClickHouse credentials
Existing ClickHouse releases keep working across the chart switch: the
hook writes each tenant account's Secret from the password in
<release>-credentials and adds the valuesFrom entries the converted
chart reads the verifiers from, so its first render already lets every
client in. A release with a user under a reserved name is left out and
keeps its previous chart.

The hook also holds every ClickHouse release, suspended, until both
cozystack-controller and cozystack-api run their new revision. Without
the hold the converted chart switched while the old controller was still
running; it had already rebuilt each release's valuesFrom without the
account entries this migration added, so the first render left every
tenant user out of the installation and clients were locked out until
the new controller put them back, ten minutes later on a test cluster.
The old cozystack-api drops the same entries on any tenant write.

The finish Job then resumes the releases with the entries put back,
strips leftover users.*.password, keeps only the backup password in
<release>-credentials and rotates it once, because tenants could read it
before. Its ServiceAccount, ClusterRole and binding are named
cozystack-credentials-migration-65 like the Job, so an operator finds
them next to it and this hook never deletes the identity migration 64's
Job may still run as. The role may read Deployments for the hold.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-01 14:30:31 +01:00
..