Compare commits

...

2 Commits

Author SHA1 Message Date
245212e878 fix issues, no default backups
All checks were successful
release-charts-postgres-cluster / release (push) Successful in 18s
2025-05-24 03:09:47 -05:00
a7150e1d20 fix boolean
All checks were successful
release-charts-postgres-cluster / release (push) Successful in 39s
2025-05-24 02:15:47 -05:00
7 changed files with 47 additions and 43 deletions

View File

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

View File

@@ -1,6 +1,6 @@
# postgres-cluster # postgres-cluster
![Version: 6.2.0](https://img.shields.io/badge/Version-6.2.0-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 Cloudnative-pg Cluster
@@ -19,16 +19,11 @@ Cloudnative-pg Cluster
| Key | Type | Default | Description | | 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 | object | `{"enabled":false,"method":"objectStore","objectStore":[],"scheduledBackups":[]}` | Backup settings |
| backup.enabled | bool | `true` | You need to configure backups manually, so backups are disabled by default. | | 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.method | string | `"objectStore"` | Method to create backups, options currently are only objectStore |
| backup.objectStore | list | `[]` | Options for object store backups | | backup.objectStore | list | `[]` | Options for object store backups |
| backup.scheduledBackups[0].backupName | string | `"external"` | Name of backup target | | backup.scheduledBackups | list | `[]` | List of scheduled backups |
| 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 |
| 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 | 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.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 | | 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 "-" -}} {{- printf "%s-backup-secret" (include "cluster.name" .) | trunc 63 | trimSuffix "-" -}}
{{- end }} {{- end }}
{{- 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

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

View File

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

View File

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

View File

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