feat(forgejo): backup s3 directly to pvc
This commit is contained in:
parent
491be80842
commit
55d9a06dc7
2 changed files with 7 additions and 19 deletions
|
|
@ -4,7 +4,7 @@ metadata:
|
||||||
name: forgejo-s3-backup
|
name: forgejo-s3-backup
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
spec:
|
spec:
|
||||||
schedule: "0 2 * * *"
|
schedule: "0 1 * * *"
|
||||||
jobTemplate:
|
jobTemplate:
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
|
@ -29,17 +29,13 @@ spec:
|
||||||
mountPath: /config/rclone
|
mountPath: /config/rclone
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: backup-dir
|
- name: backup-dir
|
||||||
mountPath: /backup_dir
|
mountPath: /backup
|
||||||
readOnly: false
|
readOnly: false
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
rm -Rf /backup_dir/backup || true
|
rclone sync source:/${SOURCE_BUCKET}/packages /backup -v --ignore-checksum
|
||||||
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
|
||||||
|
|
@ -47,17 +43,16 @@ spec:
|
||||||
secretName: forgejo-s3-backup
|
secretName: forgejo-s3-backup
|
||||||
- name: backup-dir
|
- name: backup-dir
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: s3-temp-data
|
claimName: s3-backup
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: s3-temp-data
|
name: s3-backup
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
volumeMode: Filesystem
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 50Gi
|
storage: 50Gi
|
||||||
|
|
@ -70,15 +65,7 @@ metadata:
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
rclone.conf: |
|
rclone.conf: |
|
||||||
[remote-source]
|
[source]
|
||||||
type = s3
|
|
||||||
provider = HuaweiOBS
|
|
||||||
env_auth = true
|
|
||||||
endpoint = obs.eu-de.otc.t-systems.com
|
|
||||||
region = eu-de
|
|
||||||
acl = private
|
|
||||||
|
|
||||||
[remote-destination]
|
|
||||||
type = s3
|
type = s3
|
||||||
provider = HuaweiOBS
|
provider = HuaweiOBS
|
||||||
env_auth = true
|
env_auth = true
|
||||||
|
|
|
||||||
|
|
@ -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" -}}}
|
{{{- define "BUCKET_NAME" -}}}
|
||||||
{{{- if (getenv "FORGEJO_BUCKET_NAME") -}}}
|
{{{- if (getenv "FORGEJO_BUCKET_NAME") -}}}
|
||||||
{{{ getenv "FORGEJO_BUCKET_NAME" }}}
|
{{{ getenv "FORGEJO_BUCKET_NAME" }}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue