apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: freshrss-postgresql-18-cluster
  namespace: freshrss
  labels:
    app.kubernetes.io/name: freshrss-postgresql-18-cluster
    helm.sh/chart: postgres-18-cluster-7.15.0
    app.kubernetes.io/instance: freshrss
    app.kubernetes.io/part-of: freshrss
    app.kubernetes.io/version: "7.15.0"
    app.kubernetes.io/managed-by: Helm
spec:
  instances: 3
  imageName: "ghcr.io/cloudnative-pg/postgresql:18.4-standard-trixie"
  imagePullPolicy: IfNotPresent
  postgresUID: 26
  postgresGID: 26
  storage:
    size: 10Gi
    storageClass: local-path
  walStorage:
    size: 2Gi
    storageClass: local-path
  resources:
    limits:
      hugepages-2Mi: 256Mi
    requests:
      cpu: 50m
      memory: 512Mi
  affinity:
    enablePodAntiAffinity: true
    topologyKey: kubernetes.io/hostname
  primaryUpdateMethod: switchover
  primaryUpdateStrategy: unsupervised
  logLevel: info
  enableSuperuserAccess: false
  enablePDB: true
  postgresql:
    parameters:
      hot_standby_feedback: "on"
      max_slot_wal_keep_size: 2000MB
      shared_buffers: 512MB
  monitoring:
    enablePodMonitor: false
    disableDefaultQueries: false
  plugins:
    - name: barman-cloud.cloudnative-pg.io
      enabled: true
      isWALArchiver: true
      parameters:
        barmanObjectName: "freshrss-postgresql-18-backup-garage-local"
        serverName: "freshrss-postgresql-18-backup-2"
  bootstrap:
    recovery:
      database: app
      source: freshrss-postgresql-18-backup-2
  externalClusters:
    - name: freshrss-postgresql-18-backup-2
      plugin:
        name: barman-cloud.cloudnative-pg.io
        enabled: true
        isWALArchiver: false
        parameters:
          barmanObjectName: "freshrss-postgresql-18-recovery"
          serverName: freshrss-postgresql-18-backup-2
