add ns and pvc and launch a first try
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 20s

This commit is contained in:
2024-11-18 22:38:26 +00:00
parent a194812377
commit 418badf14c
4 changed files with 50 additions and 31 deletions
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: backup
+16
View File
@@ -0,0 +1,16 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: synology-backup
namespace: backup
annotations:
fileType: Backup
spec:
storageClassName: nfs-storage-infrequentaccess
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
@@ -0,0 +1,15 @@
apiVersion: v1
data:
rsync.sh: |
#!/usr/bin/env bash
#sleep 3600
apk update
apk add rsync
rsync -avv /source/Backup /destination
rsync -avv /source/Image /destination
kind: ConfigMap
metadata:
creationTimestamp: null
name: rsync-scripts
namespace: backup
+15 -31
View File
@@ -1,8 +1,8 @@
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
name: nextcloud-notes-backup-job-python name: rsync-synology-job
namespace: nextcloud namespace: backup
spec: spec:
backoffLimit: 6 backoffLimit: 6
template: template:
@@ -10,45 +10,29 @@ spec:
containers: containers:
- command: - command:
- /bin/sh - /bin/sh
- /config/export_notes.sh - /config/rsync.sh
env:
- name: PI_USER_USERNAME
valueFrom:
secretKeyRef:
key: PI_USER_USERNAME
name: nextcloud-credentials
- name: PI_USER_PASSWORD
valueFrom:
secretKeyRef:
key: PI_USER_PASSWORD
name: nextcloud-credentials
image: alpine image: alpine
imagePullPolicy: Always imagePullPolicy: Always
name: notes-backup name: rsync-synology
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts: volumeMounts:
- mountPath: /backup - name: synology-backup
name: notes mountPath: /destination
- mountPath: /var/www/html - name: ssd
name: nextcloud-webserver mountPath: /source
- mountPath: /config - mountPath: /config
name: scripts name: scripts
dnsPolicy: ClusterFirst
restartPolicy: Never restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30 terminationGracePeriodSeconds: 30
volumes: volumes:
- name: notes - name: ssd
hostPath:
path: /ssd/
type: Directory
- name: synology-backup
persistentVolumeClaim: persistentVolumeClaim:
claimName: nextcloud-notes-backup claimName: synology-backup
- name: nextcloud-webserver
persistentVolumeClaim:
claimName: nextcloud-webserver
- configMap: - configMap:
defaultMode: 365 defaultMode: 365
name: nextcloud-export-scripts name: rsync-scripts
name: scripts name: scripts
ttlSecondsAfterFinished: 100 ttlSecondsAfterFinished: 100