apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata: {name: orders-restore, namespace: data}
spec:
  instances: 3
  imageName: REPLACE_SAME_POSTGRES_IMAGE_AT_DIGEST
  storage: {size: 50Gi, storageClass: REPLACE_ENCRYPTED_STORAGECLASS}
  resources:
    requests: {cpu: '1', memory: 2Gi}
    limits: {cpu: '2', memory: 4Gi}
  affinity:
    enablePodAntiAffinity: true
    podAntiAffinityType: required
    topologyKey: topology.kubernetes.io/zone
  bootstrap:
    recovery:
      source: original
      recoveryTarget: {targetTime: 'REPLACE_UTC_RECOVERY_TIMESTAMP'}
  externalClusters:
    - name: original
      plugin:
        name: barman-cloud.cloudnative-pg.io
        parameters: {barmanObjectName: orders-backup, serverName: orders-db}
  serviceAccountTemplate:
    metadata:
      annotations: {eks.amazonaws.com/role-arn: REPLACE_READONLY_RECOVERY_ROLE_ARN}
  postgresql:
    pg_hba:
      - hostnossl all all all reject
      - hostssl all all all scram-sha-256
