From 30a976086212e8c4d9df0cc74e19b93e229b68b9 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 13:00:52 +0430 Subject: [PATCH 01/18] postgresql.host replaced with scopeName (Barman connection to postgres fixed) --- charts/barman/templates/configmap-barman-backups.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/barman/templates/configmap-barman-backups.yaml b/charts/barman/templates/configmap-barman-backups.yaml index 76ad5207e..08cb4a097 100644 --- a/charts/barman/templates/configmap-barman-backups.yaml +++ b/charts/barman/templates/configmap-barman-backups.yaml @@ -6,8 +6,8 @@ metadata: {{- include "barman.labels" . | nindent 4 }} data: {{- range .Values.barman.backups }} - {{ .postgresql.host }}.conf: | - [{{ .postgresql.host }}] + {{ .scopeName }}.conf: | + [{{ .scopeName }}] active = true description = "PostgreSQL Database (Streaming-Only)" conninfo = host={{ .postgresql.host }} user={{ .postgresql.superUser }} dbname={{ .postgresql.superUserDatabase }} From cfbc0ee3dc4cfe11f09e49929106323960a08c91 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 13:05:40 +0430 Subject: [PATCH 02/18] barman receive-wal is done via barman cron now + postgresql.host replaced with scopeName in configmap-barman-cron --- charts/barman/templates/configmap-barman-cron.yaml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/charts/barman/templates/configmap-barman-cron.yaml b/charts/barman/templates/configmap-barman-cron.yaml index aaa583376..33a82715d 100644 --- a/charts/barman/templates/configmap-barman-cron.yaml +++ b/charts/barman/templates/configmap-barman-cron.yaml @@ -7,19 +7,11 @@ metadata: data: barman: | {{- range .Values.barman.backups }} - {{- if hasKey . "createDatabaseSlot" }} - {{- if .createDatabaseSlot }} - * * * * * barman /usr/local/bin/barman receive-wal --create-slot {{ .postgresql.host }}; /usr/local/bin/barman cron - {{- end }} - {{- else }} - {{- if $.Values.barman.createDatabaseSlot }} - * * * * * barman /usr/local/bin/barman receive-wal --create-slot {{ .postgresql.host }}; /usr/local/bin/barman cron - {{- end }} - {{- end }} + * * * * * barman /usr/local/bin/barman cron {{- if hasKey . "backupSchedule" }} - {{ .backupSchedule }} barman /usr/local/bin/barman backup {{ .postgresql.host }} + {{ .backupSchedule }} barman /usr/local/bin/barman backup {{ .scopeName }} {{- else }} - {{ $.Values.barman.backupSchedule }} barman /usr/local/bin/barman backup {{ .postgresql.host }} + {{ $.Values.barman.backupSchedule }} barman /usr/local/bin/barman backup {{ .scopeName }} {{- end }} {{- end }} # required by cron From b1cb1b6395b5667a7757a7fb8dc017577b018904 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 13:10:38 +0430 Subject: [PATCH 03/18] postBackupRetryScript & preRecoveryRetryScript added to barman config --- charts/barman/templates/configmap-barman.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/charts/barman/templates/configmap-barman.yaml b/charts/barman/templates/configmap-barman.yaml index a7d9b2c5d..10f5058d5 100644 --- a/charts/barman/templates/configmap-barman.yaml +++ b/charts/barman/templates/configmap-barman.yaml @@ -19,18 +19,26 @@ data: barman_user = {{ .Values.barman.barmanUser }} + {{- if hasKey .Values.barman "postBackupRetryScript" }} + post_backup_retry_script = {{ .Values.barman.postBackupRetryScript }} + {{- end }} + + {{- if hasKey .Values.barman "preRecoveryRetryScript" }} + pre_recovery_retry_script = {{ .Values.barman.preRecoveryRetryScript }} + {{- end }} + ; barman_lock_directory = %(barman_home)s compression = {{ .Values.barman.compression }} configuration_files_directory = /etc/barman/barman.d last_backup_maximum_age = {{ .Values.barman.lastBackupMaximumAge }} - minimum_redundancy = 1 + minimum_redundancy = 0 ;network_compression = true retention_policy = {{ .Values.barman.retentionPolicy }} ; retention_policy_mode = auto - ;reuse_backup = link + ; reuse_backup = link streaming_archiver = on ; wal_retention_policy = main ; use empty log_file for stderr output log_file = "" - log_level = INFO + log_level = INFO \ No newline at end of file From 66cdf1ea37103836d434fa9a2f315711481c9519 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 13:13:22 +0430 Subject: [PATCH 04/18] configmap-entrypoint added --- .../templates/configmap-entrypoint.yaml | 45 +++++++++++++++++++ charts/barman/templates/deployment.yaml | 7 +++ 2 files changed, 52 insertions(+) create mode 100644 charts/barman/templates/configmap-entrypoint.yaml diff --git a/charts/barman/templates/configmap-entrypoint.yaml b/charts/barman/templates/configmap-entrypoint.yaml new file mode 100644 index 000000000..dddf0b7fd --- /dev/null +++ b/charts/barman/templates/configmap-entrypoint.yaml @@ -0,0 +1,45 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "barman.fullname" . }}-entrypoint + labels: + {{- include "barman.labels" . | nindent 4 }} +data: + entrypoint.sh: | + #!/bin/bash + + echo "Setting ownership/permissions on ${BARMAN_DATA_DIR} and ${BARMAN_LOG_DIR}" + + install -d -m 0700 -o barman -g barman ${BARMAN_DATA_DIR} + install -d -m 0755 -o barman -g barman ${BARMAN_LOG_DIR} + + chown -R barman:barman /var/lib/barman/recover + + echo "Checking/Creating replication slot" + {{- range .Values.barman.backups }} + {{- if hasKey . "createDatabaseSlot" }} + {{- if .createDatabaseSlot }} + barman replication-status {{ .scopeName }} --minimal --target=wal-streamer | grep barman || barman receive-wal --create-slot {{ .scopeName }} + barman replication-status {{ .scopeName }} --minimal --target=wal-streamer | grep barman || barman receive-wal --reset {{ .scopeName }} + {{- end }} + {{- else }} + {{- if $.Values.barman.createDatabaseSlot }} + barman replication-status {{ .scopeName }} --minimal --target=wal-streamer | grep barman || barman receive-wal --create-slot {{ .scopeName }} + barman replication-status {{ .scopeName }} --minimal --target=wal-streamer | grep barman || barman receive-wal --reset {{ .scopeName }} + {{- end }} + {{- end }} + {{- end }} + if [[ -f /home/barman/.ssh/id_rsa ]]; then + echo "Setting up Barman private key" + chmod 700 ~barman/.ssh + chown barman:barman -R ~barman/.ssh + chmod 600 ~barman/.ssh/id_rsa + fi + + echo "Initializing done" + + # run barman exporter every hour + exec /usr/local/bin/barman-exporter -l ${BARMAN_EXPORTER_LISTEN_ADDRESS}:${BARMAN_EXPORTER_LISTEN_PORT} -c ${BARMAN_EXPORTER_CACHE_TIME} & + echo "Started Barman exporter on ${BARMAN_EXPORTER_LISTEN_ADDRESS}:${BARMAN_EXPORTER_LISTEN_PORT}" + + exec "$@" diff --git a/charts/barman/templates/deployment.yaml b/charts/barman/templates/deployment.yaml index 9ec46e6f2..99f5fac58 100644 --- a/charts/barman/templates/deployment.yaml +++ b/charts/barman/templates/deployment.yaml @@ -73,6 +73,9 @@ spec: - mountPath: /etc/cron.d/barman name: barman-cron-config subPath: barman + - mountPath: /entrypoint.sh + name: barman-entrypoint + subPath: entrypoint.sh {{- with .Values.deployment.additionalVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -106,6 +109,10 @@ spec: - name: barman-cron-config configMap: name: {{ include "barman.fullname" . }}-cron-config + - name: barman-entrypoint + configMap: + name: {{ include "barman.fullname" . }}-entrypoint + defaultMode: 0775 {{- with .Values.deployment.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} From 363b5cc183a0c8944d47b90e9c0a3cd21b62bb71 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 13:20:52 +0430 Subject: [PATCH 05/18] additionalENVs added to configmap --- charts/barman/templates/configmap.yaml | 3 +++ charts/barman/values.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/charts/barman/templates/configmap.yaml b/charts/barman/templates/configmap.yaml index 4aaa7dae9..8674130ea 100644 --- a/charts/barman/templates/configmap.yaml +++ b/charts/barman/templates/configmap.yaml @@ -6,3 +6,6 @@ metadata: {{- include "barman.labels" . | nindent 4 }} data: BARMAN_BACKUP_SCHEDULE: {{ .Values.barman.backupSchedule | quote }} + {{- range $i, $val := .Values.deployment.additionalENVs }} + {{ $i }}: {{ $val }} + {{- end }} \ No newline at end of file diff --git a/charts/barman/values.yaml b/charts/barman/values.yaml index bfe3a3f1f..da8ee99ab 100644 --- a/charts/barman/values.yaml +++ b/charts/barman/values.yaml @@ -30,6 +30,9 @@ deployment: extraContainers: {} # -- Specify imagePullSecrets for the deployment imagePullSecrets: [] + # -- Specify additional envs + additionalENVs: {} + # TZ: "Asia/Tehran" service: # -- Specify if a Service should be created From 3c87e722261c4b706a74d571779ceeefaaafd9e6 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 13:42:02 +0430 Subject: [PATCH 06/18] values updated --- charts/barman/values.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/barman/values.yaml b/charts/barman/values.yaml index da8ee99ab..9f4508100 100644 --- a/charts/barman/values.yaml +++ b/charts/barman/values.yaml @@ -108,10 +108,18 @@ barman: databaseSlotName: barman # -- Create Database slot createDatabaseSlot: true + # -- postBackupRetryScript + postBackupRetryScript: + ## example: tar -zcvf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data . --remove-files + # preRecoveryRetryScript + preRecoveryRetryScript: + ## example: mkdir /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; tar -xvzf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; rm data.tar.gz backups: # -- Barman retention policy - retentionPolicy: "RECOVERY WINDOW of 1 MONTH" + # -- name of scope + scopeName: "pg" # -- Barman backup method backupMethod: postgres # -- Database slot name to be created/used From 5fcb93bc7d603e7b68efb09806bc225f643c45f5 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 13:58:07 +0430 Subject: [PATCH 07/18] descriptions added to README.md --- charts/barman/README.md | 4 ++++ charts/barman/templates/configmap-barman.yaml | 2 +- charts/barman/templates/configmap.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/barman/README.md b/charts/barman/README.md index 0e574e66a..35e3e95c5 100644 --- a/charts/barman/README.md +++ b/charts/barman/README.md @@ -23,6 +23,8 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | barman.backupMethod | string | `"postgres"` | Barman backup method | | barman.backupOptions | string | `"concurrent_backup"` | Barman backup options | | barman.backupSchedule | string | `"0 4 * * *"` | Barman backup schedule | +| barman.postBackupRetryScript | string | `""` | Barman `post_backup_retry_script` | +| barman.preRecoveryRetryScript | string | `""` | Barman `pre_recovery_retry_script` | | barman.backups[0] | object | `{"additionalConfiguration":"","backupMethod":"postgres","createDatabaseSlot":true,"databaseSlotName":"barman","lastBackupMaximumAge":"1 day","namespace":"postgresql","postgresql":{"host":"postgresql","port":5432,"replicationPassword":"barman","replicationUser":"barman","superUser":"postgres","superUserDatabase":"postgres","superUserPassword":"postgres"},"retentionPolicy":"RECOVERY WINDOW of 1 MONTH","serviceaccount":"postgresql"}` | Barman retention policy | | barman.backups[0].additionalConfiguration | string | `""` | Barman additional Parameters for configuration File | | barman.backups[0].backupMethod | string | `"postgres"` | Barman backup method | @@ -38,6 +40,7 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | barman.backups[0].postgresql.superUserDatabase | string | `"postgres"` | Postgresql super user database | | barman.backups[0].postgresql.superUserPassword | string | `"postgres"` | Postgresql super user password | | barman.backups[0].serviceaccount | string | `"postgresql"` | service account of the postgresql deployment, not active when barman.createRbac is false | +| barman.backups[0].postgresql.scopeName | string | `"pg"` | Postgresql server scope-name | | barman.barmanUser | string | `"barman"` | Barman user | | barman.compression | string | `"gzip"` | Barman backup compression | | barman.createDatabaseSlot | bool | `true` | Create Database slot | @@ -51,6 +54,7 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | deployment.imagePullSecrets | list | `[]` | Specify imagePullSecrets for the deployment | | deployment.podAnnotations | object | `{}` | Specify pod annotations | | deployment.strategy.type | string | `"RollingUpdate"` | Specify the strategy used to replace old Pods by new ones | +| deployment.additionalENVs | object | `{}` | Specify additional ENVs for Barman Deployment | | image.pullPolicy | string | `"Always"` | When to pull the container image | | image.repository | string | `"ubcctlt/barman"` | Container image to deploy | | image.tag | string | `""` | Overrides the image tag whose default is the chart version. | diff --git a/charts/barman/templates/configmap-barman.yaml b/charts/barman/templates/configmap-barman.yaml index 10f5058d5..8f2fb530c 100644 --- a/charts/barman/templates/configmap-barman.yaml +++ b/charts/barman/templates/configmap-barman.yaml @@ -41,4 +41,4 @@ data: ; use empty log_file for stderr output log_file = "" - log_level = INFO \ No newline at end of file + log_level = INFO diff --git a/charts/barman/templates/configmap.yaml b/charts/barman/templates/configmap.yaml index 8674130ea..40f1af9d3 100644 --- a/charts/barman/templates/configmap.yaml +++ b/charts/barman/templates/configmap.yaml @@ -8,4 +8,4 @@ data: BARMAN_BACKUP_SCHEDULE: {{ .Values.barman.backupSchedule | quote }} {{- range $i, $val := .Values.deployment.additionalENVs }} {{ $i }}: {{ $val }} - {{- end }} \ No newline at end of file + {{- end }} From e8e562b8bcd8932526b57b60c381bb9ac70b91e6 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 14:00:31 +0430 Subject: [PATCH 08/18] .helmignore file added --- charts/barman/templates/.helmignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 charts/barman/templates/.helmignore diff --git a/charts/barman/templates/.helmignore b/charts/barman/templates/.helmignore new file mode 100644 index 000000000..ddc4aa0aa --- /dev/null +++ b/charts/barman/templates/.helmignore @@ -0,0 +1,3 @@ +*.tgz +.vscode +.idea From 2e324cb00e8f84aa2f1bc28deae1b12e574c371b Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 14:02:17 +0430 Subject: [PATCH 09/18] .helmignore file moved --- charts/barman/{templates => }/.helmignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename charts/barman/{templates => }/.helmignore (100%) diff --git a/charts/barman/templates/.helmignore b/charts/barman/.helmignore similarity index 100% rename from charts/barman/templates/.helmignore rename to charts/barman/.helmignore From 306465bddbbb5b33666cffa4f6b614003be61f98 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 14:11:01 +0430 Subject: [PATCH 10/18] maintainers modified in Chart.yaml --- charts/barman/Chart.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/barman/Chart.yaml b/charts/barman/Chart.yaml index 69969584b..5ff4dec8a 100644 --- a/charts/barman/Chart.yaml +++ b/charts/barman/Chart.yaml @@ -17,3 +17,6 @@ maintainers: - name: adfinis-sygroup email: support@adfinis.com url: https://adfinis.com + - name: Basalam + email: mojtaba.shahin@basalam.com + url: https://basalam.com/ From a1d10e8f5ecfc4a85135d84a445693c143910e18 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 14:48:34 +0430 Subject: [PATCH 11/18] chart version updated --- charts/barman/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/barman/Chart.yaml b/charts/barman/Chart.yaml index 5ff4dec8a..22fb6b0ba 100644 --- a/charts/barman/Chart.yaml +++ b/charts/barman/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: barman type: application description: Chart for Barman PostgreSQL Backup and Recovery Manager -version: 0.8.1 +version: 0.8.2 appVersion: "v2.19" keywords: - barman From 89c5821233a7fecc114622ea94696d39306f6f26 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 17:54:33 +0430 Subject: [PATCH 12/18] white-spaces fixed ;) --- charts/barman/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/barman/values.yaml b/charts/barman/values.yaml index 9f4508100..e2f856fd8 100644 --- a/charts/barman/values.yaml +++ b/charts/barman/values.yaml @@ -109,10 +109,10 @@ barman: # -- Create Database slot createDatabaseSlot: true # -- postBackupRetryScript - postBackupRetryScript: + postBackupRetryScript: "" ## example: tar -zcvf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data . --remove-files # preRecoveryRetryScript - preRecoveryRetryScript: + preRecoveryRetryScript: "" ## example: mkdir /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; tar -xvzf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; rm data.tar.gz backups: From e568b2d595873d81cf15ee31a7093eb8fc9b3de7 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Sat, 18 Jun 2022 23:27:45 +0430 Subject: [PATCH 13/18] README.md adapted with comments in values.yaml --- charts/barman/README.md | 12 ++++++------ charts/barman/examples/barman.yaml | 5 +++++ charts/barman/values.yaml | 11 ++++------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/charts/barman/README.md b/charts/barman/README.md index 35e3e95c5..9b4d7f447 100644 --- a/charts/barman/README.md +++ b/charts/barman/README.md @@ -1,6 +1,6 @@ # barman -![Version: 0.8.1](https://img.shields.io/badge/Version-0.8.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.19](https://img.shields.io/badge/AppVersion-v2.19-informational?style=flat-square) +![Version: 0.8.2](https://img.shields.io/badge/Version-0.8.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.19](https://img.shields.io/badge/AppVersion-v2.19-informational?style=flat-square) Chart for Barman PostgreSQL Backup and Recovery Manager @@ -23,15 +23,16 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | barman.backupMethod | string | `"postgres"` | Barman backup method | | barman.backupOptions | string | `"concurrent_backup"` | Barman backup options | | barman.backupSchedule | string | `"0 4 * * *"` | Barman backup schedule | -| barman.postBackupRetryScript | string | `""` | Barman `post_backup_retry_script` | -| barman.preRecoveryRetryScript | string | `""` | Barman `pre_recovery_retry_script` | -| barman.backups[0] | object | `{"additionalConfiguration":"","backupMethod":"postgres","createDatabaseSlot":true,"databaseSlotName":"barman","lastBackupMaximumAge":"1 day","namespace":"postgresql","postgresql":{"host":"postgresql","port":5432,"replicationPassword":"barman","replicationUser":"barman","superUser":"postgres","superUserDatabase":"postgres","superUserPassword":"postgres"},"retentionPolicy":"RECOVERY WINDOW of 1 MONTH","serviceaccount":"postgresql"}` | Barman retention policy | +| barman.postBackupRetryScript | string | `""` | Barman post_backup_retry_script | +| barman.preRecoveryRetryScript | string | `""` | Barman pre_recovery_retry_script | +| barman.backups[0] | object | `{"additionalConfiguration":"","backupMethod":"postgres","createDatabaseSlot":true,"databaseSlotName":"barman","lastBackupMaximumAge":"1 day","namespace":"postgresql","postgresql":{"host":"postgresql","port":5432,"replicationPassword":"barman","replicationUser":"barman","superUser":"postgres","superUserDatabase":"postgres","superUserPassword":"postgres"},"retentionPolicy":"RECOVERY WINDOW of 1 MONTH","scopeName":"pg","serviceaccount":"postgresql"}` | Barman retention policy | | barman.backups[0].additionalConfiguration | string | `""` | Barman additional Parameters for configuration File | | barman.backups[0].backupMethod | string | `"postgres"` | Barman backup method | | barman.backups[0].createDatabaseSlot | bool | `true` | Create Database slot | | barman.backups[0].databaseSlotName | string | `"barman"` | Database slot name to be created/used | | barman.backups[0].lastBackupMaximumAge | string | `"1 day"` | Barman last backup maximum age | | barman.backups[0].namespace | string | `"postgresql"` | namespace where postgresql is deployed, not active when barman.createRbac is false | +| barman.backups[0].scopeName | string | `"pg"` | Postgresql server scope-name | | barman.backups[0].postgresql.host | string | `"postgresql"` | Postgresql host | | barman.backups[0].postgresql.port | int | `5432` | Postgresql port | | barman.backups[0].postgresql.replicationPassword | string | `"barman"` | Postgresql replication password | @@ -40,7 +41,6 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | barman.backups[0].postgresql.superUserDatabase | string | `"postgres"` | Postgresql super user database | | barman.backups[0].postgresql.superUserPassword | string | `"postgres"` | Postgresql super user password | | barman.backups[0].serviceaccount | string | `"postgresql"` | service account of the postgresql deployment, not active when barman.createRbac is false | -| barman.backups[0].postgresql.scopeName | string | `"pg"` | Postgresql server scope-name | | barman.barmanUser | string | `"barman"` | Barman user | | barman.compression | string | `"gzip"` | Barman backup compression | | barman.createDatabaseSlot | bool | `true` | Create Database slot | @@ -54,7 +54,7 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | deployment.imagePullSecrets | list | `[]` | Specify imagePullSecrets for the deployment | | deployment.podAnnotations | object | `{}` | Specify pod annotations | | deployment.strategy.type | string | `"RollingUpdate"` | Specify the strategy used to replace old Pods by new ones | -| deployment.additionalENVs | object | `{}` | Specify additional ENVs for Barman Deployment | +| deployment.additionalENVs | object | `{}` | Specify additional ENVs for the Deployment | | image.pullPolicy | string | `"Always"` | When to pull the container image | | image.repository | string | `"ubcctlt/barman"` | Container image to deploy | | image.tag | string | `""` | Overrides the image tag whose default is the chart version. | diff --git a/charts/barman/examples/barman.yaml b/charts/barman/examples/barman.yaml index d9142f249..30e1d6bf2 100644 --- a/charts/barman/examples/barman.yaml +++ b/charts/barman/examples/barman.yaml @@ -15,6 +15,8 @@ deployment: # deployment.strategy needs to be set to Recreate if the underlying PVC does # not support multi-attach. type: Recreate + additionalENVs: + TZ: "Asia/Tehran" resources: requests: cpu: 100m @@ -75,10 +77,13 @@ barman: lastBackupMaximumAge: "1 day" backupSchedule: "0 4 * * *" databaseSlotName: barman + postBackupRetryScript: tar -zcvf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data . --remove-files + preRecoveryRetryScript: mkdir /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; tar -xvzf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; rm data.tar.gz # server specific backup configs, add an entry for each db you backup backups: - backupMethod: postgres backupSchedule: "0 4 * * *" + scopeName: "pg" databaseSlotName: barman lastBackupMaximumAge: "1 day" # namespace the db is in diff --git a/charts/barman/values.yaml b/charts/barman/values.yaml index e2f856fd8..63eff907f 100644 --- a/charts/barman/values.yaml +++ b/charts/barman/values.yaml @@ -30,9 +30,8 @@ deployment: extraContainers: {} # -- Specify imagePullSecrets for the deployment imagePullSecrets: [] - # -- Specify additional envs + # -- Specify additional ENVs for the Deployment additionalENVs: {} - # TZ: "Asia/Tehran" service: # -- Specify if a Service should be created @@ -108,17 +107,15 @@ barman: databaseSlotName: barman # -- Create Database slot createDatabaseSlot: true - # -- postBackupRetryScript + # -- Barman post_backup_retry_script postBackupRetryScript: "" - ## example: tar -zcvf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data . --remove-files - # preRecoveryRetryScript + # -- Barman pre_recovery_retry_script preRecoveryRetryScript: "" - ## example: mkdir /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; tar -xvzf data.tar.gz -C /var/lib/barman/pg/base/$BARMAN_BACKUP_ID/data; rm data.tar.gz backups: # -- Barman retention policy - retentionPolicy: "RECOVERY WINDOW of 1 MONTH" - # -- name of scope + # -- Postgresql server scope-name scopeName: "pg" # -- Barman backup method backupMethod: postgres From d8a609a7a537ba9d76778a1cddec26eee3974cb8 Mon Sep 17 00:00:00 2001 From: Mojtaba Shahin <82509720+mojtabash78@users.noreply.github.com> Date: Mon, 20 Jun 2022 11:29:36 +0430 Subject: [PATCH 14/18] Chart version fixed Co-authored-by: Lukas Grossar --- charts/barman/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/barman/Chart.yaml b/charts/barman/Chart.yaml index 22fb6b0ba..c4e114895 100644 --- a/charts/barman/Chart.yaml +++ b/charts/barman/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: barman type: application description: Chart for Barman PostgreSQL Backup and Recovery Manager -version: 0.8.2 +version: 0.9.0 appVersion: "v2.19" keywords: - barman From dc122389c3e314e3ba45a07ceb8a6c383d583cdb Mon Sep 17 00:00:00 2001 From: Mojtaba Shahin <82509720+mojtabash78@users.noreply.github.com> Date: Mon, 20 Jun 2022 11:30:08 +0430 Subject: [PATCH 15/18] maintainer list fixed Co-authored-by: Lukas Grossar --- charts/barman/Chart.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/charts/barman/Chart.yaml b/charts/barman/Chart.yaml index c4e114895..afb4a848e 100644 --- a/charts/barman/Chart.yaml +++ b/charts/barman/Chart.yaml @@ -17,6 +17,3 @@ maintainers: - name: adfinis-sygroup email: support@adfinis.com url: https://adfinis.com - - name: Basalam - email: mojtaba.shahin@basalam.com - url: https://basalam.com/ From 0520f8af4ac4cc7fc4a56e8b45002f4a06ff540b Mon Sep 17 00:00:00 2001 From: Mojtaba Shahin <82509720+mojtabash78@users.noreply.github.com> Date: Mon, 20 Jun 2022 11:46:43 +0430 Subject: [PATCH 16/18] small change in configmap-barman Co-authored-by: Lukas Grossar --- charts/barman/templates/configmap-barman.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/barman/templates/configmap-barman.yaml b/charts/barman/templates/configmap-barman.yaml index 8f2fb530c..62214d878 100644 --- a/charts/barman/templates/configmap-barman.yaml +++ b/charts/barman/templates/configmap-barman.yaml @@ -35,7 +35,7 @@ data: ;network_compression = true retention_policy = {{ .Values.barman.retentionPolicy }} ; retention_policy_mode = auto - ; reuse_backup = link + ;reuse_backup = link streaming_archiver = on ; wal_retention_policy = main From e8f63ad900e3b3cc92d8a8c90fcf2adfc974608a Mon Sep 17 00:00:00 2001 From: Mojtaba Shahin <82509720+mojtabash78@users.noreply.github.com> Date: Mon, 20 Jun 2022 12:09:56 +0430 Subject: [PATCH 17/18] minimum_redundancy set to 1 Co-authored-by: Lukas Grossar --- charts/barman/templates/configmap-barman.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/barman/templates/configmap-barman.yaml b/charts/barman/templates/configmap-barman.yaml index 62214d878..530a6af5a 100644 --- a/charts/barman/templates/configmap-barman.yaml +++ b/charts/barman/templates/configmap-barman.yaml @@ -31,7 +31,7 @@ data: compression = {{ .Values.barman.compression }} configuration_files_directory = /etc/barman/barman.d last_backup_maximum_age = {{ .Values.barman.lastBackupMaximumAge }} - minimum_redundancy = 0 + minimum_redundancy = 1 ;network_compression = true retention_policy = {{ .Values.barman.retentionPolicy }} ; retention_policy_mode = auto From 044ba311a74fcacc72624d129f3e93599341efff Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Mon, 20 Jun 2022 13:14:34 +0430 Subject: [PATCH 18/18] README.md lines order fixed --- charts/barman/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/barman/README.md b/charts/barman/README.md index 9b4d7f447..a00d07315 100644 --- a/charts/barman/README.md +++ b/charts/barman/README.md @@ -1,6 +1,6 @@ # barman -![Version: 0.8.2](https://img.shields.io/badge/Version-0.8.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.19](https://img.shields.io/badge/AppVersion-v2.19-informational?style=flat-square) +![Version: 0.9.0](https://img.shields.io/badge/Version-0.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.19](https://img.shields.io/badge/AppVersion-v2.19-informational?style=flat-square) Chart for Barman PostgreSQL Backup and Recovery Manager @@ -23,8 +23,6 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | barman.backupMethod | string | `"postgres"` | Barman backup method | | barman.backupOptions | string | `"concurrent_backup"` | Barman backup options | | barman.backupSchedule | string | `"0 4 * * *"` | Barman backup schedule | -| barman.postBackupRetryScript | string | `""` | Barman post_backup_retry_script | -| barman.preRecoveryRetryScript | string | `""` | Barman pre_recovery_retry_script | | barman.backups[0] | object | `{"additionalConfiguration":"","backupMethod":"postgres","createDatabaseSlot":true,"databaseSlotName":"barman","lastBackupMaximumAge":"1 day","namespace":"postgresql","postgresql":{"host":"postgresql","port":5432,"replicationPassword":"barman","replicationUser":"barman","superUser":"postgres","superUserDatabase":"postgres","superUserPassword":"postgres"},"retentionPolicy":"RECOVERY WINDOW of 1 MONTH","scopeName":"pg","serviceaccount":"postgresql"}` | Barman retention policy | | barman.backups[0].additionalConfiguration | string | `""` | Barman additional Parameters for configuration File | | barman.backups[0].backupMethod | string | `"postgres"` | Barman backup method | @@ -32,7 +30,6 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | barman.backups[0].databaseSlotName | string | `"barman"` | Database slot name to be created/used | | barman.backups[0].lastBackupMaximumAge | string | `"1 day"` | Barman last backup maximum age | | barman.backups[0].namespace | string | `"postgresql"` | namespace where postgresql is deployed, not active when barman.createRbac is false | -| barman.backups[0].scopeName | string | `"pg"` | Postgresql server scope-name | | barman.backups[0].postgresql.host | string | `"postgresql"` | Postgresql host | | barman.backups[0].postgresql.port | int | `5432` | Postgresql port | | barman.backups[0].postgresql.replicationPassword | string | `"barman"` | Postgresql replication password | @@ -40,13 +37,17 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | barman.backups[0].postgresql.superUser | string | `"postgres"` | Postgresql super user | | barman.backups[0].postgresql.superUserDatabase | string | `"postgres"` | Postgresql super user database | | barman.backups[0].postgresql.superUserPassword | string | `"postgres"` | Postgresql super user password | +| barman.backups[0].scopeName | string | `"pg"` | Postgresql server scope-name | | barman.backups[0].serviceaccount | string | `"postgresql"` | service account of the postgresql deployment, not active when barman.createRbac is false | | barman.barmanUser | string | `"barman"` | Barman user | | barman.compression | string | `"gzip"` | Barman backup compression | | barman.createDatabaseSlot | bool | `true` | Create Database slot | | barman.databaseSlotName | string | `"barman"` | Database slot name to be created/used | | barman.lastBackupMaximumAge | string | `"1 day"` | Barman last backup maximum age | +| barman.postBackupRetryScript | string | `""` | Barman post_backup_retry_script | +| barman.preRecoveryRetryScript | string | `""` | Barman pre_recovery_retry_script | | barman.retentionPolicy | string | `"RECOVERY WINDOW of 1 MONTH"` | Barman retention policy | +| deployment.additionalENVs | object | `{}` | Specify additional ENVs for the Deployment | | deployment.additionalVolumeMounts | list | `[]` | Specify additional VolumeMounts for the barman container | | deployment.additionalVolumes | list | `[]` | Specify additional Volumes for the deployment | | deployment.annotations | object | `{}` | Specify deployment annotations | @@ -54,7 +55,6 @@ This chart is maintained by [Adfinis](https://adfinis.com/?pk_campaign=github&pk | deployment.imagePullSecrets | list | `[]` | Specify imagePullSecrets for the deployment | | deployment.podAnnotations | object | `{}` | Specify pod annotations | | deployment.strategy.type | string | `"RollingUpdate"` | Specify the strategy used to replace old Pods by new ones | -| deployment.additionalENVs | object | `{}` | Specify additional ENVs for the Deployment | | image.pullPolicy | string | `"Always"` | When to pull the container image | | image.repository | string | `"ubcctlt/barman"` | Container image to deploy | | image.tag | string | `""` | Overrides the image tag whose default is the chart version. |