2025-07-10 21:35:39 +10:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: PersistentVolume
|
|
|
|
metadata:
|
|
|
|
name: mariadb-backup-pv
|
|
|
|
spec:
|
|
|
|
capacity:
|
|
|
|
storage: 10Gi
|
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
|
|
|
storageClassName: manual
|
|
|
|
hostPath:
|
|
|
|
path: /dpool/backups/mariadb
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
metadata:
|
|
|
|
name: mariadb-backup-pvc
|
2025-07-10 21:41:10 +10:00
|
|
|
namespace: home-server
|
2025-07-10 21:35:39 +10:00
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
|
|
|
storageClassName: manual
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 10Gi
|
|
|
|
---
|
|
|
|
apiVersion: k8s.mariadb.com/v1alpha1
|
|
|
|
kind: Backup
|
|
|
|
metadata:
|
2025-07-10 22:09:22 +10:00
|
|
|
name: backup-local
|
2025-07-10 21:35:39 +10:00
|
|
|
namespace: home-server
|
|
|
|
spec:
|
|
|
|
mariaDbRef:
|
2025-07-10 21:39:04 +10:00
|
|
|
name: nextcloud-db
|
2025-07-10 21:35:39 +10:00
|
|
|
schedule:
|
|
|
|
cron: "0 1 * * *"
|
|
|
|
maxRetention: 168h
|
2025-07-10 22:09:22 +10:00
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /backups
|
|
|
|
name: backup-volume
|
|
|
|
volumes:
|
|
|
|
- name: backup-volume
|
|
|
|
hostPath:
|
|
|
|
path: /dpool/backups/mariadb
|
|
|
|
type: DirectoryOrCreate
|