# Provisionable overflow cell for the apps-pg three-consumer ceiling.
# Do not apply while empty; see docs/apps-pg.md.
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: apps-pg-2
  namespace: databases
  labels:
    app.kubernetes.io/name: apps-pg-2
    app.kubernetes.io/component: database
    app.kubernetes.io/managed-by: manual
    railiance.io/layer: s3-platform
    railiance.io/role: shared-apps-database
spec:
  instances: 1
  imageName: ghcr.io/cloudnative-pg/postgresql:16
  resources:
    requests: {cpu: 100m, memory: 256Mi}
    limits: {cpu: "1", memory: 1Gi}
  storage:
    size: 10Gi
  bootstrap:
    initdb:
      database: apps_meta
      owner: apps_admin
      secret:
        name: apps-pg-2-credentials
  postgresql:
    parameters:
      max_connections: "100"
      log_connections: "on"
      log_disconnections: "on"
      log_lock_waits: "on"
      log_min_duration_statement: "1000"
      track_io_timing: "on"
  backup:
    retentionPolicy: "30d"
    barmanObjectStore:
      destinationPath: s3://railiance-platform-pg-backup/platform-pg/apps-pg-2/
      endpointURL: https://s3.nl-ams.scw.cloud
      s3Credentials:
        accessKeyId: {name: platform-pg-backup-s3, key: ACCESS_KEY_ID}
        secretAccessKey: {name: platform-pg-backup-s3, key: ACCESS_SECRET_KEY}
      wal: {compression: gzip, maxParallel: 2}
      data: {compression: gzip, jobs: 2}
