diff --git a/.github/environments/values.dev.yaml b/.github/environments/values.dev.yaml index 1b96a1ae..857d436a 100644 --- a/.github/environments/values.dev.yaml +++ b/.github/environments/values.dev.yaml @@ -50,3 +50,61 @@ postgres: limits: cpu: 100m memory: 512Mi + + # -------- backups --------- + pgBackRestConfig: + # allow one-off backups + manual: + repoName: repo1 + options: + - --type=full + configuration: + # secret for saving backups to S3 + - secret: + name: pgbackrest-s3 + global: + # log-level-console: debug + # --- pvc + repo1-retention-full: "3" + repo1-retention-diff: "12" + # --- s3 + repo2-path: /backups/common-object-management-service/postgres/dev + repo2-retention-full: "30" + repo2-s3-uri-style: path + repos: + - name: repo1 + schedules: + full: "0 7 * * *" # full backup every day at 7am + differential: "0 */2 * * *" # differential every 2 hours + volume: + volumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: 2Gi + storageClassName: "netapp-file-backup" + - name: repo2 + schedules: + full: "*/10 * * *" # full backup every 10 minutes + s3: + bucket: csstops + endpoint: https://nrs.objectstore.gov.bc.ca + region: us-east-1 + repoHost: + resources: + requests: + cpu: 1m + memory: 64Mi + limits: + cpu: 50m + memory: 128Mi + sidecars: + pgbackrest: + resources: + requests: + cpu: 1m + memory: 64Mi + limits: + cpu: 50m + memory: 128Mi diff --git a/charts/coms/Chart.yaml b/charts/coms/Chart.yaml index 5f087b0a..ff16894d 100644 --- a/charts/coms/Chart.yaml +++ b/charts/coms/Chart.yaml @@ -3,7 +3,7 @@ name: common-object-management-service # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.4 +version: 1.1.0 kubeVersion: ">= 1.13.0" description: A microservice for managing access control to S3 Objects # A chart can be either an 'application' or a 'library' chart. @@ -28,7 +28,7 @@ sources: - https://github.com/bcgov/common-object-management-service dependencies: - name: postgrescluster - version: 0.1.4 + version: 1.1.0 repository: "file://../postgres" condition: postgres.enabled alias: postgres diff --git a/charts/coms/values.yaml b/charts/coms/values.yaml index 4cb6b496..b1893b73 100644 --- a/charts/coms/values.yaml +++ b/charts/coms/values.yaml @@ -247,7 +247,3 @@ postgres: limits: cpu: 50m memory: 128Mi - - # -------- backups --------- - pgBackRestConfig: - repos: {} diff --git a/charts/postgres/Chart.yaml b/charts/postgres/Chart.yaml index 15cb7f03..6974cfa0 100644 --- a/charts/postgres/Chart.yaml +++ b/charts/postgres/Chart.yaml @@ -3,5 +3,5 @@ name: postgrescluster description: A Helm chart for Kubernetes type: application # The version below should match the version on the PostgresCluster CRD -version: 0.1.4 +version: 1.1.0 appVersion: 5.6.0 diff --git a/charts/postgres/templates/pgbackrest-s3-secret.yaml b/charts/postgres/templates/pgbackrest-s3-secret.yaml index 6af963c6..2d93e244 100644 --- a/charts/postgres/templates/pgbackrest-s3-secret.yaml +++ b/charts/postgres/templates/pgbackrest-s3-secret.yaml @@ -1,6 +1,4 @@ -{{- range $index, $repo := .Values.pgBackRestConfig.repos }} -{{- if $repo.s3 }} {{- $secretExists := (lookup "v1" "Secret" $.Release.Namespace "pgbackrest-s3" ) }} {{- if not $secretExists }} # this secret allows crunchyDb (pgbackrest) to connect to an S3 host for saving backups. @@ -18,5 +16,3 @@ stringData: repo2-s3-key= repo2-s3-key-secret= {{- end }} -{{- end }} -{{- end }}