From bdcc3ac312110782792042201f7c8fa11dd9fd5c Mon Sep 17 00:00:00 2001 From: Sukanya Rath <98050194+sukanya-rath@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:41:38 -0700 Subject: [PATCH] chore(crunchy): changes for crunchy-postgres to have local pvc backup in openshift (#536) --- .../templates/PostgresCluster.yaml | 15 +++++++++++++++ charts/fin-pay-transparency/values-dev.yaml | 9 +++++++++ charts/fin-pay-transparency/values-prod.yaml | 10 ++++++++++ charts/fin-pay-transparency/values-test.yaml | 10 ++++++++++ charts/fin-pay-transparency/values.yaml | 13 +++++++++++-- 5 files changed, 55 insertions(+), 2 deletions(-) diff --git a/charts/fin-pay-transparency/charts/crunchy-postgres/templates/PostgresCluster.yaml b/charts/fin-pay-transparency/charts/crunchy-postgres/templates/PostgresCluster.yaml index c51cb3138..f523dfa27 100644 --- a/charts/fin-pay-transparency/charts/crunchy-postgres/templates/PostgresCluster.yaml +++ b/charts/fin-pay-transparency/charts/crunchy-postgres/templates/PostgresCluster.yaml @@ -116,6 +116,9 @@ spec: repo1-retention-full-type: {{ .Values.pgBackRest.retentionFullType }} repo1-path: '{{ .Values.pgBackRest.backupPath }}/{{ .Values.pgBackRest.clusterCounter}}' repo1-s3-uri-style: path + + repo2-retention-full: {{ .Values.pgBackRest.pvc.retention | quote }} + repo2-retention-full-type: {{ .Values.pgBackRest.pvc.retentionFullType }} repos: - name: repo1 schedules: @@ -125,6 +128,18 @@ spec: bucket: {{ .Values.pgBackRest.s3.bucket }} endpoint: {{ .Values.pgBackRest.s3.endpoint }} region: "ca-central-1" + - name: repo2 + schedules: + full: {{ .Values.pgBackRest.pvc.fullBackupSchedule }} + incremental: {{ .Values.pgBackRest.pvc.incrementalBackupSchedule }} + volume: + volumeClaimSpec: + accessModes: + - {{ .Values.pgBackRest.pvc.volume.accessModes }} + resources: + requests: + storage: {{ .Values.pgBackRest.pvc.volume.storage }} + storageClassName: {{ .Values.pgBackRest.pvc.volume.storageClassName }} {{- if and .Values.restore .Values.restore.enabled }} restore: enabled: {{ .Values.restore.enabled }} diff --git a/charts/fin-pay-transparency/values-dev.yaml b/charts/fin-pay-transparency/values-dev.yaml index c00c8b498..c8631a572 100644 --- a/charts/fin-pay-transparency/values-dev.yaml +++ b/charts/fin-pay-transparency/values-dev.yaml @@ -202,6 +202,15 @@ crunchy: secretKey: ~ fullBackupSchedule: 0 9 * * * incrementalBackupSchedule: "0 0,4,8,12,16 * * *" # every 4 hours, but 9 is not put intentionally to avoid conflict with full backup + pvc: + retention: "1" + retentionFullType: count + fullBackupSchedule: 0 8 * * * + incrementalBackupSchedule: 0 0,4,12,16,20 * * * + volume: + accessModes: "ReadWriteOnce" + storage: 64Mi + storageClassName: netapp-file-backup config: requests: cpu: 5m diff --git a/charts/fin-pay-transparency/values-prod.yaml b/charts/fin-pay-transparency/values-prod.yaml index f53cf3e0d..8c0bdc252 100644 --- a/charts/fin-pay-transparency/values-prod.yaml +++ b/charts/fin-pay-transparency/values-prod.yaml @@ -203,6 +203,16 @@ crunchy: secretKey: ~ fullBackupSchedule: 0 9 * * * incrementalBackupSchedule: "0 0,1,3,5,7,11,13,15,17,19,21,23 * * *" # every 2 hours, but 9 is not put intentionally to avoid conflict with full backup + pvc: + retention: "1" + retentionFullType: count + fullBackupSchedule: 0 8 * * * + incrementalBackupSchedule: 0 0,4,12,16,20 * * * + volume: + accessModes: "ReadWriteOnce" + storage: 64Mi + storageClassName: netapp-file-backup + config: requests: cpu: 5m diff --git a/charts/fin-pay-transparency/values-test.yaml b/charts/fin-pay-transparency/values-test.yaml index 429be7f5e..400658382 100644 --- a/charts/fin-pay-transparency/values-test.yaml +++ b/charts/fin-pay-transparency/values-test.yaml @@ -200,6 +200,16 @@ crunchy: secretKey: ~ fullBackupSchedule: 0 9 * * * incrementalBackupSchedule: "0 0,4,8,12,16 * * *" # every 4 hours, but 9 is not put intentionally to avoid conflict with full backup + pvc: + retention: "1" + retentionFullType: count + fullBackupSchedule: 0 8 * * * + incrementalBackupSchedule: 0 0,4,12,16,20 * * * + volume: + accessModes: "ReadWriteOnce" + storage: 64Mi + storageClassName: netapp-file-backup + config: requests: cpu: 5m diff --git a/charts/fin-pay-transparency/values.yaml b/charts/fin-pay-transparency/values.yaml index bd0be320e..78c592901 100644 --- a/charts/fin-pay-transparency/values.yaml +++ b/charts/fin-pay-transparency/values.yaml @@ -180,8 +180,8 @@ admin-frontend: logLevel: info autoscaling: enabled: true - minReplicas: 1 - maxReplicas: 2 + minReplicas: 2 + maxReplicas: 3 targetCPUUtilizationPercentage: 80 # this percentage from request cpu podSecurityContext: {} securityContext: @@ -251,6 +251,15 @@ crunchy: secretKey: ~ fullBackupSchedule: 0 9 * * * incrementalBackupSchedule: "0 0,4,8,12,16 * * *" # every 4 hours, but 9 is not put intentionally to avoid conflict with full backup + pvc: + retention: "1" + retentionFullType: count + fullBackupSchedule: 0 8 * * * + incrementalBackupSchedule: 0 0,4,12,16,20 * * * + volume: + accessModes: "ReadWriteOnce" + storage: 64Mi + storageClassName: netapp-file-backup config: requests: cpu: 5m