feat(k8s/vikunja): deploy Vikunja with Authelia OIDC and restic backups

This commit is contained in:
2026-09-07 14:48:05 +03:00
parent 72fd37d82d
commit 29602e8858
15 changed files with 570 additions and 13 deletions
+144
View File
@@ -0,0 +1,144 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: vikunja-db-backup
namespace: vikunja
labels:
app: vikunja-backup
spec:
schedule: "0 2 * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
jobTemplate:
spec:
template:
metadata:
labels:
app: vikunja-backup
spec:
restartPolicy: OnFailure
initContainers:
- name: pg-dump
image: postgres:18
imagePullPolicy: IfNotPresent
env:
- name: PGHOST
value: vikunja-db
- name: PGUSER
valueFrom:
secretKeyRef:
name: vikunja-credentials
key: DB_USERNAME
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: vikunja-credentials
key: DB_PASSWORD
- name: PGDATABASE
valueFrom:
secretKeyRef:
name: vikunja-credentials
key: DB_DATABASE_NAME
command:
- sh
- -c
- pg_dump --clean --if-exists > /backup/dump.sql
volumeMounts:
- name: backup-tmp
mountPath: /backup
containers:
- name: resticprofile
image: creativeprojects/resticprofile:0.32.0
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
resticprofile -c /secrets/profiles.yaml -n vikunja-db backup
resticprofile -c /secrets/profiles.yaml -n vikunja-db copy
env:
- name: B2_ACCOUNT_ID
valueFrom:
secretKeyRef:
name: vikunja-backup-config
key: B2_ACCOUNT_ID
- name: B2_ACCOUNT_KEY
valueFrom:
secretKeyRef:
name: vikunja-backup-config
key: B2_ACCOUNT_KEY
volumeMounts:
- name: secrets
mountPath: /secrets
readOnly: true
- name: backup-tmp
mountPath: /backup
volumes:
- name: secrets
secret:
secretName: vikunja-backup-config
- name: backup-tmp
emptyDir: {}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: vikunja-files-backup
namespace: vikunja
labels:
app: vikunja-backup
spec:
schedule: "0 3 * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
jobTemplate:
spec:
template:
metadata:
labels:
app: vikunja-backup
spec:
restartPolicy: OnFailure
containers:
- name: resticprofile
image: creativeprojects/resticprofile:0.32.0
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
resticprofile -c /secrets/profiles.yaml -n vikunja-files backup
resticprofile -c /secrets/profiles.yaml -n vikunja-files copy
env:
- name: B2_ACCOUNT_ID
valueFrom:
secretKeyRef:
name: vikunja-backup-config
key: B2_ACCOUNT_ID
- name: B2_ACCOUNT_KEY
valueFrom:
secretKeyRef:
name: vikunja-backup-config
key: B2_ACCOUNT_KEY
volumeMounts:
- name: secrets
mountPath: /secrets
readOnly: true
- name: files
mountPath: /files
readOnly: true
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 1Gi
volumes:
- name: secrets
secret:
secretName: vikunja-backup-config
- name: files
persistentVolumeClaim:
claimName: vikunja-files