Compare commits
No commits in common. "dbdd1452bff411180f4f8c273afba8fb5898e388" and "f37f961a10fc05788da785a6ac06d0c43f509d55" have entirely different histories.
dbdd1452bf
...
f37f961a10
|
@ -10,8 +10,6 @@ resources:
|
||||||
- restic-sa.yaml
|
- restic-sa.yaml
|
||||||
- restic-role.yaml
|
- restic-role.yaml
|
||||||
- restic-role-binding.yaml
|
- restic-role-binding.yaml
|
||||||
- restic-pvc.yaml
|
|
||||||
- restic-debug-pod.yaml
|
|
||||||
- restic-cronjob.yaml
|
- restic-cronjob.yaml
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ echo -e "\n${GREEN}`date` - Backing up Gitea...${NC}\n"
|
||||||
gitea=$(kubectl get deploy -n gitea -l app=gitea -o name --no-headers=true)
|
gitea=$(kubectl get deploy -n gitea -l app=gitea -o name --no-headers=true)
|
||||||
kubectl scale -n gitea --replicas=0 $gitea
|
kubectl scale -n gitea --replicas=0 $gitea
|
||||||
restic backup /gitea
|
restic backup /gitea
|
||||||
restic backup /backup/postgres_backup.dump
|
restic backup /pg_backup/postgres_backup.dump
|
||||||
kubectl scale -n gitea --replicas=1 $gitea
|
kubectl scale -n gitea --replicas=1 $gitea
|
||||||
|
|
||||||
# Forget and prune
|
# Forget and prune
|
||||||
|
|
|
@ -16,9 +16,11 @@ spec:
|
||||||
- name: gitea-data
|
- name: gitea-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: gitea-shared-storage
|
claimName: gitea-shared-storage
|
||||||
- name: restic-backup-vol
|
- name: postgres-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: restic-backup-vol
|
claimName: data-gitea-postgresql-0
|
||||||
|
- name: postgres-backup-vol
|
||||||
|
emptyDir: {}
|
||||||
- name: backup-script-vol
|
- name: backup-script-vol
|
||||||
configMap:
|
configMap:
|
||||||
name: restic-backup-script
|
name: restic-backup-script
|
||||||
|
@ -27,7 +29,7 @@ spec:
|
||||||
- name: postgres-dump-init
|
- name: postgres-dump-init
|
||||||
image: bitnami/postgresql:15.3.0-debian-11-r24
|
image: bitnami/postgresql:15.3.0-debian-11-r24
|
||||||
command: ["/bin/sh", "-c"]
|
command: ["/bin/sh", "-c"]
|
||||||
args: ["pg_dump -h gitea-postgresql -p 5432 -U gitea gitea -Fc > /backup/postgres_backup.dump"]
|
args: ["pg_dump -h gitea-postgresql -p 5432 -U gitea gitea -Fc > /pg_backup/postgres_backup.dump"]
|
||||||
env:
|
env:
|
||||||
- name: PGPASSWORD
|
- name: PGPASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
@ -35,8 +37,10 @@ spec:
|
||||||
name: gitea-postgresql
|
name: gitea-postgresql
|
||||||
key: postgres-password
|
key: postgres-password
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: restic-backup-vol
|
- name: postgres-backup-vol
|
||||||
mountPath: /backup
|
mountPath: /pg_backup
|
||||||
|
- name: postgres-data
|
||||||
|
mountPath: /bitnami/postgresql/data
|
||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: restic-container
|
- name: restic-container
|
||||||
|
@ -47,8 +51,8 @@ spec:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: restic-secret
|
name: restic-secret
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: restic-backup-vol
|
- name: postgres-backup-vol
|
||||||
mountPath: /backup
|
mountPath: /pg_backup
|
||||||
- name: gitea-data
|
- name: gitea-data
|
||||||
mountPath: /gitea
|
mountPath: /gitea
|
||||||
- name: backup-script-vol
|
- name: backup-script-vol
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: restic-debug-pod
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
serviceAccountName: restic-sa
|
|
||||||
volumes:
|
|
||||||
- name: restic-backup-vol
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: restic-backup-vol
|
|
||||||
- name: gitea-data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: gitea-shared-storage
|
|
||||||
containers:
|
|
||||||
- name: restic-debug
|
|
||||||
image: git.namesny.com/cluster/restic:latest
|
|
||||||
command: ["/bin/sh", "-c"]
|
|
||||||
args: ["sleep infinity"]
|
|
||||||
envFrom:
|
|
||||||
- secretRef:
|
|
||||||
name: restic-secret
|
|
||||||
volumeMounts:
|
|
||||||
- name: restic-backup-vol
|
|
||||||
mountPath: /backup
|
|
||||||
- name: gitea-data
|
|
||||||
mountPath: /gitea
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: restic-backup-vol
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 5Gi
|
|
||||||
storageClassName: retain-local-path
|
|
Loading…
Reference in New Issue