diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 98307cf..bb93756 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 6.1.1 +version: 6.2.0 description: Cloudnative-pg Cluster keywords: - database diff --git a/charts/postgres-cluster/README.md b/charts/postgres-cluster/README.md index 16ff181..043feb0 100644 --- a/charts/postgres-cluster/README.md +++ b/charts/postgres-cluster/README.md @@ -1,6 +1,6 @@ # 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.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) Cloudnative-pg Cluster @@ -19,27 +19,10 @@ Cloudnative-pg Cluster | 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.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[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:// Azure: https://..core.windows.net/ Google: gs:// | -| 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..amazonaws.com" | -| backup.objectStore[0].index | int | `1` | Generate external cluster name, uses: {{ .Release.Name }}-postgresql--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.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 | diff --git a/charts/postgres-cluster/templates/object-store.yaml b/charts/postgres-cluster/templates/object-store.yaml index 7560d8f..2e3b835 100644 --- a/charts/postgres-cluster/templates/object-store.yaml +++ b/charts/postgres-cluster/templates/object-store.yaml @@ -10,35 +10,39 @@ metadata: labels: {{- include "cluster.labels" $context | nindent 4 }} spec: - retentionPolicy: {{ .retentionPolicy }} + retentionPolicy: {{ .retentionPolicy | default "30d" }} configuration: - destinationPath: {{ .destinationPath }} - endpointURL: {{ .endpointURL }} - {{ if .endpointCA.name }} + destinationPath: {{ .destinationPath | required "Destination path is required" }} + endpointURL: {{ .endpointURL | default "https://nyc3.digitaloceanspaces.com" }} + {{- if .endpointCA }} endpointCA: name: {{ .endpointCA.name }} key: {{ .endpointCA.key }} - {{ end }} + {{- end }} {{- if .clusterName }} serverName: "{{ .clusterName }}-backup-{{ .index }}" {{- else }} serverName: "{{ include "cluster.name" $context }}-backup-{{ .index }}" {{- end }} + {{- if .wal }} wal: - compression: {{ .wal.compression }} - {{- with .wal.encryption}} + compression: {{ .wal.compression | default "snappy" }} + {{- with .wal.encryption }} encryption: {{ . }} {{- end }} - maxParallel: {{ .wal.maxParallel }} + maxParallel: {{ .wal.maxParallel | default 1 }} + {{- end }} + {{- if .wal }} data: - compression: {{ .data.compression }} + compression: {{ .data.compression | default "snappy" }} {{- with .data.encryption }} encryption: {{ . }} {{- end }} - jobs: {{ .data.jobs }} + jobs: {{ .data.jobs | default 1 }} + {{- end }} s3Credentials: accessKeyId: - {{- if not (empty .endpointCredentials) }} + {{- if .endpointCredentials }} name: {{ .endpointCredentials }} {{- else }} name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}} diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index fd5a134..6a893ec 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -424,65 +424,66 @@ backup: method: objectStore # -- Options for object store backups - objectStore: - - - # -- Object store backup name - name: external + objectStore: [] - # -- Overrides the provider specific default path. Defaults to: - # S3: s3:// - # Azure: https://..core.windows.net/ - # Google: gs:// - destinationPath: s3://postgres-backups + # - + # # -- Object store backup name + # name: external - # -- Overrides the provider specific default endpoint. Defaults to: - # S3: https://s3..amazonaws.com" - endpointURL: https://nyc3.digitaloceanspaces.com + # # -- Overrides the provider specific default path. Defaults to: + # # S3: s3:// + # # Azure: https://..core.windows.net/ + # # Google: gs:// + # destinationPath: "" - # -- Specifies a CA bundle to validate a privately signed certificate. - endpointCA: - # -- Creates a secret with the given value if true, otherwise uses an existing secret. - create: false + # # -- Overrides the provider specific default endpoint. Defaults to: + # # https://nyc3.digitaloceanspaces.com + # endpointURL: "" - name: "" - key: "" + # # -- Specifies a CA bundle to validate a privately signed certificate. + # 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--backup-index-{{ index }} - index: 1 + # name: "" + # key: "" - # -- Override the name of the backup cluster, defaults to "cluster.name" - clusterName: "" + # # -- Generate external cluster name, uses: {{ .Release.Name }}-postgresql--backup-index-{{ index }} + # index: 1 - # -- Specifies secret that contains S3 credentials, should contain the keys ACCESS_KEY_ID and ACCESS_SECRET_KEY - endpointCredentials: "" + # # -- Override the name of the backup cluster, defaults to "cluster.name" + # clusterName: "" - # -- Retention policy for backups - retentionPolicy: "30d" + # # -- Specifies secret that contains S3 credentials, should contain the keys ACCESS_KEY_ID and ACCESS_SECRET_KEY + # endpointCredentials: "" - # -- Specificies if this backup will do WALs - isWALArchiver: true + # # -- Retention policy for backups + # retentionPolicy: "30d" - # -- Storage - wal: + # # -- Specificies if this backup will do WALs + # isWALArchiver: true - # -- WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. - compression: snappy + # # -- Storage + # wal: - # -- Whether to instruct the storage provider to encrypt WAL files. One of `` (use the storage container default), `AES256` or `aws:kms`. - encryption: "" + # # -- WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. + # compression: snappy - # -- Number of WAL files to be archived or restored in parallel. - maxParallel: 1 + # # -- Whether to instruct the storage provider to encrypt WAL files. One of `` (use the storage container default), `AES256` or `aws:kms`. + # encryption: "" - data: - # -- Data compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. - compression: snappy + # # -- Number of WAL files to be archived or restored in parallel. + # maxParallel: 1 - # -- Whether to instruct the storage provider to encrypt data files. One of `` (use the storage container default), `AES256` or `aws:kms`. - encryption: "" + # data: + # # -- 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. - jobs: 1 + # # -- Whether to instruct the storage provider to encrypt data files. One of `` (use the storage container default), `AES256` or `aws:kms`. + # encryption: "" + + # # -- Number of data files to be archived or restored in parallel. + # jobs: 1 scheduledBackups: -