From d29ed9f5fe687898956c3fb878e311013aef4c24 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Mon, 27 Sep 2021 10:14:49 -0300 Subject: [PATCH] Added pgdump backup hook to postgres pod --- .../v0.2.0/templates/velero-schedule-monthly.yaml | 11 +++++++++++ .../v0.2.0/templates/velero-schedule-weekdays.yaml | 11 +++++++++++ .../sapl/v0.2.0/templates/velero-schedule-weekly.yaml | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/charts/sapl/v0.2.0/templates/velero-schedule-monthly.yaml b/charts/sapl/v0.2.0/templates/velero-schedule-monthly.yaml index 3a20c7a..3ce62e7 100644 --- a/charts/sapl/v0.2.0/templates/velero-schedule-monthly.yaml +++ b/charts/sapl/v0.2.0/templates/velero-schedule-monthly.yaml @@ -40,5 +40,16 @@ spec: - --unfreeze - /var/interlegis/sapl/media timeout: 10s + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: "/opt/bitnami/postgresql/bin/pg_dump -U postgres sapl > /bitnami/postgresql/sapl.dump" + timeout: 360s useOwnerReferencesInBackup: false {{- end }} \ No newline at end of file diff --git a/charts/sapl/v0.2.0/templates/velero-schedule-weekdays.yaml b/charts/sapl/v0.2.0/templates/velero-schedule-weekdays.yaml index 9fe20e0..93bf293 100644 --- a/charts/sapl/v0.2.0/templates/velero-schedule-weekdays.yaml +++ b/charts/sapl/v0.2.0/templates/velero-schedule-weekdays.yaml @@ -40,5 +40,16 @@ spec: - --unfreeze - /var/interlegis/sapl/media timeout: 10s + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: "/opt/bitnami/postgresql/bin/pg_dump -U postgres sapl > /bitnami/postgresql/sapl.dump" + timeout: 360s useOwnerReferencesInBackup: false {{- end }} \ No newline at end of file diff --git a/charts/sapl/v0.2.0/templates/velero-schedule-weekly.yaml b/charts/sapl/v0.2.0/templates/velero-schedule-weekly.yaml index 79f0349..cd73756 100644 --- a/charts/sapl/v0.2.0/templates/velero-schedule-weekly.yaml +++ b/charts/sapl/v0.2.0/templates/velero-schedule-weekly.yaml @@ -40,5 +40,16 @@ spec: - --unfreeze - /var/interlegis/sapl/media timeout: 10s + - name: pgdump + includedResources: + - pods + labelSelector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: postgresql + pre: + - exec: + command: "/opt/bitnami/postgresql/bin/pg_dump -U postgres sapl > /bitnami/postgresql/sapl.dump" + timeout: 360s useOwnerReferencesInBackup: false {{- end }} \ No newline at end of file