homek8s/apps/base/sirius-growth/cluster.yaml

68 lines
2.7 KiB
YAML
Raw Permalink Normal View History

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: portal
namespace: sirius-growth
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:16
storage:
size: 5Gi
storageClass: local-path
affinity:
nodeSelector:
kubernetes.io/hostname: siriussec
bootstrap:
initdb:
database: portal
owner: portal
secret:
name: sirius-growth-portal-db
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 1Gi
# ---------------------------------------------------------------------------
# Point-in-time recovery: continuous WAL archiving + daily base backups into
# Garage on the Linode hub (10.10.0.5), i.e. a different power and internet
# domain from this primary. Companion objects: ObjectStore portal-wal (the
# store + 14d retention) and ScheduledBackup portal-daily.
#
# This is the CNPG-I Barman Cloud **plugin** (Deployment cnpg-system/barman-cloud,
# vendored in infrastructure/databases/base), not the operator's in-tree
# barman-cloud support: 1.30 deprecates the in-tree path and 1.31 removes it
# (`Warning: Native support for Barman Cloud backups and recovery is
# deprecated ...`). See objectstore-portal-wal.yaml for the store definition.
#
# `serverName: portal` is the barman prefix and must stay exactly the cluster
# name: the plugin writes to s3://pg-wal-archive/portal/{base,wals}/... — the
# same objects the in-tree archiver left behind, so the existing 14-day window
# stays restorable. Changing it starts a new prefix and abandons that window.
#
# Credentials live in Secret sirius-growth/portal-wal-s3 (created out of band
# from the Garage key `cnpg-portal-wal`, id GK7f2b4bb1fc9abaec50fde37b, scope
# read+write on bucket `pg-wal-archive` only). Never commit the key values.
#
# `pg_dump` in forgejo/cluster-backup still runs nightly for this database as
# a second, logical copy: a dump survives a barman-format regression or a
# store that has been emptied, and it is the only copy that is readable
# without barman. Belt and braces, not redundancy theatre — the RPO comes
# from the WAL archive, not from the dump.
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: portal-wal
serverName: portal
# Scraped via podmonitor.yaml in this directory (hand-written; see the comment
# in apps/base/forgejo/podmonitor.yaml for why enablePodMonitor is false).
# Only the operator's default query set here — this database needs no custom
# application metrics.
monitoring:
enablePodMonitor: false
disableDefaultQueries: false
customQueriesConfigMap:
- name: cnpg-default-monitoring
key: queries