Files
manifests/vcluster/chart/templates/cnpg.yaml
T
2024-02-09 14:36:46 +01:00

70 lines
1.7 KiB
YAML

{{- if .Values.persistence -}}
{{- $fullname := include "vCluster.fullname" . -}}
{{- $name := include "vCluster.releaseName" . -}}
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: {{ $fullname }}-db
namespace: {{ .Release.Namespace }}
annotations:
linkerd.io/inject: disabled
spec:
instances: 1
bootstrap:
initdb:
database: k3s
owner: k3s
primaryUpdateStrategy: unsupervised
backup:
retentionPolicy: "7d"
storage:
size: "5Gi"
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: {{ $name }}-archmeister
namespace: {{ .Release.Namespace }}
annotations:
linkerd.io/inject: disabled
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgis:15-3.3
bootstrap:
initdb:
postInitTemplateSQL:
- CREATE EXTENSION postgis;
- CREATE EXTENSION postgis_topology;
- CREATE EXTENSION fuzzystrmatch;
- CREATE EXTENSION postgis_tiger_geocoder;
# Example of rolling update strategy:
# - unsupervised: automated update of the primary once all
# replicas have been upgraded (default)
# - supervised: requires manual supervision to perform
# the switchover of the primary
primaryUpdateStrategy: unsupervised
backup:
retentionPolicy: "7d"
storage:
size: "5Gi"
bootstrap:
pg_basebackup:
source: prod-archmeister
externalClusters:
- name: prod-archmeister
connectionParameters:
host: prod-archmeister-rw.atlantis.svc
user: streaming_replica
sslmode: verify-full
sslKey:
name: prod-archmeister-replication
key: tls.key
sslCert:
name: prod-archmeister-replication
key: tls.crt
sslRootCert:
name: prod-archmeister-ca
key: ca.crt
{{- end -}}