hermes 新增备份

This commit is contained in:
Sense T
2026-05-30 10:14:28 +00:00
parent b9a5e809c1
commit e2030cf2ad
5 changed files with 88 additions and 1 deletions
+56
View File
@@ -0,0 +1,56 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: backup
spec:
schedule: "0 1 * * *"
jobTemplate:
spec:
template:
spec:
volumes:
- name: tmp
emptyDir:
medium: Memory
- name: target
hostPath:
path: /data/hermes
- name: backup-script
configMap:
name: backup-script
# 初始化阶段打包
initContainers:
- name: backup-package
# image: busybox:1.28
image: package
command:
- /bin/sh
- /backup.sh
volumeMounts:
- mountPath: /tmp
name: tmp
- mountPath: /target/hermes
name: target
readOnly: true
- mountPath: /backup.sh
name: backup-script
subPath: backup.sh
containers:
- name: backup-upload
# image amazon/aws-cli:2.34.57
image: aws
envFrom:
- secretRef:
name: backup-env
- configMapRef:
name: backup-env
args:
- s3
- sync
- "./hermes-backup"
- "s3://senset-backups/hermes-data"
volumeMounts:
- mountPath: /aws
name: tmp
readOnly: true
restartPolicy: OnFailure
+10
View File
@@ -112,3 +112,13 @@ spec:
limits:
memory: "4Gi"
cpu: "2"
lifecycle:
preStop:
sleep:
seconds: 30
#exec:
# command:
# - rm
# - -f
# - /opt/data/gateway.lock
# - /opt/data/gateway.pid
+20 -1
View File
@@ -7,10 +7,17 @@ replicas:
resources:
- deploy.yaml
- services.yaml
- cronjob.yaml
images:
- name: image
newName: cr.wetofu.me/nousresearch/hermes-agent
newTag: v2026.5.29
- name: package
newName: cr.wetofu.me/library/busybox
newTag: '1.28'
- name: aws
newName: cr.wetofu.me/amazon/aws-cli
newTag: '2.34.57'
secretGenerator:
- name: hermes
files:
@@ -21,6 +28,11 @@ secretGenerator:
- secrets/API_SERVER_KEY
- secrets/SIYUAN_TOKEN
type: Opaque
- name: backup-env
type: Opaque
files:
- secrets/AWS_ACCESS_KEY_ID
- secrets/AWS_SECRET_ACCESS_KEY
configMapGenerator:
- name: hermes
files:
@@ -34,4 +46,11 @@ configMapGenerator:
- config/PIP_INDEX_URL
- name: hermes-start
files:
- config/stage2-hook.sh
- config/stage2-hook.sh
- name: backup-script
files:
- config/backup.sh
- name: backup-env
files:
- config/AWS_REGION
- config/AWS_ENDPOINT_URL_S3
+1
View File
@@ -0,0 +1 @@
228d29a305ceda37c1d0f60ca3ac7407
+1
View File
@@ -0,0 +1 @@
42cb88c943a580cf1c04f9da0764bd56a273ed3b6522d563941bd4f6521684cc