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

View File

@ -24,12 +24,12 @@ spec:
- name: DB_PASSWORD - name: DB_PASSWORD
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: vaultwarden.vaultwarden.credentials.postgresql.acid.zalan.do name: vaultwarden-db
key: password key: password
- name: SIGNUPS_ALLOWED - name: SIGNUPS_ALLOWED
value: "true" value: "true"
- name: DATABASE_URL - 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 - name: ADMIN_TOKEN
valueFrom: valueFrom:
secretKeyRef: secretKeyRef: