diff --git a/charts/cnpg-cluster/templates/backup-cron.yaml b/charts/cnpg-cluster/templates/backup-cron.yaml index 256bd8b..ef23a2a 100644 --- a/charts/cnpg-cluster/templates/backup-cron.yaml +++ b/charts/cnpg-cluster/templates/backup-cron.yaml @@ -47,8 +47,20 @@ spec: - name: AWS_ENDPOINT_URL value: {{ .Values.backup.barmanObjectStore.endpointURL }} - name: DESTINATION_PATH - value: {{ trimSuffix "/" .Values.backup.barmanObjectStore.destinationPath }}/dumps - envFrom: - - secretRef: - name: {{ .Values.backup.sqlDumpPgSecret }} + value: {{ trimSuffix "/" .Values.backup.barmanObjectStore.destinationPath }}/{{ include "cnpg-cluster.fullname" . }}/dumps + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: {{ include "cnpg-cluster.fullname" $ }}-superuser + key: password + - name: PGUSER + valueFrom: + secretKeyRef: + name: {{ include "cnpg-cluster.fullname" $ }}-superuser + key: username + - name: PGDATABASE + value: {{ .Values.dbName }} + - name: PGHOST + value: {{ include "cnpg-cluster.fullname" $ }}-r + {{- end}} diff --git a/charts/cnpg-cluster/tests/__snapshot__/cnpg-cluster_test.yaml.snap b/charts/cnpg-cluster/tests/__snapshot__/cnpg-cluster_test.yaml.snap index 6fb1f2b..2bbd706 100644 --- a/charts/cnpg-cluster/tests/__snapshot__/cnpg-cluster_test.yaml.snap +++ b/charts/cnpg-cluster/tests/__snapshot__/cnpg-cluster_test.yaml.snap @@ -35,10 +35,21 @@ cluster with enabled backup and recovery: - name: AWS_ENDPOINT_URL value: http://minio:9000 - name: DESTINATION_PATH - value: s3://backups/dumps - envFrom: - - secretRef: - name: pg-user-app + value: s3://backups/RELEASE-NAME-cnpg-cluster/dumps + - name: PGPASSWORD + valueFrom: + secretKeyRef: + key: password + name: RELEASE-NAME-cnpg-cluster-superuser + - name: PGUSER + valueFrom: + secretKeyRef: + key: username + name: RELEASE-NAME-cnpg-cluster-superuser + - name: PGDATABASE + value: app + - name: PGHOST + value: RELEASE-NAME-cnpg-cluster-r image: ghcr.io/socialgouv/docker/s3-client:1 imagePullPolicy: IfNotPresent name: s3-client diff --git a/charts/cnpg-cluster/values.yaml b/charts/cnpg-cluster/values.yaml index bfd66cc..fdd94bb 100644 --- a/charts/cnpg-cluster/values.yaml +++ b/charts/cnpg-cluster/values.yaml @@ -78,9 +78,6 @@ backup: # -- Schedule the SQL dump backups, for instance every Sunday sqlDumpSchedule: "0 0 * * 0" - # -- Secret where pg_dump will look for DB credentials - sqlDumpPgSecret: - # -- RetentionPolicy is the retention policy to be used for backups and WALs (i.e. '60d'). # The retention policy is expressed in the form of XXu where XX is a positive integer and # u is in [dwm] - days, weeks, months.