replace backup with volsync snapshot
This commit is contained in:
@@ -171,133 +171,6 @@ gitea-actions:
|
||||
existingSecret: gitea-runner-secret
|
||||
existingSecretKey: token
|
||||
giteaRootURL: http://gitea-http.gitea:3000
|
||||
backup:
|
||||
global:
|
||||
nameOverride: gitea-backup
|
||||
fullnameOverride: gitea-backup
|
||||
controllers:
|
||||
backup:
|
||||
type: cronjob
|
||||
cronjob:
|
||||
suspend: false
|
||||
concurrencyPolicy: Forbid
|
||||
timeZone: US/Central
|
||||
schedule: 0 4 */2 * *
|
||||
startingDeadlineSeconds: 90
|
||||
successfulJobsHistory: 3
|
||||
failedJobsHistory: 3
|
||||
backoffLimit: 3
|
||||
parallelism: 1
|
||||
serviceAccount:
|
||||
name: gitea-backup
|
||||
pod:
|
||||
automountServiceAccountToken: true
|
||||
labels:
|
||||
app.kubernetes.io/instance: gitea-backup
|
||||
app.kubernetes.io/name: gitea-backup
|
||||
initContainers:
|
||||
backup:
|
||||
image:
|
||||
repository: bitnami/kubectl
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
command:
|
||||
- sh
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
kubectl exec -it deploy/gitea -n gitea -- rm -f /opt/backup/gitea-backup.zip;
|
||||
kubectl exec -it deploy/gitea -n gitea -- /app/gitea/gitea dump -c /data/gitea/conf/app.ini --file /opt/backup/gitea-backup.zip;
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
containers:
|
||||
s3-backup:
|
||||
image:
|
||||
repository: d3fk/s3cmd
|
||||
tag: latest@sha256:a4ef406e37628ee56e608b1567aeb0345e51142f56741b715322111be3b6ebcc
|
||||
pullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
echo ">> Running S3 backup for Gitea"
|
||||
s3cmd put --no-check-md5 --no-check-certificate -v /opt/backup/gitea-backup.zip ${BUCKET}/cl01tl/gitea-backup-$(date +"%Y%m%d-%H-%M").zip;
|
||||
mv /opt/backup/gitea-backup.zip /opt/backup/gitea-backup-$(date +"%Y%m%d-%H-%M").zip;
|
||||
echo ">> Completed S3 backup for Gitea"
|
||||
env:
|
||||
- name: BUCKET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: gitea-s3cmd-config
|
||||
key: BUCKET
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
s3-prune:
|
||||
image:
|
||||
repository: d3fk/s3cmd
|
||||
tag: latest@sha256:a4ef406e37628ee56e608b1567aeb0345e51142f56741b715322111be3b6ebcc
|
||||
pullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
export DATE_RANGE=$(date -d @$(( $(date +%s) - 604800 )) +%Y%m%d);
|
||||
export FILE_MATCH="$BUCKET/cl01tl/gitea-backup-$DATE_RANGE-09-00.zip"
|
||||
echo ">> Running S3 prune for Gitea backup repository"
|
||||
echo ">> Backups prior to '$DATE_RANGE' will be removed"
|
||||
echo ">> Backups to be removed:"
|
||||
s3cmd ls ${BUCKET}/cl01tl/ |
|
||||
awk -v file_match="$FILE_MATCH" '$4 < file_match {print $4}'
|
||||
echo ">> Deleting ..."
|
||||
s3cmd ls ${BUCKET}/cl01tl/ |
|
||||
awk -v file_match="$FILE_MATCH" '$4 < file_match {print $4}' |
|
||||
while read file; do
|
||||
s3cmd del "$file";
|
||||
done;
|
||||
echo ">> Completed S3 prune for Gitea backup repository"
|
||||
env:
|
||||
- name: BUCKET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: gitea-s3cmd-config
|
||||
key: BUCKET
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
serviceAccount:
|
||||
gitea-backup:
|
||||
enabled: true
|
||||
persistence:
|
||||
config:
|
||||
existingClaim: gitea-nfs-storage-backup
|
||||
advancedMounts:
|
||||
backup:
|
||||
s3-backup:
|
||||
- path: /opt/backup
|
||||
readOnly: false
|
||||
s3cmd-config:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: gitea-s3cmd-config
|
||||
advancedMounts:
|
||||
backup:
|
||||
s3-backup:
|
||||
- path: /root/.s3cfg
|
||||
readOnly: true
|
||||
mountPropagation: None
|
||||
subPath: .s3cfg
|
||||
s3-prune:
|
||||
- path: /root/.s3cfg
|
||||
readOnly: true
|
||||
mountPropagation: None
|
||||
subPath: .s3cfg
|
||||
meilisearch:
|
||||
environment:
|
||||
MEILI_NO_ANALYTICS: true
|
||||
@@ -405,3 +278,24 @@ redis-replication-renovate:
|
||||
clusterSize: 1
|
||||
redisSentinel:
|
||||
enabled: false
|
||||
volsync-target-storage:
|
||||
pvcTarget: gitea-shared-storage
|
||||
local:
|
||||
enabled: true
|
||||
schedule: 0 0 0 * * *
|
||||
restic:
|
||||
pruneIntervalDays: 3
|
||||
retain:
|
||||
hourly: 1
|
||||
daily: 1
|
||||
weekly: 3
|
||||
monthly: 0
|
||||
yearly: 0
|
||||
copyMethod: Snapshot
|
||||
storageClassName: ceph-filesystem
|
||||
volumeSnapshotClassName: ceph-filesystem
|
||||
cacheCapacity: 40Gi
|
||||
external:
|
||||
enabled: false
|
||||
remote:
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user