mirror of
https://gitlab.com/shouptech/flux.git
synced 2026-02-03 19:39:43 +00:00
Add backup job
This commit is contained in:
parent
9d7db86243
commit
8620dfe73c
1 changed files with 58 additions and 0 deletions
|
|
@ -64,3 +64,61 @@ spec:
|
|||
- "60"
|
||||
- "http://nextcloud"
|
||||
restartPolicy: Never
|
||||
---
|
||||
apiVersion: batch/v1beta1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: ncbackup
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
schedule: "00 01 * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: gitlab-regcred
|
||||
containers:
|
||||
- name: ncbackup
|
||||
image: registry.gitlab.com/shouptech/ncbackup:454955999
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: NC_CONFIG_FILE
|
||||
value: /var/www/html/config/config.php
|
||||
- name: NC_DATA_PATH
|
||||
value: /var/www/html/
|
||||
- name: NC_DATA_DEST
|
||||
value: /bkup/data/
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres
|
||||
key: POSTGRES_USER
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres
|
||||
key: POSTGRES_PASSWORD
|
||||
- name: POSTGRES_HOST
|
||||
value: postgres
|
||||
- name: POSTGRES_PORT
|
||||
value: "5432"
|
||||
- name: POSTGRES_DB
|
||||
value: nextcloud
|
||||
- name: POSTGRES_DEST
|
||||
value: /bkup/db/
|
||||
volumeMounts:
|
||||
- name: nextcloud-data
|
||||
mountPath: /var/www/html
|
||||
- name: nextcloud-backup
|
||||
mountPath: /bkup
|
||||
restartPolicy: Never
|
||||
volumes:
|
||||
- name: nextcloud-data
|
||||
hostPath:
|
||||
path: /opt/nextcloud/pod
|
||||
type: Directory
|
||||
- name: nextcloud-backup
|
||||
hostPath:
|
||||
path: /net/hv01/opt/backup/nextcloud
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue