Files
cozystack/packages/apps/clickhouse/tests
Alexey Artamonov c9ce4c480f fix(clickhouse): let the backup sidecar pick up credentials projected after it started
With backup.useSystemBucket the clickhouse-backup sidecar took its S3
settings from optional secretKeyRefs on cozy-backups-creds. The platform
projects that Secret into the namespace at the first BackupJob, usually
after the ClickHouse pod started, and a container's environment is fixed
at start, so the sidecar ran without credentials and every backup and
restore failed until the pod was restarted by hand. Rotated keys stayed
stale the same way.

The projector now also writes the s3 section of a clickhouse-backup
config into the Secret, and the chart mounts that key, optionally, as
the sidecar's config file instead of setting S3 environment variables.
clickhouse-backup reloads its config file in each API handler that
reaches S3 and kubelet rewrites a mounted Secret in place, so projected
and rotated credentials reach the running sidecar. The flat keys stay
for the Redis strategy and for ClickHouse releases still rendered by
the previous chart.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
2026-11-04 17:12:31 +03:00
..