gcloud-lab/apps/base/customer1/pg-cluster-customer1.yaml
2026-03-22 19:41:33 +00:00

48 lines
1.1 KiB
YAML

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: customer1-pgdb
namespace: customer1
spec:
managed:
roles:
- name: customer1
ensure: present
login: true
passwordSecret:
name: customer1-db-credentials
- name: news_app
ensure: present
login: true
passwordSecret:
name: news-app-password
instances: 3
imageName: ghcr.io/cloudnative-pg/postgresql:15.2
storage:
size: 10Gi
bootstrap:
initdb:
database: n8n
owner: customer1
secret:
name: customer1-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/customer1-backups/"
googleCredentials:
gkeEnvironment: true
wal:
compression: gzip
data:
compression: gzip
jobs: 2
retentionPolicy: "30d"
target: primary