Files
Deploy-Laboratory/ansible/files/05-06-openlist/openlist-backup-cronjob.yaml
jack 8c43761962 feat: 按 doc_id 重组 ansible/files 与验证框架
- ansible/files 改为与文档 XX-YY 对齐的目录结构,更新相关 playbook 路径
- 新增 scripts/verify.sh 与 ansible/playbooks/verify/*.yml,移除单体 verify-matrix.yml
- 补充 docs/00-02 矩阵状态、00-05 验证框架与流程、00-04 环境与 ylc65 工作机说明
- 增加 k3s 存储准备、Longhorn、local-path 等 playbook 与辅助脚本

Made-with: Cursor
2026-03-26 07:01:14 +08:00

29 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# docs/05-06-openlist挂载网盘与自动备份.md — 替换镜像与 PVC 名
apiVersion: batch/v1 # CronJob 所属 APIbatch/v1
kind: CronJob # 定时任务CronJob
metadata: # 资源元信息
name: openlist-backup # CronJob 名称
namespace: default # CronJob 所在命名空间
spec: # CronJob 期望状态
schedule: "0 3 * * *" # 任务调度:每天 03:00cron 格式)
jobTemplate: # 每次触发生成的 Job 模板
spec: # Job spec
template: # Job Pod 模板
spec: # Pod spec
containers: # 容器列表
- name: openlist-backup # 容器名
image: your-registry/openlist-backup:latest # 镜像(需替换为你的镜像)
args: # 容器启动命令参数
- /bin/sh # 使用 shell
- -c # shell 执行模式
- /backup.sh # 运行脚本
volumeMounts: # 挂载卷
- name: backup-target # 引用 volumes[].name
mountPath: /backup # 容器内挂载目录
volumes: # 卷列表
- name: backup-target # 卷名(与 volumeMounts 对齐)
persistentVolumeClaim: # 使用 PVC 作为存储来源
claimName: openlist-backup-pvc # 绑定的 PVC 名称(需保证存在)
restartPolicy: OnFailure # Pod 失败后重启策略:仅失败时重启