Files
manifests/charts/atlantis/templates/cluster.yaml
T
Moritz Jorg 44245a143f fix(cnpg): Add scheduled backup to atlantis chart
To work update the bucket-name and add the `nutanix-s3`
secret to the namespace.
2025-03-18 13:37:32 +01:00

70 lines
2.1 KiB
YAML

{{- if .Values.cluster.enabled -}}
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: {{ include "Atlantis.fullname" . }}-db
namespace: {{ .Release.Namespace }}
annotations:
linkerd.io/inject: disabled
labels:
{{- include "Atlantis.labels" . | nindent 4 }}
spec:
instances: {{ .Values.cluster.instances | default "1" }}
imageName: ghcr.io/cloudnative-pg/postgis:15-3.3
# 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
{{- if .Values.cluster.backup.enabled }}
backup:
barmanObjectStore:
destinationPath: {{ .Values.cluster.destinationPath | default ""}}
serverName: {{ include "Atlantis.fullname" . }}-db
endpointURL: http://10.255.241.30:30080
s3Credentials:
accessKeyId:
key: access_key
name: cnpg-s3
secretAccessKey:
key: access_secret
name: cnpg-s3
wal:
compression: snappy
retentionPolicy: {{ .Values.cluster.backup.backupRetention | default "60d" }}
{{- end}}
storage:
size: {{ .Values.cluster.size | default "5Gi" }}
{{- with .Values.cluster.bootstrap }}
bootstrap:
{{- if .enabled }}
pg_basebackup:
source: archmaester
externalClusters:
- name: archmaester
connectionParameters:
host: {{ .source.db }}-rw.{{ .source.namespace }}
user: streaming_replica
sslmode: verify-full
sslKey:
name: {{ .source.db }}-replication
key: tls.key
sslCert:
name: {{ .source.db }}-replication
key: tls.crt
sslRootCert:
name: {{ .source.db }}-ca
key: ca.crt
{{- else }}
initdb:
postInitTemplateSQL:
- CREATE EXTENSION postgis;
- CREATE EXTENSION postgis_topology;
- CREATE EXTENSION fuzzystrmatch;
- CREATE EXTENSION postgis_tiger_geocoder;
- ALTER USER app WITH SUPERUSER;
{{- end }}
{{- end }}
{{- end }}