Files
HetznerTerra/infrastructure/addons/cnpg/postgres-cluster.yaml
MichaelFisher1997 1b39710f63
Some checks failed
Deploy Cluster / Terraform (push) Successful in 37s
Deploy Cluster / Ansible (push) Has been cancelled
fix: Move retentionPolicy to correct location in backup spec
2026-03-26 00:39:25 +00:00

73 lines
1.6 KiB
YAML

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: rancher-db
namespace: cnpg-cluster
spec:
description: "Rancher external database cluster"
imageName: ghcr.io/cloudnative-pg/postgresql:17.4
imagePullPolicy: IfNotPresent
instances: 1
primaryUpdateStrategy: unsupervised
storage:
storageClass: local-path
size: 50Gi
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 1000m
memory: 2Gi
bootstrap:
recovery:
source: b2-backup
externalClusters:
- name: b2-backup
barmanObjectStore:
destinationPath: s3://HetznerTerra/rancher-backups/
endpointURL: https://s3.us-east-005.backblazeb2.com
s3Credentials:
accessKeyId:
name: b2-credentials
key: B2_ACCOUNT_ID
secretAccessKey:
name: b2-credentials
key: B2_APPLICATION_KEY
backup:
barmanObjectStore:
destinationPath: s3://HetznerTerra/rancher-backups/
endpointURL: https://s3.us-east-005.backblazeb2.com
s3Credentials:
accessKeyId:
name: b2-credentials
key: B2_ACCOUNT_ID
secretAccessKey:
name: b2-credentials
key: B2_APPLICATION_KEY
retentionPolicy: keep14
serviceAccountTemplate:
metadata:
labels:
app.kubernetes.io/name: rancher-db
superuserSecret:
name: rancher-db-password
monitoring:
enablePodMonitor: true
affinity:
nodeSelector:
kubernetes.io/hostname: k8s-cluster-cp-1
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule