Skip to content

feat(uptime-kuma): snapshot the volume nightly with Longhorn - #77

Merged
PragalvaXFREZ merged 1 commit into
mainfrom
feat/uptime-kuma-snapshots
Sep 6, 2026
Merged

PragalvaXFREZ merged 1 commit into
mainfrom
feat/uptime-kuma-snapshots

Conversation

@PragalvaXFREZ

Copy link
Copy Markdown
Owner

Recreated after #73 merged; the original stacked PR was closed when its base branch was deleted.

What

  • RecurringJob uptime-kuma-daily in longhorn-system: task snapshot, cron 15 3 * * *, retain 7, concurrency 1. Declared beside the workload because the workload owns its lifecycle; Argo applies it to the namespace the manifest names.
  • PVC gains the label recurring-job.longhorn.io/uptime-kuma-daily: enabled, which is how Longhorn binds a volume to a named job.
  • README updated: what the snapshots do and do not cover, file table, verification, rollback.

Why a Longhorn snapshot and not a Velero schedule

kubernetes/infra/storage/velero/README.md records that no unattended Schedule exists because R2 has a 1 GB ceiling and no provider-side quota. That contract is left intact. A Longhorn snapshot costs a few MB on disks with hundreds of GB free, runs inside the existing instance managers with no new pods, and covers the realistic failure for this workload: a corrupt SQLite file or a bad chart upgrade. It does not cover losing both workers. Off-cluster stays on-demand.

Validation

  • kubeconform -strict passes on the resources directory; the RecurringJob validates against the datree longhorn.io catalog schema.
  • Live cluster CRD serves v1beta2.
  • python3 scripts/check-docs.py passes.

After merge

kubectl -n longhorn-system get recurringjobs.longhorn.io uptime-kuma-daily
kubectl -n longhorn-system get volumes.longhorn.io -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels}{"\n"}{end}' | grep uptime-kuma-daily

The Kuma volume must carry the recurring-job.longhorn.io/uptime-kuma-daily label. After the first 03:15 run, the Longhorn UI shows one snapshot on the volume.

Declare a RecurringJob that takes a daily snapshot and retains seven,
bound to the claim through the recurring-job label Longhorn copies onto
the volume. Snapshots stay on the volume's disks; off-cluster copies
remain the on-demand Velero path.

Signed-off-by: Pragalva Sapkota <sapkotapragalva@gmail.com>
@PragalvaXFREZ
PragalvaXFREZ merged commit 2355759 into main Sep 6, 2026
3 checks passed
@PragalvaXFREZ
PragalvaXFREZ deleted the feat/uptime-kuma-snapshots branch September 6, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant