XS✔ ◾ feat: add backup sidecar with restic for scheduled snapshots#1
Open
XS✔ ◾ feat: add backup sidecar with restic for scheduled snapshots#1
Conversation
PR Metrics✔ Thanks for keeping your pull request small.
Metrics computed by PR Metrics. Add it to your Azure DevOps and GitHub PRs! |
75998f3 to
ceb9df3
Compare
Let tests inherit the version from Chart.yaml instead of duplicating it in every test file. Use matchRegex for the helm.sh/chart label assertion to avoid version-dependent test updates.
Replace crond-based scheduling with a sleep-based interval loop. This eliminates the root requirement entirely: the backup sidecar now runs as UID 10000 (same as Typesense) with read-only root filesystem and all capabilities dropped. This fixes a bug where snapshot cleanup failed because root without DAC_OVERRIDE capability could not delete files owned by UID 10000. Running as the same UID resolves this without adding capabilities. Also adds snapshot success validation before uploading to restic. Breaking change: backup.schedule (cron expression) is replaced by backup.intervalSeconds (integer, default 86400 = 24h).
Restic needs writable /tmp for temp packs and /.cache for its cache. Mount an emptyDir at /tmp and set RESTIC_CACHE_DIR to /tmp/.cache/restic. Validated on EKS dev cluster with rc.9 of the internal chart.
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.
Summary
chart.versionfrom test files to avoid manual updates on version bumpsChanges
backup-scripts-configmap.yaml(entrypoint.sh + backup.sh)statefulset.yaml(backup sidecar container + volume mounts)backup.*block (enabled, schedule, image, retention, env, envFrom, resources)chart.versionfrom all test files, use regex forhelm.sh/chartlabel assertionTest plan
mise run test-- 84 tests passingmise run lint-- clean