feat(forgejo): backup s3 directly to pvc

This commit is contained in:
Fritz-Leo.Ochsmann 2025-07-31 15:59:25 +02:00 committed by evdo
parent 491be80842
commit 55d9a06dc7
2 changed files with 7 additions and 19 deletions

View file

@ -4,7 +4,7 @@ metadata:
name: forgejo-s3-backup
namespace: gitea
spec:
schedule: "0 2 * * *"
schedule: "0 1 * * *"
jobTemplate:
spec:
template:
@ -29,17 +29,13 @@ spec:
mountPath: /config/rclone
readOnly: true
- name: backup-dir
mountPath: /backup_dir
mountPath: /backup
readOnly: false
command:
- /bin/sh
- -c
- |
rm -Rf /backup_dir/backup || true
mkdir -p /backup_dir/backup
rclone sync remote-source:/edp-forgejo-non-prod-observability/packages /backup_dir/backup -v --ignore-checksum
rclone sync /backup_dir/backup remote-destination:/edp-forgejo-non-prod-observability/hackathon3 -v --ignore-checksum
rm -Rf /backup_dir/backup || true
rclone sync source:/${SOURCE_BUCKET}/packages /backup -v --ignore-checksum
restartPolicy: OnFailure
volumes:
- name: rclone-config
@ -47,17 +43,16 @@ spec:
secretName: forgejo-s3-backup
- name: backup-dir
persistentVolumeClaim:
claimName: s3-temp-data
claimName: s3-backup
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: s3-temp-data
name: s3-backup
namespace: gitea
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 50Gi
@ -70,15 +65,7 @@ metadata:
type: Opaque
stringData:
rclone.conf: |
[remote-source]
type = s3
provider = HuaweiOBS
env_auth = true
endpoint = obs.eu-de.otc.t-systems.com
region = eu-de
acl = private
[remote-destination]
[source]
type = s3
provider = HuaweiOBS
env_auth = true

View file

@ -1,3 +1,4 @@
# This is only used for deploying older versions of infra-catalogue where the bucket name is not an output of the terragrunt modules
{{{- define "BUCKET_NAME" -}}}
{{{- if (getenv "FORGEJO_BUCKET_NAME") -}}}
{{{ getenv "FORGEJO_BUCKET_NAME" }}}