infra/homelab/postgres-cluster.yml

109 lines
2.5 KiB
YAML
Raw Normal View History

2023-10-30 12:26:40 +00:00
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: hippo
spec:
2024-03-10 12:18:03 +00:00
image: git.gmem.ca/arch/custom-postgres:15
imagePullPolicy: Always
2023-10-30 12:26:40 +00:00
postgresVersion: 15
databaseInitSQL:
key: init.sql
name: init-sql
instances:
- name: instance1
replicas: 1
2023-10-30 12:26:40 +00:00
dataVolumeClaimSpec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
2023-12-24 01:11:48 +00:00
patroni:
dynamicConfiguration:
postgresql:
parameters:
shared_preload_libraries: vectors
2023-10-30 12:26:40 +00:00
backups:
pgbackrest:
2023-12-08 23:43:56 +00:00
manual:
repoName: repo1
options:
- --type=full
2023-10-30 12:26:40 +00:00
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.47-1
2023-12-08 23:43:56 +00:00
global:
repo1-retention-full: "14"
repo1-retention-full-type: time
2023-10-30 12:26:40 +00:00
repos:
- name: repo1
volume:
volumeClaimSpec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
2023-12-08 23:43:56 +00:00
schedules:
full: "0 1 * * 0"
differential: "0 1 * * 1-6"
2023-10-30 12:26:40 +00:00
monitoring:
pgmonitor:
exporter:
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-5.4.3-0
users:
- name: authentik
databases:
- authentik
- name: immich
databases:
- immich
2023-12-24 01:18:54 +00:00
- name: pterodactyl
databases:
- pterodactyl
2024-02-05 13:08:07 +00:00
- name: piped
databases:
- piped
- name: soju
databases:
- soju
2024-03-10 12:18:57 +00:00
- name: atuin
databases:
- atuin
2023-10-30 12:26:40 +00:00
---
apiVersion: v1
kind: ConfigMap
metadata:
name: init-sql
data:
init.sql: |
\c authentik
GRANT CREATE ON SCHEMA public TO "authentik";
\c immich
GRANT CREATE ON SCHEMA public TO "immich";
2023-12-24 01:11:48 +00:00
CREATE EXTENSION vectors;
2023-12-24 01:18:54 +00:00
\c pterodactyl
GRANT CREATE ON SCHEMA public TO "pterodactyl";
2024-02-05 13:08:07 +00:00
\c piped
GRANT CREATE ON SCHEMA public TO "piped";
\c soju
GRANT CREATE ON SCHEMA public TO "soju";
2024-03-10 12:18:57 +00:00
\c atuin
GRANT CREATE ON SCHEMA public TO "atuin";
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: hippo
spec:
selector:
matchLabels:
postgres-operator.crunchydata.com/cluster: hippo
postgres-operator.crunchydata.com/crunchy-postgres-exporter: "true"
podTargetLabels:
- postgres-operator.crunchydata.com/cluster
- postgres-operator.crunchydata.com/role
- postgres-operator.crunchydata.com/instance
podMetricsEndpoints:
- port: exporter
interval: 30s