fix issues, no default backups
All checks were successful
release-charts-postgres-cluster / release (push) Successful in 18s

This commit is contained in:
2025-05-24 03:09:47 -05:00
parent a7150e1d20
commit 245212e878
7 changed files with 46 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v2
name: postgres-cluster
version: 6.2.1
version: 6.3.0
description: Cloudnative-pg Cluster
keywords:
- database

View File

@@ -1,6 +1,6 @@
# postgres-cluster
![Version: 6.2.1](https://img.shields.io/badge/Version-6.2.1-informational?style=flat-square) ![AppVersion: v1.26.0](https://img.shields.io/badge/AppVersion-v1.26.0-informational?style=flat-square)
![Version: 6.3.0](https://img.shields.io/badge/Version-6.3.0-informational?style=flat-square) ![AppVersion: v1.26.0](https://img.shields.io/badge/AppVersion-v1.26.0-informational?style=flat-square)
Cloudnative-pg Cluster
@@ -19,16 +19,11 @@ Cloudnative-pg Cluster
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| backup | object | `{"enabled":true,"method":"objectStore","objectStore":[],"scheduledBackups":[{"backupName":"external","backupOwnerReference":"self","name":"daily-backup","plugin":"barman-cloud.cloudnative-pg.io","schedule":"0 0 */3 * *","suspend":false}]}` | Backup settings |
| backup.enabled | bool | `true` | You need to configure backups manually, so backups are disabled by default. |
| backup | object | `{"enabled":false,"method":"objectStore","objectStore":[],"scheduledBackups":[]}` | Backup settings |
| backup.enabled | bool | `false` | You need to configure backups manually, so backups are disabled by default. |
| backup.method | string | `"objectStore"` | Method to create backups, options currently are only objectStore |
| backup.objectStore | list | `[]` | Options for object store backups |
| backup.scheduledBackups[0].backupName | string | `"external"` | Name of backup target |
| backup.scheduledBackups[0].backupOwnerReference | string | `"self"` | Backup owner reference |
| backup.scheduledBackups[0].name | string | `"daily-backup"` | Scheduled backup name |
| backup.scheduledBackups[0].plugin | string | `"barman-cloud.cloudnative-pg.io"` | Backup method, can be `barman-cloud.cloudnative-pg.io` (default) |
| backup.scheduledBackups[0].schedule | string | `"0 0 */3 * *"` | Schedule in cron format |
| backup.scheduledBackups[0].suspend | bool | `false` | Temporarily stop scheduled backups from running |
| backup.scheduledBackups | list | `[]` | List of scheduled backups |
| cluster | object | `{"additionalLabels":{},"affinity":{"enablePodAntiAffinity":true,"topologyKey":"kubernetes.io/hostname"},"annotations":{},"certificates":{},"enablePDB":true,"enableSuperuserAccess":false,"image":{"repository":"ghcr.io/cloudnative-pg/postgresql","tag":"17.5-1-bullseye"},"imagePullPolicy":"IfNotPresent","imagePullSecrets":[],"initdb":{},"instances":3,"logLevel":"info","monitoring":{"customQueries":[],"customQueriesSecret":[],"disableDefaultQueries":false,"enabled":false,"podMonitor":{"enabled":true,"metricRelabelings":[],"relabelings":[]},"prometheusRule":{"enabled":false,"excludeRules":[]}},"postgresGID":-1,"postgresUID":-1,"postgresql":{"ldap":{},"parameters":{"hot_standby_feedback":"on","max_slot_wal_keep_size":"2000MB","shared_buffers":"128MB"},"pg_hba":[],"pg_ident":[],"shared_preload_libraries":[],"synchronous":{}},"primaryUpdateMethod":"switchover","primaryUpdateStrategy":"unsupervised","priorityClassName":"","resources":{"limits":{"hugepages-2Mi":"256Mi"},"requests":{"cpu":"100m","memory":"256Mi"}},"roles":[],"serviceAccountTemplate":{},"services":{},"storage":{"size":"10Gi","storageClass":""},"superuserSecret":"","walStorage":{"enabled":true,"size":"2Gi","storageClass":""}}` | Cluster settings |
| cluster.affinity | object | `{"enablePodAntiAffinity":true,"topologyKey":"kubernetes.io/hostname"}` | Affinity/Anti-affinity rules for Pods. See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-AffinityConfiguration |
| cluster.certificates | object | `{}` | The configuration for the CA and related certificates. See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-CertificatesConfiguration |

View File

@@ -94,3 +94,10 @@ Generate name for recovery object store credentials
{{- printf "%s-backup-secret" (include "cluster.name" .) | trunc 63 | trimSuffix "-" -}}
{{- end }}
{{- end }}
{{/*
Generate name for backup object store credentials
*/}}
{{- define "cluster.backupCredentials" -}}
{{- printf "%s-backup-secret" (include "cluster.name" .) | trunc 63 | trimSuffix "-" -}}
{{- end }}

View File

@@ -22,15 +22,12 @@ spec:
{{ if or (eq .Values.backup.method "objectStore") (eq .Values.recovery.method "objectStore") }}
plugins:
{{ end }}
{{ if and (.Values.backup.enabled) (eq .Values.backup.method "objectStore") }}
{{ $context := . -}}
{{ range .Values.backup.objectStore -}}
{{- range $objectStore := .Values.backup.objectStore }}
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: {{ .isWALArchiver }}
isWALArchiver: {{ $objectStore.isWALArchiver }}
parameters:
barmanObjectName: "{{ include "cluster.name" $context }}-{{ .name }}-backup"
{{ end -}}
{{ end }}
barmanObjectName: "{{ include "cluster.name" $ }}-{{ $objectStore.name }}-backup"
{{- end }}
{{ if eq .Values.recovery.method "objectStore" }}
- name: barman-cloud.cloudnative-pg.io
parameters:

View File

@@ -27,10 +27,10 @@ spec:
{{- if .wal }}
wal:
compression: {{ .wal.compression | default "snappy" }}
{{- with .wal.encryption }}
{{ with .wal.encryption }}
encryption: {{ . }}
{{- end }}
maxParallel: {{ .wal.maxParallel | default 1 }}
{{ end }}
maxParallel: {{ .wal.maxParallel | default "1" }}
{{- end }}
{{- if .wal }}
data:
@@ -45,14 +45,14 @@ spec:
{{- if .endpointCredentials }}
name: {{ .endpointCredentials }}
{{- else }}
name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}}
name: {{ include "cluster.recoveryCredentials" $context }}
{{- end }}
key: ACCESS_KEY_ID
secretAccessKey:
{{- if .endpointCredentials }}
name: {{ .endpointCredentials }}
{{- else }}
name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}}
name: {{ include "cluster.recoveryCredentials" $context }}
{{- end }}
key: ACCESS_SECRET_KEY
{{ end -}}

View File

@@ -10,15 +10,15 @@ metadata:
labels:
{{- include "cluster.labels" $context | nindent 4 }}
spec:
immediate: true
suspend: {{ .suspend }}
schedule: {{ .schedule | quote }}
backupOwnerReference: {{ .backupOwnerReference }}
immediate: {{ .immediate | default true }}
suspend: {{ .suspend | default false }}
schedule: {{ .schedule | quote | required "Schedule is required" }}
backupOwnerReference: {{ .backupOwnerReference | default "self" }}
cluster:
name: {{ include "cluster.name" $context }}-cluster
method: plugin
pluginConfiguration:
name: {{ .plugin }}
name: {{ .plugin | default "barman-cloud.cloudnative-pg.io" }}
parameters:
barmanObjectName: "{{ include "cluster.name" $context }}-{{ .backupName }}-backup"
{{ end -}}

View File

@@ -418,7 +418,7 @@ recovery:
backup:
# -- You need to configure backups manually, so backups are disabled by default.
enabled: true
enabled: false
# -- Method to create backups, options currently are only objectStore
method: objectStore
@@ -485,25 +485,30 @@ backup:
# # -- Number of data files to be archived or restored in parallel.
# jobs: 1
scheduledBackups:
-
# -- Scheduled backup name
name: daily-backup
# -- List of scheduled backups
scheduledBackups: []
# -- Schedule in cron format
schedule: "0 0 */3 * *"
# -
# # -- Scheduled backup name
# name: daily-backup
# -- Temporarily stop scheduled backups from running
suspend: false
# # -- Schedule in cron format
# schedule: "0 0 */3 * *"
# -- Backup owner reference
backupOwnerReference: self
# # -- Start backup on deployment
# immediate: false
# -- Backup method, can be `barman-cloud.cloudnative-pg.io` (default)
plugin: barman-cloud.cloudnative-pg.io
# # -- Temporarily stop scheduled backups from running
# suspend: false
# -- Name of backup target
backupName: external
# # -- Backup owner reference
# backupOwnerReference: self
# # -- Backup method, can be `barman-cloud.cloudnative-pg.io` (default)
# plugin: barman-cloud.cloudnative-pg.io
# # -- Name of backup target
# backupName: external
# -- List of PgBouncer poolers
poolers: []