gcloud-lab/apps/base/customer1/hermes-db/pg-cluster-hermes.yaml
sirius0xdev a3ad07d191 feat: add dedicated CNPG cluster for Hermes agent memory and trading data
- New hermes-pgdb cluster (Postgres 15.2, 1 instance, 20Gi)
- 3 databases: hermes_memory, trading_data, agent_memory
- 3 roles with SOPS-encrypted secrets (age encryption)
- Daily backups to gs://customer1_db_backup/hermes-backups/
- Wired into Flux pipeline via staging kustomization
2026-05-02 21:31:41 +00:00

55 lines
1.2 KiB
YAML

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: hermes-pgdb
namespace: customer1
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:15.2
storage:
size: 20Gi
managed:
roles:
- name: hermes
ensure: present
login: true
passwordSecret:
name: hermes-db-credentials
- name: trading
ensure: present
login: true
passwordSecret:
name: trading-db-credentials
- name: memory
ensure: present
login: true
passwordSecret:
name: memory-db-credentials
bootstrap:
initdb:
database: hermes_memory
owner: hermes
secret:
name: hermes-db-credentials
serviceAccountTemplate:
metadata:
name: cnpg-backup-sa
annotations:
iam.gke.io/gcp-service-account: cnpg-backup-sa@devops-lab-cluster.iam.gserviceaccount.com
backup:
barmanObjectStore:
destinationPath: "gs://customer1_db_backup/hermes-backups/"
googleCredentials:
gkeEnvironment: true
wal:
compression: gzip
data:
compression: gzip
jobs: 2
retentionPolicy: "30d"
target: primary