refactor(db): Migrate to CloudNativePG operator

This commit is contained in:
Tanguy Herbron 2023-07-26 13:51:47 +02:00
parent de48bce424
commit 4272e9cc23
2 changed files with 22 additions and 22 deletions

View File

@ -1,26 +1,26 @@
kind: "postgresql"
apiVersion: "acid.zalan.do/v1"
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: "vaultwarden"
namespace: "vaultwarden"
labels:
team: acid
name: vaultwarden-db
namespace: vaultwarden
spec:
teamId: "acid"
instances: 1
storage:
size: 1Gi
storageClass: flat-storage-class
bootstrap:
initdb:
database: vaultwarden
owner: vaultwarden
secret:
name: vaultwarden-db
postgresql:
version: "15"
numberOfInstances: 1
volume:
size: "1Gi"
storageClass: "flat-storage-class"
users:
vaultwarden: []
databases:
vaultwarden: vaultwarden
allowedSourceRanges:
# IP ranges to access your cluster go here
pg_hba:
- host all all all md5
resources:
requests:
cpu: 100m

View File

@ -24,12 +24,12 @@ spec:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: vaultwarden.vaultwarden.credentials.postgresql.acid.zalan.do
name: vaultwarden-db
key: password
- name: SIGNUPS_ALLOWED
value: "true"
- name: DATABASE_URL
value: "postgresql://vaultwarden:$(DB_PASSWORD)@vaultwarden.vaultwarden.svc.cluster.local:5432/vaultwarden"
value: "postgresql://vaultwarden:$(DB_PASSWORD)@vaultwarden-db-rw.vaultwarden.svc.cluster.local:5432/vaultwarden"
- name: ADMIN_TOKEN
valueFrom:
secretKeyRef: