Compare commits

...

9 Commits

4 changed files with 28 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v2
name: postgres-cluster
version: 2.3.0
version: 2.3.8
description: Chart for cloudnative-pg cluster
keywords:
- database

View File

@@ -26,20 +26,20 @@ bootstrap:
import:
type: {{ .Values.replica.importType }}
databases:
{{- if and (len .Values.replica.importDatabases gt 1) (.Values.replica.importType eq "microservice") }}
{{- if and (gt (len .Values.replica.importDatabases) 1) (eq .Values.replica.importType "microservice") }}
{{ fail "Too many databases in import type of microservice!" }}
{{- else}}
{{- with .Values.replica.importDatabases }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.replica.importType eq "monolith" }}
{{- if eq .Values.replica.importType "monolith" }}
roles:
{{- with .Values.replica.importRoles }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- end }}
{{- if and (.Values.replica.postImportApplicationSQL) (.Values.replica.importType eq "microservice") }}
{{- if and (.Values.replica.postImportApplicationSQL) (eq .Values.replica.importType "microservice") }}
postImportApplicationSQL:
{{- with .Values.replica.postImportApplicationSQL }}
{{- . | toYaml | nindent 8 }}
@@ -58,19 +58,18 @@ externalClusters:
recoveryTarget:
targetTime: {{ . }}
{{- end }}
source: "{{ include "cluster.name" . }}-backup-{{ .Values.recovery.recoveryIndex }}"
source: {{ include "cluster.recoveryServerName" . }}
externalClusters:
- name: "{{ include "cluster.name" . }}-backup-{{ .Values.recovery.recoveryIndex }}"
- name: {{ include "cluster.recoveryServerName" . }}
barmanObjectStore:
serverName: "{{ include "cluster.name" . }}-backup-{{ .Values.recovery.recoveryIndex }}"
destinationPath: "s3://{{ .Values.recovery.endpointBucket }}/{{ .Values.kubernetesClusterName }}/postgresql/{{ include "cluster.recoveryName" . }}"
serverName: {{ include "cluster.recoveryServerName" . }}
destinationPath: "s3://{{ .Values.recovery.endpointBucket }}/{{ .Values.kubernetesClusterName }}/postgresql/{{ include "cluster.recoveryInstanceName" . }}"
endpointURL: {{ .Values.recovery.endpointURL }}
{{- with .Values.recovery.endpointCA }}
endpointCA:
name: {{ . }}
key: ca-bundle.crt
{{- end }}
serverName: "{{ include "cluster.name" . }}-backup-{{ .Values.recovery.recoveryIndex }}"
s3Credentials:
accessKeyId:
name: {{ include "cluster.recoveryCredentials" . }}

View File

@@ -71,9 +71,20 @@ Generate backup server name
{{/*
Generate recovery server name
*/}}
{{- define "cluster.recoveryName" -}}
{{- if .Values.recovery.recoveryName -}}
{{- .Values.recovery.recoveryName -}}
{{- define "cluster.recoveryServerName" -}}
{{- if .Values.recovery.recoveryServerName -}}
{{- .Values.recovery.recoveryServerName -}}
{{- else -}}
{{- printf "%s-backup-%s" (include "cluster.name" .) .Values.recovery.recoveryIndex | trunc 63 | trimSuffix "-" -}}
{{- end }}
{{- end }}
{{/*
Generate recovery instance name
*/}}
{{- define "cluster.recoveryInstanceName" -}}
{{- if .Values.recovery.recoveryInstanceName -}}
{{- .Values.recovery.recoveryInstanceName -}}
{{- else -}}
{{ include "cluster.name" . }}
{{- end }}

View File

@@ -23,7 +23,7 @@ cluster:
image:
repository: ghcr.io/cloudnative-pg/postgresql
tag: "16.2-13"
tag: "16.2"
pullPolicy: IfNotPresent
# The UID and GID of the postgres user inside the image
@@ -107,11 +107,14 @@ recovery:
# Specifies secret that contains S3 credentials, should contain the keys ACCESS_KEY_ID and ACCESS_SECRET_KEY
endpointCredentials: ""
# Generate external cluster name, uses: postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.recovery.recoveryIndex }}"
# Generate external cluster name, uses: {{ .Release.Name }}postgresql-<major version>-cluster-backup-index-{{ .Values.recovery.recoveryIndex }}
recoveryIndex: 1
# Name of the recovery cluster in the object store, defaults to "cluster.name"
recoveryName: ""
recoveryServerName: ""
# Name of the recovery cluster in the object store, defaults to ".Release.Name"
recoveryInstanceName: ""
wal:
# WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`.