Repository navigation
Description
Problem or Motivation
The owner rule says that data on a PersistentVolume needs a backup. Apart from Gitea (#2144) and the databases (#3741 and the Mattermost database item), no claim has a backup. Each claim is a local-path volume on one node, so a lost disk or node loses its data.
Proposed Solution & Architectural Design
- k8up Schedules on annotated claims only (owner decision 3 of feat(k8s): track the cluster content store #4742):
roadmap-service-hometo bucketbackups-devops;open-webuiandqdrantto bucketbackups-llm;mattermost-filesto bucketbackups-mattermost;grafanato bucketbackups-monitoring.
- The telemetry volumes and
valkey-runs-datastay out, because the cluster makes them again. Qdrant stays in, because nothing can make it again today. - No CNPG claim gets the
k8up.io/backupannotation. The Barman Cloud plugin backs up the databases. - A PodConfig in each restricted namespace (
allowPrivilegeEscalation: false, drop ALL, seccompRuntimeDefault). - Egress rules to
object-storeon 8333, one key for each namespace from ClusterSecret rows (keyring), and a restic password that the owner also keeps offline. - A backup-age alert at 26 hours for each Schedule, and one restore drill.
Target Subsystem
Kubernetes & Minikube Automation (k8s/, the namespaces of each claim, k8s/monitoring/).
Existing Tool Considered
k8up (restic, Apache-2.0), which #2144 installs. No custom code. Rejected: Velero file-system backup (it does not read hostPath volumes, and all 19 PVs are hostPath).
Acceptance Criteria
- Each scheduled claim has a snapshot within 24 hours.
- A test shows that no CNPG claim has the
k8up.io/backupannotation. - A k8up Restore of
roadmap-service-homeinto a scratch claim has the same file count as the source. - Each age alert passes
promtool.
Dependencies
- feat(k8s): Add scheduled off-node backup and restore for Gitea #2144 (installs k8up and sets the Schedule pattern).
- dan-petty/homelab#98 (the buckets
backups-devops,backups-llm,backups-mattermostandbackups-monitoringand their keys). - Tracker: feat(k8s): track the cluster content store #4742 (child 9).
Source: #4742
Alternatives check of 2026-11-26: in-use.
The item already names this tool.
Tool: k8up-io/k8up (https://github.com/k8up-io/k8up), Apache-2.0, last activity 2026-11-25, maintained.
Reason: The issue already names k8up, and the repository and its README confirm a maintained Kubernetes operator that backs up PVCs with restic to S3 on a Schedule and restores them, so it covers the off-node backup need.
Covers:
- Scheduled restic backups of annotated PVCs to S3 buckets
- Restore of a backup into a scratch claim
- Per-namespace Schedule, PodConfig and credentials objects
- Prometheus endpoint for monitoring backup jobs
Lacks:
- No backup-age metric in v2.16.1 for the 26-hour alert
- No application-consistent Qdrant snapshot; needs its snapshot API
- No CNPG database backup; Barman Cloud plugin path stays
- No claim annotation or credentials by default; each claim is set up
Proposed design
Problem statement
The app claims on local-path volumes have no off-node backup, apart from Gitea and the databases, so a lost node or disk loses their data. The environment tree now lives in dan-petty/homelab, so this repository delivers the product-folder part: a k8up Schedule, PodConfig, claim annotation and egress rule for roadmap-service-home. The Schedules for open-webui, mattermost-files and grafana, the Qdrant snapshot, the backup-age alert and the restore drill are deferred to their own issues.
Acceptance criteria
Requirement: Roadmap service home backup annotation
The claim roadmap-service-home in k8s/devops/roadmap-service/pvc.yaml SHALL carry the k8up.io/backup annotation with the value true.
Scenario: The k8s check accepts the annotated claim
- WHEN uv run devops ci --check --only k8s runs on the branch.
- THEN The k8s row exits 0.
Requirement: Roadmap service home backup Schedule
The k8up manifests in k8s/devops/roadmap-service SHALL define one Schedule named roadmap-service-home that sets spec.backend.s3.bucket to backups-devops, references Secret k8up-repo-backups-devops for the restic password and Secret backups-devops-s3 for the S3 keys, and runs at least once in 24 hours.
Scenario: The k8s check accepts the roadmap-service-home Schedule
- WHEN uv run devops ci --check --only k8s runs on the branch.
- THEN The k8s row exits 0.
Requirement: Hardened k8up PodConfig
The roadmap-service-home Schedule SHALL reference a PodConfig whose k8up container sets allowPrivilegeEscalation false, readOnlyRootFilesystem true, runAsNonRoot true, a capability drop of ALL and seccompProfile RuntimeDefault.
Scenario: The k8s check accepts the k8up PodConfig
- WHEN uv run devops ci --check --only k8s runs on the branch.
- THEN The k8s row exits 0.
Requirement: Backup egress to the object store
The devops namespace SHALL allow the k8up backup pod egress to the object store namespace on TCP port 8333.
Scenario: The k8s check accepts the backup egress rule
- WHEN uv run devops ci --check --only k8s runs on the branch.
- THEN The k8s row exits 0.
Existing Tool Considered
k8up (https://github.com/k8up-io/k8up), Apache-2.0, maintained: the alternatives check of 2026-11-20 in the issue body records the verdict in-use and lists what k8up covers and lacks. The item already names k8up. This change writes no backup code. It adds the k8up Schedule, PodConfig, claim annotation and egress rule for roadmap-service-home. For the lacks, the proposal defers the Qdrant snapshot, the backup-age alert and the restore drill to their own issues, and leaves the namespace egress rules and ClusterSecret rows to dan-petty/homelab.
Key questions
- Which open, maintained tool covers the off-node backup of the app claims?: k8up, an Apache-2.0 Kubernetes backup operator based on restic, backs up annotated PVCs to S3-compatible storage on a Schedule and restores them. The alternatives check of 2026-11-20 in the issue body records the verdict in-use, and
dan-petty/homelab#198installs it. (best practice) [sources: openspec/changes/2144-add-scheduled-off-node-backup-and/design.md]- Chosen: k8up Schedules with restic. It backs up annotated PVCs to S3 on a Schedule and restores them, and homelab#198 installs it.
- Rejected: Velero file-system backup. The issue records that it does not read hostPath volumes, and each local-path claim is a hostPath volume.
- Rejected: Custom restic scripts. They add backup code to build, keep and fix that k8up already provides.
- Does feat(k8s): Add scheduled off-node backup and restore for Gitea #2144 install k8up and set the Schedule pattern?: No. feat(k8s): Add scheduled off-node backup and restore for Gitea #2144 closed as not planned, and the k8up install moved to
dan-petty/homelab#198. The 2144 change record states that the k8up release, the Schedule, the PodConfig and the NetworkPolicies are environment objects of dan-petty/homelab, and this repository keeps no k8up release. [sources: openspec/changes/2144-add-scheduled-off-node-backup-and/design.md, openspec/changes/2144-add-scheduled-off-node-backup-and/proposal.md] - Where do the k8up Schedules and the backup-age alert land, given the environment freeze?: The roadmap-service-home Schedule, its PodConfig, its claim annotation and its egress rule land in k8s/devops here, the one product folder that the k8s row admits. The Schedules and values for open-webui, mattermost-files and grafana, the Qdrant snapshot values and CronJob, and the namespace labels and egress policies of llm, mattermost and monitoring are environment paths, so they land in dan-petty/homelab. The backup-age alert is deferred because no series feeds it and its environment rule file is in homelab. (best practice) [sources: tests/gate/k8s_checks/environment_freeze.py:26, k8s/README.md, docs/HOMELAB_REPO_SWITCH.md]
- Chosen: Product folder here, environment paths in homelab. The k8s row admits k8s/devops and refuses k8s/llm, k8s/mattermost and k8s/monitoring, and Argo CD reads only the product base from this repository.
- Rejected: All Schedules here. The required k8s row refuses k8s/llm, k8s/mattermost and k8s/monitoring, so the branch cannot merge.
- Rejected: Wait for step 17 to delete the environment files. Step 17 deletes the files and the check; the live environment is already in homelab, so waiting adds no path here.
- Which claims get a k8up Schedule, and which stay out?: roadmap-service-home gets a k8up Schedule in this repository. open-webui, mattermost-files and grafana get their Schedules in dan-petty/homelab. Qdrant gets its own snapshot API in homelab instead of a restic copy. The telemetry volumes and valkey-runs-data stay out, because the cluster makes them again. No CNPG claim gets the annotation: the databases stay on the Barman Cloud plugin path. (best practice) [sources: k8s/devops/roadmap-service/pvc.yaml:4, k8s/llm/values-open-webui.yaml, k8s/mattermost/files-pvc.yaml, k8s/monitoring/grafana-values.yaml, k8s/llm/values-qdrant.yaml, k8s/mattermost/database.yaml, k8s/llm/gateway-db.yaml, k8s/llm/valkey-runs.yaml, docs/guidelines/sre.md]
- Chosen: Four k8up Schedules plus the Qdrant snapshot API. It backs up each claim that holds data, and it gives Qdrant a consistent snapshot rather than a live file copy.
- Rejected: All five claims through a k8up restic copy. A restic copy of the live Qdrant files can catch the WAL and the segments at different times.
- Rejected: Leave Qdrant out until the ingest moves out of the cluster. The in-cluster ingest has not moved yet, so a lost node still costs a re-index of both collections.
- Which security settings apply to the k8up pods, and in which namespaces?: One hardened PodConfig shape for every k8up Schedule: allowPrivilegeEscalation false, readOnlyRootFilesystem true, runAsNonRoot true, a capability drop of ALL and seccompProfile RuntimeDefault. This repository adds the shape for the roadmap-service-home Schedule in devops, which enforces the restricted standard. The llm, mattermost and monitoring PodConfigs land in homelab; devops and mattermost enforce restricted, and llm and monitoring are privileged, so the same settings are a floor there. (best practice) [sources: k8s/namespaces.yaml]
- Chosen: One hardened PodConfig shape in all four namespaces. The restricted namespaces require it, the same settings are a harmless floor in the privileged ones, and one shape stays to keep.
- Rejected: A hardened PodConfig only in the restricted namespaces. It leaves the backup pods in the privileged namespaces with more privilege for no reason, with two shapes to keep.
- Rejected: The default k8up pod. It does not meet the restricted standard that devops and mattermost enforce.
- How does a backup namespace reach the object store on TCP 8333?: The namespace carries the label backup-client: true and gets an egress rule to namespace object-store on TCP 8333. The object store ingress admits any namespace with that label, so no store policy names a client namespace. This repository adds the egress rule for namespace devops; the label and the other namespaces' rules land in homelab. (best practice) [sources: docs/adr/0034-the-object-store-is-seaweedfs-with-its-operator.md, k8s/object-store/networkpolicy.yaml, k8s/README.md]
- Chosen: Label the namespace and add an egress rule. ADR 0034 and the store ingress admit a client by the backup-client label, so no store policy names a client.
- Rejected: Name each backup namespace in the object store policy. The store policy names no client namespace; the label keeps the store policy unchanged for a new client.
- Rejected: Open egress to the object store from every namespace. It gives every pod a path to the store and breaks the zero-trust perimeter.
- Which credentials does this change add, and where do the object store keys come from?: The k8up repository Secret k8up-repo-backups-devops in namespace devops holds the restic password. The S3 access key and secret key come from Secret backups-devops-s3, which the External Secrets Operator copies from the writer key Secret of
dan-petty/homelab#98. The restic password row is an environment row of dan-petty/homelab k8s/cluster-secrets.toml, whose value comes from the keyring. The product table in src/devops_cli/k8s/cluster_secrets.py holds no k8up row, and git holds no value. (best practice) [sources: k8s/README.md, openspec/specs/cluster-secrets-loader/spec.md, src/devops_cli/k8s/cluster_secrets.py]- Chosen: Environment rows for the restic password, ESO key Secrets for the store keys. The loader reads environment rows from homelab cluster-secrets.toml, and homelab#98 writes the store keys.
- Rejected: Product rows in src/devops_cli/k8s/cluster_secrets.py. The k8up repository Secrets are environment objects, so their rows belong in homelab cluster-secrets.toml.
- Rejected: Manual Secret manifests. Git would hold a credential value.
- Which series feeds the 26-hour backup-age alert?: The kube-state-metrics Job series would, selected by the labels of the k8up backup Jobs and grouped by the Job label that names the Schedule, but the k8s-monitoring allowlist omits jobs and k8up v2.16.1 exposes no backup-age metric. The alert is deferred to a homelab change that adds jobs to metricLabelsAllowlist and puts the rule in the product rule file. (best practice) [sources: k8s/monitoring/k8s-monitoring-values.yaml:275, k8s/monitoring/prometheus-values.yaml]
- Chosen: kube-state-metrics Job series with jobs in the allowlist in homelab. The Job series carries the completion time and labels, and the allowlist change is the only missing piece.
- Rejected: k8up metric with promURL to a Pushgateway. k8up v2.16.1 exposes no backup-age metric, and the Prometheus chart disables its Pushgateway.
- Rejected: A list of the four Schedules in the rule. A new Schedule gets no alert until a rule edit.
- What does the project require for a new alert besides the rule?: A new alert adds its row with the step to take to the alert table of the document that owns its rule group, in the same pull request. [sources: docs/guidelines/sre.md, docs/guidelines/production-readiness.md]
Fit
Fits in one pull request.
Suspected block
dan-petty/homelab#98 must deliver bucket backups-devops and its writer keys, dan-petty/homelab#198 must install k8up, and a dan-petty/homelab pull request must add the backup-client label to namespace devops, create Secret k8up-repo-backups-devops with the restic password, and copy the writer keys into Secret backups-devops-s3, before the roadmap-service-home Schedule can write.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(k8s)scope of the title gives the scope.Data loss risk is real but the volumes are operational today; no outage or security breach is in progress.Five services lose all their data on a single disk or node failure without this backup.Configuration of k8up schedules, PodConfigs, egress rules, secrets, alerts, and one restore drill across four namespaces; no custom code.Both use k8up to schedule off-node backups of local-path volumes, but #2144 targets only the Gitea claim while this item targets roadmap-service-home, open-webui, qdrant, mattermost-files, and grafana.dan-petty commentedon Nov 12, 2026
Scope from the cluster integration plan (2026-11-12)
The cluster integration plan #4989 gives this item one change for the Qdrant row (rank 13). This issue stays a child of #4742.
For Qdrant, use its own snapshot API in place of a restic copy of the live files:
storage.snapshots_config.snapshots_storage: s3(Qdrant v1.19.1, path-style endpoint) to the feat(k8s): track the cluster content store #4742 store.POST /snapshots.Or drop Qdrant from the backup scope once #4566 runs the ingest in the cluster.
Why: a file copy of a running Qdrant can catch the WAL and the segments at different times. Qdrant holds only
devops_codeanddevops_docs, which come from git (a full re-index takes about 22 min), so the value of the backup is low.devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches found that k8up is a Kubernetes backup operator based on restic that backs up annotated PersistentVolumeClaims to S3-compatible storage on a Schedule, which is exactly the off-node backup of local-path claims this issue asks for. The issue itself already names k8up as the tool the project uses (#2144 installs it), so it is in use and covers the need.
The item already names this tool.
Tool: k8up-io/k8up (https://github.com/k8up-io/k8up)
Covers:
k8up.io/backupannotation (default true) to restic repositories on S3-compatible object storageLacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Owner question: Who keeps the restic repository password outside the cluster? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 20, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 21, 2026
Answer: I keep it, as decision 4 of #4742 records.
push-secretsmakes the restic password when I push. Right after that push, I copy the password into the password manager and into the offline copy.devops-cli-service commentedon Nov 21, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 21, 2026
A user outside the list of this item: dan-petty/danielpetty.com adds k8up Schedules in namespaces
danielpetty-com(an application-aware SQLite backup, dan-petty/danielpetty.com#33) anddanielpetty-com-pixelfed(the media claim, dan-petty/danielpetty.com#34). Please write the 26-hour backup-age alert over each k8up Schedule, by the labels of the k8up metrics, and not over a list of names. A new Schedule then gets the alert with no edit. dan-petty/danielpetty.com#33 and dan-petty/danielpetty.com#34 check only that the k8up metrics of their Schedules exist, and they rely on this alert.dan-petty commentedon Nov 21, 2026
This item names environment paths in devops-cli (
k8s/namespaces.yaml,k8s/monitoring/*,k8s/llm/values-qdrant.yaml) and new push-secrets rows. A part that is not merged before plan step 10 of #5134 lands in homelab, because the step 12 freeze refuses changes to the old paths here, and its rows go to homelabk8s/cluster-secrets.toml(dan-petty/homelab#96). Service backups (dan-petty/danielpetty.com#33 and #34) export k8up metrics in their own namespaces, so the backup-age alert must select by metric labels, not by a list of namespace names.devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 22, 2026
Dependency correction (2026-11-22): #4756 closed with PR #6724, which made only the buckets
reports,reports-private,cacheandargo-artifacts, with no S3Identity and no key. Its operator watches onlyobject-storeand cannot write a key Secret into another namespace. The tenant chart of dan-petty/infra#14 renders only for a services entry, not for a platform namespace. Live: 0 S3Identity and 0 S3Credentials objects, and no store key Secret ingitea. The backup buckets and writer keys of the platform namespaces now come with dan-petty/homelab#98 (External Secrets Operator copies each key fromobject-store). I changed the Dependencies section of this item to name it.devops-cli-service commentedon Nov 22, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 25, 2026
Update on dependency
#2144andk8s-monitoringpremise:#2144,#7022, and PR#7059closed as not planned, and Giteak8upbackup moved to https://github.com/dan-petty/homelab/issues/198. While verifying#7059, we confirmedk8s/gitea/andk8s/monitoring/prometheus-values.yamllive indan-petty/homelab(tests/gate/k8s_checks/environment_freeze.py),k8s-monitoringomitskube_job_status_*andkube_job_labels(metricLabelsAllowlist), andk8upv2.16.1does not exposek8up_jobs_last_successful_timestamp.devops-cli-service commentedon Nov 25, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 26, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence