Compare commits

...

2 Commits

Author SHA1 Message Date
a7150e1d20 fix boolean
All checks were successful
release-charts-postgres-cluster / release (push) Successful in 39s
2025-05-24 02:15:47 -05:00
8d67cc9209 change values handling in backup
All checks were successful
release-charts-postgres-cluster / release (push) Successful in 12s
2025-05-24 02:07:42 -05:00
5 changed files with 64 additions and 76 deletions

View File

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

View File

@@ -1,6 +1,6 @@
# postgres-cluster # postgres-cluster
![Version: 6.1.1](https://img.shields.io/badge/Version-6.1.1-informational?style=flat-square) ![AppVersion: v1.26.0](https://img.shields.io/badge/AppVersion-v1.26.0-informational?style=flat-square) ![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)
Cloudnative-pg Cluster Cloudnative-pg Cluster
@@ -19,27 +19,10 @@ Cloudnative-pg Cluster
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| backup | object | `{"enabled":true,"method":"objectStore","objectStore":[{"clusterName":"","data":{"compression":"snappy","encryption":"","jobs":1},"destinationPath":"s3://postgres-backups","endpointCA":{"create":false,"key":"","name":""},"endpointCredentials":"","endpointURL":"https://nyc3.digitaloceanspaces.com","index":1,"isWALArchiver":true,"name":"external","retentionPolicy":"30d","wal":{"compression":"snappy","encryption":"","maxParallel":1}}],"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":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.enabled | bool | `true` | 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 | `[{"clusterName":"","data":{"compression":"snappy","encryption":"","jobs":1},"destinationPath":"s3://postgres-backups","endpointCA":{"create":false,"key":"","name":""},"endpointCredentials":"","endpointURL":"https://nyc3.digitaloceanspaces.com","index":1,"isWALArchiver":true,"name":"external","retentionPolicy":"30d","wal":{"compression":"snappy","encryption":"","maxParallel":1}}]` | Options for object store backups | | backup.objectStore | list | `[]` | Options for object store backups |
| backup.objectStore[0].clusterName | string | `""` | Override the name of the backup cluster, defaults to "cluster.name" |
| backup.objectStore[0].data.compression | string | `"snappy"` | Data compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. |
| backup.objectStore[0].data.encryption | string | `""` | Whether to instruct the storage provider to encrypt data files. One of `` (use the storage container default), `AES256` or `aws:kms`. |
| backup.objectStore[0].data.jobs | int | `1` | Number of data files to be archived or restored in parallel. |
| backup.objectStore[0].destinationPath | string | `"s3://postgres-backups"` | Overrides the provider specific default path. Defaults to: S3: s3://<bucket><path> Azure: https://<storageAccount>.<serviceName>.core.windows.net/<containerName><path> Google: gs://<bucket><path> |
| backup.objectStore[0].endpointCA | object | `{"create":false,"key":"","name":""}` | Specifies a CA bundle to validate a privately signed certificate. |
| backup.objectStore[0].endpointCA.create | bool | `false` | Creates a secret with the given value if true, otherwise uses an existing secret. |
| backup.objectStore[0].endpointCredentials | string | `""` | Specifies secret that contains S3 credentials, should contain the keys ACCESS_KEY_ID and ACCESS_SECRET_KEY |
| backup.objectStore[0].endpointURL | string | `"https://nyc3.digitaloceanspaces.com"` | Overrides the provider specific default endpoint. Defaults to: S3: https://s3.<region>.amazonaws.com" |
| backup.objectStore[0].index | int | `1` | Generate external cluster name, uses: {{ .Release.Name }}-postgresql-<major version>-backup-index-{{ index }} |
| backup.objectStore[0].isWALArchiver | bool | `true` | Specificies if this backup will do WALs |
| backup.objectStore[0].name | string | `"external"` | Object store backup name |
| backup.objectStore[0].retentionPolicy | string | `"30d"` | Retention policy for backups |
| backup.objectStore[0].wal | object | `{"compression":"snappy","encryption":"","maxParallel":1}` | Storage |
| backup.objectStore[0].wal.compression | string | `"snappy"` | WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. |
| backup.objectStore[0].wal.encryption | string | `""` | Whether to instruct the storage provider to encrypt WAL files. One of `` (use the storage container default), `AES256` or `aws:kms`. |
| backup.objectStore[0].wal.maxParallel | int | `1` | Number of WAL files to be archived or restored in parallel. |
| backup.scheduledBackups[0].backupName | string | `"external"` | Name of backup target | | backup.scheduledBackups[0].backupName | string | `"external"` | Name of backup target |
| backup.scheduledBackups[0].backupOwnerReference | string | `"self"` | Backup owner reference | | backup.scheduledBackups[0].backupOwnerReference | string | `"self"` | Backup owner reference |
| backup.scheduledBackups[0].name | string | `"daily-backup"` | Scheduled backup name | | backup.scheduledBackups[0].name | string | `"daily-backup"` | Scheduled backup name |

View File

@@ -19,7 +19,7 @@ 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") }} {{ if and (.Values.backup.enabled) (eq .Values.backup.method "objectStore") }}

View File

@@ -10,35 +10,39 @@ metadata:
labels: labels:
{{- include "cluster.labels" $context | nindent 4 }} {{- include "cluster.labels" $context | nindent 4 }}
spec: spec:
retentionPolicy: {{ .retentionPolicy }} retentionPolicy: {{ .retentionPolicy | default "30d" }}
configuration: configuration:
destinationPath: {{ .destinationPath }} destinationPath: {{ .destinationPath | required "Destination path is required" }}
endpointURL: {{ .endpointURL }} endpointURL: {{ .endpointURL | default "https://nyc3.digitaloceanspaces.com" }}
{{ if .endpointCA.name }} {{- if .endpointCA }}
endpointCA: endpointCA:
name: {{ .endpointCA.name }} name: {{ .endpointCA.name }}
key: {{ .endpointCA.key }} key: {{ .endpointCA.key }}
{{ end }} {{- end }}
{{- if .clusterName }} {{- if .clusterName }}
serverName: "{{ .clusterName }}-backup-{{ .index }}" serverName: "{{ .clusterName }}-backup-{{ .index }}"
{{- else }} {{- else }}
serverName: "{{ include "cluster.name" $context }}-backup-{{ .index }}" serverName: "{{ include "cluster.name" $context }}-backup-{{ .index }}"
{{- end }} {{- end }}
{{- if .wal }}
wal: wal:
compression: {{ .wal.compression }} compression: {{ .wal.compression | default "snappy" }}
{{- with .wal.encryption}} {{- with .wal.encryption }}
encryption: {{ . }} encryption: {{ . }}
{{- end }} {{- end }}
maxParallel: {{ .wal.maxParallel }} maxParallel: {{ .wal.maxParallel | default 1 }}
{{- end }}
{{- if .wal }}
data: data:
compression: {{ .data.compression }} compression: {{ .data.compression | default "snappy" }}
{{- with .data.encryption }} {{- with .data.encryption }}
encryption: {{ . }} encryption: {{ . }}
{{- end }} {{- end }}
jobs: {{ .data.jobs }} jobs: {{ .data.jobs | default 1 }}
{{- end }}
s3Credentials: s3Credentials:
accessKeyId: accessKeyId:
{{- if not (empty .endpointCredentials) }} {{- if .endpointCredentials }}
name: {{ .endpointCredentials }} name: {{ .endpointCredentials }}
{{- else }} {{- else }}
name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}} name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}}

View File

@@ -424,65 +424,66 @@ backup:
method: objectStore method: objectStore
# -- Options for object store backups # -- Options for object store backups
objectStore: objectStore: []
-
# -- Object store backup name
name: external
# -- Overrides the provider specific default path. Defaults to: # -
# S3: s3://<bucket><path> # # -- Object store backup name
# Azure: https://<storageAccount>.<serviceName>.core.windows.net/<containerName><path> # name: external
# Google: gs://<bucket><path>
destinationPath: s3://postgres-backups
# -- Overrides the provider specific default endpoint. Defaults to: # # -- Overrides the provider specific default path. Defaults to:
# S3: https://s3.<region>.amazonaws.com" # # S3: s3://<bucket><path>
endpointURL: https://nyc3.digitaloceanspaces.com # # Azure: https://<storageAccount>.<serviceName>.core.windows.net/<containerName><path>
# # Google: gs://<bucket><path>
# destinationPath: ""
# -- Specifies a CA bundle to validate a privately signed certificate. # # -- Overrides the provider specific default endpoint. Defaults to:
endpointCA: # # https://nyc3.digitaloceanspaces.com
# -- Creates a secret with the given value if true, otherwise uses an existing secret. # endpointURL: ""
create: false
name: "" # # -- Specifies a CA bundle to validate a privately signed certificate.
key: "" # endpointCA:
# # -- Creates a secret with the given value if true, otherwise uses an existing secret.
# create: false
# -- Generate external cluster name, uses: {{ .Release.Name }}-postgresql-<major version>-backup-index-{{ index }} # name: ""
index: 1 # key: ""
# -- Override the name of the backup cluster, defaults to "cluster.name" # # -- Generate external cluster name, uses: {{ .Release.Name }}-postgresql-<major version>-backup-index-{{ index }}
clusterName: "" # index: 1
# -- Specifies secret that contains S3 credentials, should contain the keys ACCESS_KEY_ID and ACCESS_SECRET_KEY # # -- Override the name of the backup cluster, defaults to "cluster.name"
endpointCredentials: "" # clusterName: ""
# -- Retention policy for backups # # -- Specifies secret that contains S3 credentials, should contain the keys ACCESS_KEY_ID and ACCESS_SECRET_KEY
retentionPolicy: "30d" # endpointCredentials: ""
# -- Specificies if this backup will do WALs # # -- Retention policy for backups
isWALArchiver: true # retentionPolicy: "30d"
# -- Storage # # -- Specificies if this backup will do WALs
wal: # isWALArchiver: true
# -- WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. # # -- Storage
compression: snappy # wal:
# -- Whether to instruct the storage provider to encrypt WAL files. One of `` (use the storage container default), `AES256` or `aws:kms`. # # -- WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`.
encryption: "" # compression: snappy
# -- Number of WAL files to be archived or restored in parallel. # # -- Whether to instruct the storage provider to encrypt WAL files. One of `` (use the storage container default), `AES256` or `aws:kms`.
maxParallel: 1 # encryption: ""
data: # # -- Number of WAL files to be archived or restored in parallel.
# -- Data compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. # maxParallel: 1
compression: snappy
# -- Whether to instruct the storage provider to encrypt data files. One of `` (use the storage container default), `AES256` or `aws:kms`. # data:
encryption: "" # # -- Data compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`.
# compression: snappy
# -- Number of data files to be archived or restored in parallel. # # -- Whether to instruct the storage provider to encrypt data files. One of `` (use the storage container default), `AES256` or `aws:kms`.
jobs: 1 # encryption: ""
# # -- Number of data files to be archived or restored in parallel.
# jobs: 1
scheduledBackups: scheduledBackups:
- -