基本框架
This commit is contained in:
27
ansible/files/openlist/app-data-backup-cronjob.yaml
Normal file
27
ansible/files/openlist/app-data-backup-cronjob.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
# docs/06-03-k3s-自动备份与恢复-openlist-webdav.md — 替换镜像、hostPath、远端名
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: app-data-backup
|
||||
namespace: default
|
||||
spec:
|
||||
schedule: "0 3 * * *"
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: app-data-backup
|
||||
image: your-registry/app-backup:latest
|
||||
args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- rclone sync /data openlist-webdav:backups/app-data
|
||||
volumeMounts:
|
||||
- name: app-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: app-data
|
||||
hostPath:
|
||||
path: /data/app
|
||||
restartPolicy: OnFailure
|
||||
24
ansible/files/openlist/app-data-restore-job.yaml
Normal file
24
ansible/files/openlist/app-data-restore-job.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# docs/06-03-k3s-自动备份与恢复-openlist-webdav.md — 一次性恢复 Job
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: app-data-restore
|
||||
namespace: default
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: app-data-restore
|
||||
image: your-registry/app-backup:latest
|
||||
args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- rclone sync openlist-webdav:backups/app-data /data
|
||||
volumeMounts:
|
||||
- name: app-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: app-data
|
||||
hostPath:
|
||||
path: /data/app
|
||||
restartPolicy: OnFailure
|
||||
27
ansible/files/openlist/openlist-backup-cronjob.yaml
Normal file
27
ansible/files/openlist/openlist-backup-cronjob.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
# docs/05-06-openlist挂载网盘与自动备份.md — 替换镜像与 PVC 名
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: openlist-backup
|
||||
namespace: default
|
||||
spec:
|
||||
schedule: "0 3 * * *"
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: openlist-backup
|
||||
image: your-registry/openlist-backup:latest
|
||||
args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- /backup.sh
|
||||
volumeMounts:
|
||||
- name: backup-target
|
||||
mountPath: /backup
|
||||
volumes:
|
||||
- name: backup-target
|
||||
persistentVolumeClaim:
|
||||
claimName: openlist-backup-pvc
|
||||
restartPolicy: OnFailure
|
||||
Reference in New Issue
Block a user