fix(s3backup): doing a local backup first and then push it to remote, which is still on the same OBS store
This commit is contained in:
parent
e7d14a89cd
commit
491be80842
1 changed files with 33 additions and 10 deletions
|
|
@ -4,7 +4,7 @@ metadata:
|
||||||
name: forgejo-s3-backup
|
name: forgejo-s3-backup
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
spec:
|
spec:
|
||||||
schedule: "24 * * * *"
|
schedule: "0 2 * * *"
|
||||||
jobTemplate:
|
jobTemplate:
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
|
@ -26,20 +26,41 @@ spec:
|
||||||
key: secret-key
|
key: secret-key
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: rclone-config
|
- name: rclone-config
|
||||||
mountPath: /etc/rclone
|
mountPath: /config/rclone
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
- name: backup-dir
|
||||||
|
mountPath: /backup_dir
|
||||||
|
readOnly: false
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
sleep 7d
|
rm -Rf /backup_dir/backup || true
|
||||||
# rclone sync remote-source:packages remote-destination:packages --config /etc/rclone/config
|
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
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
volumes:
|
volumes:
|
||||||
- name: rclone-config
|
- name: rclone-config
|
||||||
secret:
|
secret:
|
||||||
secretName: forgejo-s3-backup
|
secretName: forgejo-s3-backup
|
||||||
|
- name: backup-dir
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: s3-temp-data
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: s3-temp-data
|
||||||
|
namespace: gitea
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeMode: Filesystem
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 50Gi
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
|
@ -48,17 +69,19 @@ metadata:
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
config: |
|
rclone.conf: |
|
||||||
[remote-source]
|
[remote-source]
|
||||||
type = s3
|
type = s3
|
||||||
provider = AWS
|
provider = HuaweiOBS
|
||||||
env_auth = true
|
env_auth = true
|
||||||
endpoint = https://edp-forgejo-non-prod-observability.obs.eu-de.otc.t-systems.com
|
endpoint = obs.eu-de.otc.t-systems.com
|
||||||
region = eu-de
|
region = eu-de
|
||||||
|
acl = private
|
||||||
|
|
||||||
[remote-destination]
|
[remote-destination]
|
||||||
type = s3
|
type = s3
|
||||||
provider = AWS
|
provider = HuaweiOBS
|
||||||
env_auth = true
|
env_auth = true
|
||||||
endpoint = https://edp-forgejo-backup-test-manu.obs.eu-de.otc.t-systems.com
|
endpoint = obs.eu-de.otc.t-systems.com
|
||||||
region = eu-de
|
region = eu-de
|
||||||
|
acl = private
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue