feat(backup): Add on-demand backups and recovery file

Also remove legacy ingress
This commit is contained in:
Tanguy Herbron 2024-12-19 18:23:00 +01:00
parent 26025c8470
commit bdf36c8142
3 changed files with 56 additions and 13 deletions

View File

@ -0,0 +1,8 @@
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: vaultwarden-db-ondemand-backup
namespace: vaultwarden
spec:
cluster:
name: vaultwarden-db

View File

@ -0,0 +1,48 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: vaultwarden-db
namespace: vaultwarden
spec:
instances: 3
storage:
size: 1Gi
storageClass: local-path
bootstrap:
recovery:
source: vaultwarden-db
postgresql:
pg_hba:
- host all all all md5
externalClusters:
- name: vaultwarden-db
barmanObjectStore:
serverName: vaultwarden-db
destinationPath: "s3://halis/cloudnativepg"
endpointURL: https://s3.halia.dev
s3Credentials:
accessKeyId:
name: s3-secret
key: AWS_ACCESS_KEY_ID
secretAccessKey:
name: s3-secret
key: AWS_SECRET_ACCESS_KEY
region:
name: s3-secret
key: AWS_REGION
wal:
compression: gzip
maxParallel: 8
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 500m
memory: 500Mi

View File

@ -12,9 +12,6 @@ spec:
- hosts: - hosts:
- bitwarden.halis.io - bitwarden.halis.io
secretName: bitwarden-halis-io-tls secretName: bitwarden-halis-io-tls
- hosts:
- bitwarden.halia.dev
secretName: bitwarden-halia-dev-tls
ingressClassName: nginx-external ingressClassName: nginx-external
rules: rules:
- host: bitwarden.halis.io - host: bitwarden.halis.io
@ -27,13 +24,3 @@ spec:
name: vaultwarden-svc name: vaultwarden-svc
port: port:
number: 80 number: 80
- host: bitwarden.halia.dev
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: vaultwarden-svc
port:
number: 80