Skip to content

test(k8s): run a live Gitea backup and restore in a scratch namespace #7022

Not planned

Description

@devops-cli-service

Split from #2144.

The k8up Schedule, the backup-age alert and the restore procedure of #2144 are in git, but no backup has run and no person has restored one. The run needs the merged and synced release, the bucket backups-gitea, its S3 identity and key Secret from dan-petty/homelab#98, the restic password Secret and a person. No offline check can show it, so it cannot gate the merge of #2144. This issue holds that run, and #2144 defers it for that reason. Dependency: dan-petty/homelab#98 makes the bucket and the key Secret. Acceptance criteria: (1) A live k8up backup of the gitea-shared-storage claim writes a snapshot to the bucket backups-gitea, and k8up_jobs_last_successful_timestamp shows the run in Prometheus with no GiteaBackupTooOld alert. (2) A person restores that snapshot into a scratch namespace with the procedure in k8s/README.md, and the restored Gitea shows the repositories, the packages and the database. (3) The person writes the measured restore time and the result into the Gitea section of k8s/README.md.

Proposed design

Problem statement

The k8up Schedule, the backup-age alert and the restore procedure are in git, but no backup has run and no person has restored one. This issue runs a live backup and restore, then records the measured time and result in the Gitea section of k8s/README.md.

Acceptance criteria

Requirement: Live k8up backup writes a snapshot

The k8up Schedule SHALL write one snapshot of the gitea-shared-storage claim to the bucket backups-gitea.

Scenario: Backup run is visible in k8up and Prometheus

  • WHEN a person runs kubectl -n gitea get snapshots.k8up.io after the Schedule runs and queries k8up_jobs_last_successful_timestamp in Prometheus
  • THEN the snapshot list shows the gitea-shared-storage snapshot in bucket backups-gitea, the metric shows a recent successful run, and no GiteaBackupTooOld alert fires.

Requirement: Restore into a scratch namespace

A person SHALL restore the snapshot into a scratch namespace with the procedure in k8s/README.md.

Scenario: Restored Gitea shows its data

  • WHEN a person runs the restore procedure and opens the restored Gitea
  • THEN the restored Gitea shows the repositories, the packages and the database.

Requirement: Record the measured restore

The Gitea section of k8s/README.md SHALL record the measured restore time and the restore result.

Scenario: Restore record is present

  • WHEN a person runs rg -n -i 'restore' k8s/README.md after the restore
  • THEN the Gitea section shows the measured restore time and the restore result.

Existing Tool Considered

No alternatives check has run. k8up is the open, maintained Kubernetes backup operator that covers the scheduled backup and the restore. It lacks a live proof in this cluster. The proof needs the bucket backups-gitea, the S3 identity and key Secret from dan-petty/homelab#98, the restic password Secret and a person's restore and measurement.

Key questions

  • Which open tool runs the live backup and restore?: k8up runs the live backup and restore. The repository already has its Schedule, its backup-age alert and its restore procedure. (best practice) [sources: k8s/README.md]
    • Chosen: k8up. The repository already uses k8up for the Schedule, the alert and the restore procedure.
    • Rejected: A custom restic script. It adds code to build and keep for a job that k8up covers.

Fit

Fits in one pull request.

Suspected block

The live run waits on dan-petty/homelab#98 for the bucket backups-gitea and its S3 identity and key Secret. It also waits on the restic password Secret and a person.

Dependencies

None.

Activity

  1. added
    type/test
    scope/k8s
    source/agent
    status/new
    on Nov 24, 2026
  2. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    ContributorAuthor
  3. added
    value/medium
    effort/low
    priority/p2-medium
    on Nov 24, 2026
  4. changed the title [-]test(k8s): run the first live Gitea backup and restore on a scratch namespace[/-] [+]test(k8s): run a live Gitea backup and restore in a scratch namespace[/+] on Nov 24, 2026
  5. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 66 characters, and the limit is 60. The type and the scope stay.

    • Before: test(k8s): run the first live Gitea backup and restore on a scratch namespace
    • After: test(k8s): run a live Gitea backup and restore in a scratch namespace
    • Source of the summary: the background model
  6. devops-cli-service commented on Nov 24, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  7. dan-petty commented on Nov 25, 2026

    @dan-petty
    Owner

    Closing as not planned per AGENTS.md rule 2: this follow-up assumed #2144 / PR #7059 deployed the k8up Schedule, alert (k8up_jobs_last_successful_timestamp), and restore runbook in git.

    Verification against dan-petty/homelab, dan-petty/infra, and k8up-io/k8up v2.16.1 found:

  8. removed
    status/new
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions