Repository navigation
Conversation
…rchestrator script as operator config - spec.backup.mode / clusters[].backup.mode: sidecar (default) or pod. Pod mode runs a clickhouse-backup server Pod per shard on the node of a ready replica only while a backup, verify or restore Job is active, behind a headless Service <chi>-<cluster>-backup. Both modes use the REST API with operator-generated auth. - backup-orchestrator.sh (bash + curl) replaces job.sh and the exec runner; shipped as operator config in config/backup (backup.path, ConfigMap etc-clickhouse-operator-backup-files, Helm configs.backupFiles), copied to <chi>-<cluster>-backup-orchestrator; spec.orchestratorConfigMapRef on ClickHouseBackup, ClickHouseBackupSchedule, ClickHouseRestore and spec.backup.recovery overrides it per operation. Jobs run altinity/clickhouse-backup:stable under the operator ServiceAccount (SA + Role in other namespaces). - ClickHouseBackupSchedule.spec.schedules[]: minute/hour/6hours/daily/weekly/monthly entries with keep and incremental; one CronJob per cluster on the finest entry; per-entry GFS retention as in the Altinity usual backup workflow, forced backups_to_keep_remote: 0 and rebase options. - CHI reconcile is Aborted (BackupConfigInvalid) on backup without configSecretRef, a missing or invalid storage Secret, an invalid backup block, or a pod-mode cluster without backup user. - Aborted phase for backups and restores, schedule status phase/entries/nextScheduleTime, events on every phase change and per orchestrator step. - Docs, unit tests sourcing the script, e2e test_010087, test_010088, test_010089. Refs #2146 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slach
force-pushed
the
backup-config-file
branch
from
November 12, 2026 10:51
d0d0ec5 to
d81d518
Compare
This branch has not been deployed
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.
fix #2146
What changes
Transport per cluster —
spec.backup.mode/clusters[].backup.mode:sidecar(default): aclickhouse-backup serversidecar in every ClickHouse Pod;pod: while a backup, verify or restore Job of the cluster is active, one Pod per shardchi-<chi>-<cluster>-<shard>-bkruns on the node of a ready replica and mounts that replica's volumes. A headless Service<chi>-<cluster>-backupgives each Pod a DNS name. ClickHouse Pods are never restarted.Both modes use the REST API on 7171 with operator-generated credentials; a user
config.ymlcannot turn the auth off.Orchestrator —
backup-orchestrator.sh(bash + curl) replacesjob.shand the exec runner (workflow.sh,pods/execRBAC removed):config/backup/: operator configbackup.path, ConfigMapetc-clickhouse-operator-backup-files, Helmconfigs.backupFiles;<chi>-<cluster>-backup-orchestrator;spec.orchestratorConfigMapRefonClickHouseBackup/ClickHouseBackupSchedule/ClickHouseRestore(andspec.backup.recovery.orchestratorConfigMapRef) swaps the script for one operation;altinity/clickhouse-backup:stable(imagePullPolicy: Always) under the operator's ServiceAccount. In other namespaces the operator creates that SA with a minimal Role.Schedules —
ClickHouseBackupSchedule.spec.schedules[](minute,hour,6hours,daily,weekly,monthly, withtime,day,keep,incremental):Retention follows the Altinity usual backup workflow:
keepnewest backups (GFS);clickhouse-backup; the operator forcesbackups_to_keep_remote: 0andrebase_*: true.Validation — the CHI reconcile stops with status
Aborted, reasonBackupConfigInvalidand a Warning eventBackupStorageConfigInvalidwhen:configSecretRef;pod-mode cluster has no backup user.Status and events:
ClickHouseBackup/ClickHouseRestoreget theAbortedphase (the operat 8000 or stopped them), separate fromFailed(the Job failed);phase(Active/Suspended/Aborted),entries[],nextScheduleTime;Orchestrator*events on the same CR.Docs:
docs/backup.md,docs/custom_resource_explained.md,docs/chb-examples/.Tests
go build ./... && go test ./pkg/... ./cmd/...: the orchestrator's functions are unit-tested by sourcing the script, including retention simulations and a cross-check of slot matching against the Go helpers.test_010087: sidecar, Jobs, restore, schedule;test_010088: recovery of a new CHI from another one's backup;test_010089: pod mode round trip and aborted configurations.deploy/operatorhubis not regenerated (done at release).