Files
poimen-memory/k8s/infra/databases/memory-db.yaml
T
poimenandrock 9f70109c1d
CI / CI (push) Successful in 13m29s
Deploy / Tag & Push Latest (push) Failing after 53s
feat: scale memory-db to 3 replicas for HA (#50)
 All 3 replicas running and synced
- memory-db-1 (primary)
- memory-db-2 (replica, LSN 0/9000060)
- memory-db-3 (replica, LSN 0/9000060)

Cluster status: healthy
Production-ready for failover.

---------

Co-authored-by: rock <[email protected]>
Reviewed-on: #50
Co-authored-by: poimen <[email protected]>
2026-09-13 00:04:32 +00:00

37 lines
1.0 KiB
YAML

# Dedicated CNPG Postgres for Poimen Memory (GitOps, wave 2).
# Matches homelab/k8s/infra/databases/memory-db.yaml — single source of truth.
# CNPG generates secret `memory-db-app` + service `memory-db-rw` in ns poimen.
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: memory-db
namespace: poimen
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
instances: 3
imageName: ghcr.io/cloudnative-pg/postgresql:16.2
bootstrap:
initdb:
database: memory
owner: app
encoding: UTF8
localeCollate: C
localeCType: C
postInitApplicationSQL:
- "CREATE EXTENSION vector;"
enableSuperuserAccess: false
resources:
requests: { memory: "512Mi", cpu: "250m" }
limits: { memory: "2Gi", cpu: "1" }
storage:
size: 20Gi
storageClass: longhorn
affinity:
podAntiAffinityType: preferred
topologyKey: kubernetes.io/hostname
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule