2026-08-22 21:43:23 -07:00
|
|
|
# Dedicated CNPG Postgres for Poimen Memory (GitOps, wave 2 — before poimen w3).
|
|
|
|
|
# Includes pgvector extension for semantic search (768-dim embeddings).
|
2026-08-22 23:36:25 -07:00
|
|
|
# Uses longhorn-imessage-local (WaitForFirstConsumer) to avoid volume binding
|
|
|
|
|
# issues when pod gets scheduled to nodes with unhealthy Longhorn replicas.
|
2026-08-22 21:43:23 -07:00
|
|
|
# CNPG generates secret `memory-db-app` + service `memory-db-rw` in ns poimen;
|
|
|
|
|
# poimen reads them locally (no cross-ns secret copy).
|
|
|
|
|
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: 10Gi
|
2026-08-22 23:36:25 -07:00
|
|
|
storageClass: longhorn-imessage-local
|
2026-08-22 21:43:23 -07:00
|
|
|
monitoring:
|
|
|
|
|
enablePodMonitor: true
|
|
|
|
|
affinity:
|
|
|
|
|
# preferred + tolerations: HA across nodes without deadlocking a partly-
|
|
|
|
|
# schedulable 3-CP (same as temporal/authentik-db).
|
|
|
|
|
podAntiAffinityType: preferred
|
|
|
|
|
topologyKey: kubernetes.io/hostname
|
|
|
|
|
tolerations:
|
|
|
|
|
- key: node-role.kubernetes.io/control-plane
|
|
|
|
|
operator: Exists
|
|
|
|
|
effect: NoSchedule
|