clickhouse-backup reloads its config file in each handler that reaches
S3, among them the create_remote, restore_remote and list calls the
strategy makes. The status and action-log endpoints the strategy polls
read in-memory state and do not reload it, so the mounted file reaches
the sidecar on the calls that need credentials rather than on every
request.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
The credentials projection carries every backup driver's keys, but
only the ClickHouse sidecar's file needs forcePathStyle parsed as a
boolean. A value that failed the parse failed the whole projection as
a malformed source Secret, a terminal reason pointing at the wrong
object, so CNPG, MariaDB, etcd and the other drivers lost their
backups over a parse that serves one file. The value is now left out
of that file and the reason is logged at error level with the
namespace; the rest of the projection proceeds. The chart refuses such
a value at render time, so this covers an environment set around it.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
The environment the sidecar used to read had no S3_REGION when the
platform carried no region, which left clickhouse-backup on its own
us-east-1. Writing an empty region into the config file replaces that
default with an empty one, and requests are then signed for no region.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
The clickhouse-backup sidecar now reads the projected credentials from a
mounted Secret, which kubelet rewrites only after its sync period,
about 75 seconds after the change in practice. The first BackupJob
projects the Secret and started the strategy Job a second later, so its
attempts raced the volume update and the backup could still fail on a
sidecar without credentials.
The projector records when the projected content last changed, and the
ClickHouse driver holds back creating a backup or restore Job until two
minutes have passed since, with a WaitingForCredentials condition. An
unchanged re-projection keeps the time, so only the first projection
and a rotation cause a wait, and a Job already running is never held.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
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>
Seven guides in docs/ were written next to the code and left in the
source tree, where no operator looks. The website carries them now, so
a second copy here only lets the two drift again: the Backup Classes
page had already fallen behind its original.
docs/release.md, docs/deprecating-applications.md and the two SeaweedFS
runbooks in docs/operations stay. A migration, a bats suite, a workflow
or AGENTS.md reads each of them by path, which is the test for keeping
a document in this repository.
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>