feat(backup): wire Velero + CNPG Barman to the live MinIO S3 target
Author the GitOps side of off-cluster backups against the on-Proxmox MinIO (http://192.168.1.9:9000, path-style; buckets velero + cnpg). Velero (R-STATE-03): - HelmRelease (chart 8.x / Velero 1.15) + velero-plugin-for-aws init container + node-agent kopia File System Backup (deployNodeAgent, uploaderType=kopia, snapshotsEnabled=false). BSL default -> bucket velero, s3ForcePathStyle. - Two daily Schedules: `daily` backs up the whole cluster's resources+PVC data (defaultVolumesToFsBackup opt-out) EXCEPT monitoring+unifi; `daily-resources-only` captures monitoring+unifi RESOURCES only (Prometheus TSDB, Loki 72h logs, and the ~7.4GiB UniFi VM disk are reconstructable — excluded from volume backup). - velero-cloud-credentials SOPS Secret (cloud INI key, ns velero). - Own non-gating Flux tier clusters/base/backup.yaml (dependsOn platform-config, wait:false) + clusters/dev SOPS decryption patch — mirrors headlamp. CNPG native Barman PITR (R-IDP-05 / R-STATE-03): - keycloak-db, nextcloud-db, semaphore-db gain spec.backup.barmanObjectStore (s3://cnpg/<cluster>, endpointURL MinIO, gzip WAL+data, 30d retention) + a daily ScheduledBackup (6-field cron, immediate) each. - Per-namespace scoped-key SOPS Secrets (<db>-backup-credentials), same-ns only. - render.py: emit-waves now recognizes <svc>-db-backup-credentials.sops.yaml as a DB-wave sidecar (+ self-test); wave-0 kustomization regenerated. Creds mirror platform/backup/minio-credentials.sops.yaml (scoped key k3s-backup), SOPS round-trip verified with the cluster age key. gate: green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
1bee2554f8
commit
d1248e6778
17 files changed
+446
-49
No files matched your search
@@ -1,5 +1,23 @@
|
||||
---
|
||||
# Velero — off-cluster backup/DR of volumes + resource state (ADR-0003, R-STATE-03). Phase 0 STUB.
|
||||
# Velero — off-cluster backup/DR of cluster resources + PVC data (ADR-0003, R-STATE-03). LIVE.
|
||||
#
|
||||
# TARGET: the on-Proxmox MinIO S3 endpoint http://192.168.1.9:9000 (plain HTTP, path-style), bucket
|
||||
# `velero`. region us-east-1 is a placeholder MinIO ignores (S3 clients still require one).
|
||||
#
|
||||
# WHY THIS SHAPE:
|
||||
# - provider aws + velero-plugin-for-aws (init container) drives the S3-compatible MinIO target.
|
||||
# - File System Backup (kopia) via the node-agent DaemonSet — storage-agnostic PVC backup that does
|
||||
# NOT depend on CSI VolumeSnapshots or a data-mover (the simplest path that still captures the
|
||||
# Longhorn PVC *data*). snapshotsEnabled:false → no VolumeSnapshotLocation is created/needed.
|
||||
# - Credentials: the `cloud` INI key of the SOPS Secret velero-cloud-credentials (ns velero) — the
|
||||
# SCOPED MinIO key limited to the velero+cnpg buckets. Kept in sync with the staging source of
|
||||
# truth platform/backup/minio-credentials.sops.yaml and the Proxmox host ansible-vault.
|
||||
#
|
||||
# VOLUME OPT-OUT (per the sizing decision) is implemented with TWO schedules (a single Backup has one
|
||||
# cluster-wide defaultVolumesToFsBackup, so per-namespace volume policy needs two): see `schedules`.
|
||||
#
|
||||
# NON-GATING TIER: reconciled by clusters/base/backup.yaml (dependsOn platform-config, wait:false).
|
||||
# A backup controller must NEVER gate the platform graph (mirror headlamp/oauth2-proxy).
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
@@ -10,7 +28,7 @@ spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: velero
|
||||
version: ">=8.0.0 <9.0.0" # TODO(WS-STORAGE): pin at bring-up; Renovate maintains
|
||||
version: ">=8.0.0 <9.0.0" # Velero v1.15.x line. TODO(WS-STORAGE): pin at bring-up; Renovate maintains
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: vmware-tanzu
|
||||
@@ -22,25 +40,80 @@ spec:
|
||||
remediation:
|
||||
retries: 3
|
||||
values:
|
||||
# Off-cluster backup target — S3-compatible/NFS (ADR-0003). STUB: concrete target + creds are
|
||||
# OQ-2 / prerequisites. Credentials referenced BY NAME only, SOPS-encrypted (WS-SEC).
|
||||
# --- AWS object-store plugin (BSL provider=aws → MinIO S3-compatible), loaded as an init container.
|
||||
# Image minor MUST track the Velero minor (chart 8.x = Velero 1.15 → plugin v1.11.x). ---
|
||||
initContainers:
|
||||
- name: velero-plugin-for-aws
|
||||
image: velero/velero-plugin-for-aws:v1.11.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumeMounts:
|
||||
- mountPath: /target
|
||||
name: plugins
|
||||
# --- File System Backup (kopia): the node-agent DaemonSet mounts each pod's volumes and copies
|
||||
# the data into S3. Storage-agnostic; no CSI-snapshot / data-mover wiring. ---
|
||||
deployNodeAgent: true
|
||||
snapshotsEnabled: false # no VolumeSnapshotLocation — kopia FSB is the volume-data path
|
||||
configuration:
|
||||
uploaderType: kopia
|
||||
backupStorageLocation:
|
||||
- name: default
|
||||
provider: aws # TODO(WS-STORAGE): S3-compatible endpoint per OQ-2
|
||||
bucket: REPLACE-ME
|
||||
provider: aws
|
||||
bucket: velero
|
||||
default: true
|
||||
config:
|
||||
region: REPLACE-ME
|
||||
s3Url: REPLACE-ME
|
||||
s3ForcePathStyle: "true"
|
||||
volumeSnapshotLocation:
|
||||
- name: default
|
||||
provider: REPLACE-ME # Longhorn CSI snapshots / Velero fs-backup
|
||||
region: us-east-1 # placeholder; MinIO ignores it (S3 clients require one)
|
||||
s3Url: http://192.168.1.9:9000 # on-Proxmox MinIO, plain HTTP
|
||||
s3ForcePathStyle: "true" # MinIO is path-style
|
||||
credentials:
|
||||
existingSecret: velero-backup-credentials # SOPS-encrypted (WS-SEC) — name only
|
||||
existingSecret: velero-cloud-credentials # SOPS Secret carrying the `cloud` INI key (ns velero)
|
||||
# --- Daily backups. TWO schedules implement the opt-out volume policy: capture every PVC's data
|
||||
# by default (opt-out), but skip the two reconstructable heavy volumes' DATA while still
|
||||
# capturing their Kubernetes resources. ---
|
||||
schedules:
|
||||
# (1) The whole cluster EXCEPT monitoring+unifi: all resources + all pod-volume data via kopia.
|
||||
# defaultVolumesToFsBackup:true is the OPT-OUT model — nothing with real data is forgotten.
|
||||
daily:
|
||||
schedule: "${VELERO_BACKUP_SCHEDULE}" # overlay knob (cron)
|
||||
disabled: false
|
||||
schedule: "${VELERO_BACKUP_SCHEDULE}"
|
||||
useOwnerReferencesInBackup: false
|
||||
template:
|
||||
ttl: "${VELERO_RETENTION}" # overlay knob (dev short / prod long)
|
||||
# TODO(WS-STORAGE, Phase 4): tested restore path (DR drill) is an acceptance gate (R-STATE-03).
|
||||
ttl: "${VELERO_RETENTION}"
|
||||
storageLocation: default
|
||||
snapshotVolumes: false
|
||||
defaultVolumesToFsBackup: true
|
||||
excludedNamespaces:
|
||||
- monitoring # volume DATA excluded here; resources captured by schedule (2)
|
||||
- unifi
|
||||
# (2) monitoring + unifi: RESOURCES ONLY (defaultVolumesToFsBackup:false → no volume data). Their
|
||||
# PVCs are reconstructable and excluded from data backup per the sizing decision:
|
||||
# - monitoring: the Prometheus TSDB PVC (ephemeral/reconstructable) and the Loki 72h-log PVC
|
||||
# (Grafana/Alertmanager are emptyDir — no PVC). Grafana dashboards are GitOps-provisioned.
|
||||
# - unifi: the ~7.4 GiB KubeVirt VM disk (huge + reconstructable; UniFi is protected by its
|
||||
# own config export, not this disk).
|
||||
# Backing up their K8s objects (VM/DataVolume/Services/HelmRelease-owned CRs) still aids DR.
|
||||
daily-resources-only:
|
||||
disabled: false
|
||||
schedule: "${VELERO_BACKUP_SCHEDULE}"
|
||||
useOwnerReferencesInBackup: false
|
||||
template:
|
||||
ttl: "${VELERO_RETENTION}"
|
||||
storageLocation: default
|
||||
snapshotVolumes: false
|
||||
defaultVolumesToFsBackup: false
|
||||
includedNamespaces:
|
||||
- monitoring
|
||||
- unifi
|
||||
# Modest home-dev footprint (mirror the other platform components).
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
memory: 512Mi
|
||||
nodeAgent:
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
memory: 512Mi
|
||||
Reference in new issue
Block a user