replicaCount: 1

datastore:
  engine: postgres
  migrationType: initContainer
  uriSecret: staging-openfga-db-app

ingress:
  enabled: true
  className: nginx
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-production
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    oceanbox.io/expose: internal
  hosts:
    - host: openfga.dev.oceanbox.io
      paths:
        - path: /
          pathType: ImplementationSpecific
  tls:
   - secretName: staging-openfga-tls
     hosts:
       - openfga.dev.oceanbox.io

extraObjects:
  - apiVersion: postgresql.cnpg.io/v1
    kind: Cluster
    metadata:
      name: staging-openfga-db
      namespace: staging-openfga
    spec:
      instances: 1
      imageName: ghcr.io/cloudnative-pg/postgresql:17-bookworm
      storage:
        resizeInUseVolumes: true
        size: 10Gi
      backup:
        retentionPolicy: 60d
        target: prefer-standby
      bootstrap:
        pg_basebackup:
          database: app
          owner: app
          source: openfga
      enableSuperuserAccess: true
      externalClusters:
      - name: openfga
        connectionParameters:
          host: prod-openfga-db-rw.openfga
          sslmode: verify-full
          user: streaming_replica
        sslCert:
          key: tls.crt
          name: prod-openfga-db-replication
        sslKey:
          key: tls.key
          name: prod-openfga-db-replication
        sslRootCert:
          key: ca.crt
          name: prod-openfga-db-ca
  - apiVersion: monitoring.coreos.com/v1
    kind: PodMonitor
    metadata:
     name: staging-openfga-db-monitor
    spec:
      selector:
        matchLabels:
          cnpg.io/cluster: staging-openfga-db
      podMetricsEndpoints:
      - port: metrics
