Skip to content

Commit fdb4382

Browse files
authored
Merge pull request #33 from vshn/feat/cnpg-restore
Add external ObjectStore reference for CNPG restore operations
2 parents 0b13a43 + 4697049 commit fdb4382

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ helm repo add appcat https://charts.appcat.ch
2020
| [![chart downloads](https://img.shields.io/github/downloads/vshn/appcat-charts/vshngaragebucket-0.0.1/total)](https://github.com/vshn/appcat-charts/releases/tag/vshngaragebucket-0.0.1) | [vshngaragebucket](charts/vshngaragebucket/README.md) |
2121
| [![chart downloads](https://img.shields.io/github/downloads/vshn/appcat-charts/vshngaragecluster-0.0.1/total)](https://github.com/vshn/appcat-charts/releases/tag/vshngaragecluster-0.0.1) | [vshngaragecluster](charts/vshngaragecluster/README.md) |
2222
| [![chart downloads](https://img.shields.io/github/downloads/vshn/appcat-charts/vshnmariadb-0.0.12/total)](https://github.com/vshn/appcat-charts/releases/tag/vshnmariadb-0.0.12) | [vshnmariadb](charts/vshnmariadb/README.md) |
23-
| [![chart downloads](https://img.shields.io/github/downloads/vshn/appcat-charts/vshnpostgresql-0.7.2/total)](https://github.com/vshn/appcat-charts/releases/tag/vshnpostgresql-0.7.2) | [vshnpostgresql](charts/vshnpostgresql/README.md) |
23+
| [![chart downloads](https://img.shields.io/github/downloads/vshn/appcat-charts/vshnpostgresql-0.8.0/total)](https://github.com/vshn/appcat-charts/releases/tag/vshnpostgresql-0.8.0) | [vshnpostgresql](charts/vshnpostgresql/README.md) |
2424

2525
## Add / Update Charts
2626

charts/vshnpostgresql/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ apiVersion: v2
2020
name: vshnpostgresql
2121
description: A Helm chart for PostgreSQL clusters using the CloudNativePG operator
2222
type: application
23-
version: 0.7.2
24-
appVersion: 0.7.2
23+
version: 0.8.0
24+
appVersion: 0.8.0
2525
maintainers:
2626
- name: Schedar Team
2727
email: info@vshn.ch

charts/vshnpostgresql/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# vshnpostgresql
22

3-
![Version: 0.7.2](https://img.shields.io/badge/Version-0.7.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.2](https://img.shields.io/badge/AppVersion-0.7.2-informational?style=flat-square)
3+
![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.0](https://img.shields.io/badge/AppVersion-0.8.0-informational?style=flat-square)
44

55
A Helm chart for PostgreSQL clusters using the CloudNativePG operator
66

@@ -210,6 +210,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentati
210210
| recovery.import.source.username | string | `""` | |
211211
| recovery.import.type | string | `"microservice"` | One of `microservice` or `monolith.` See: https://cloudnative-pg.io/documentation/current/database_import/#how-it-works |
212212
| recovery.method | string | `"backup"` | Available recovery methods: * `backup` - Recovers a CNPG cluster from a CNPG backup (PITR supported) Needs to be on the same cluster in the same namespace. * `object_store` - Recovers a CNPG cluster from a barman object store (PITR supported). * `pg_basebackup` - Recovers a CNPG cluster viaa streaming replication protocol. Useful if you want to migrate databases to CloudNativePG, even from outside Kubernetes. * `import` - Import one or more databases from an existing Postgres cluster. |
213+
| recovery.objectStoreName | string | `""` | Name of an externally managed ObjectStore to use for recovery. When set, the chart's own ObjectStore keeps backup credentials, and the external cluster references this ObjectStore instead. |
213214
| recovery.owner | string | `""` | Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key. |
214215
| recovery.pgBaseBackup.database | string | `"app"` | Name of the database used by the application. Default: `app`. |
215216
| recovery.pgBaseBackup.owner | string | `""` | Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key. |

charts/vshnpostgresql/templates/_external_clusters.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ externalClusters:
2020
plugin:
2121
name: barman-cloud.cloudnative-pg.io
2222
parameters:
23-
barmanObjectName: {{ include "cluster.fullname" $ }}-object-store
23+
barmanObjectName: {{ .Values.recovery.objectStoreName | default (printf "%s-object-store" (include "cluster.fullname" .)) }}
2424
serverName: {{ .Values.recovery.clusterName | default (include "cluster.fullname" .) }}
2525
{{- end }}
2626
{{- else if eq .Values.mode "replica" }}

charts/vshnpostgresql/templates/objectStore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
retentionPolicy: {{ . }}
1010
{{- end }}
1111
configuration:
12-
{{- if and (eq .Values.mode "recovery") (eq .Values.recovery.method "object_store") -}}
12+
{{- if and (eq .Values.mode "recovery") (eq .Values.recovery.method "object_store") (empty .Values.recovery.objectStoreName) -}}
1313
{{- $d := dict "chartFullname" (include "cluster.fullname" .) "scope" .Values.recovery "secretPrefix" "recovery" -}}
1414
{{- include "cluster.barmanObjectStoreConfig" $d | indent 2 }}
1515
{{- else }}

charts/vshnpostgresql/templates/recovery-s3-creds.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and (eq .Values.mode "recovery" ) (eq .Values.recovery.method "object_store") (eq .Values.recovery.provider "s3") (not .Values.recovery.s3.inheritFromIAMRole) .Values.recovery.secret.create }}
1+
{{- if and (eq .Values.mode "recovery" ) (eq .Values.recovery.method "object_store") (empty .Values.recovery.objectStoreName) (eq .Values.recovery.provider "s3") (not .Values.recovery.s3.inheritFromIAMRole) .Values.recovery.secret.create }}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/vshnpostgresql/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ recovery:
4949
##
5050
# -- The original cluster name when used in backups. Also known as serverName.
5151
clusterName: ""
52+
# -- Name of an externally managed ObjectStore to use for recovery.
53+
# When set, the chart's own ObjectStore keeps backup credentials,
54+
# and the external cluster references this ObjectStore instead.
55+
objectStoreName: ""
5256
# -- Name of the database used by the application. Default: `app`.
5357
database: app
5458
# -- Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key.

0 commit comments

Comments
 (0)