diff --git a/charts/stable/zalando-postgres-cluster/CHANGELOG.md b/charts/stable/zalando-postgres-cluster/CHANGELOG.md index e0af0ab8..adf81b4c 100644 --- a/charts/stable/zalando-postgres-cluster/CHANGELOG.md +++ b/charts/stable/zalando-postgres-cluster/CHANGELOG.md @@ -4,9 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.2.0] +### Changed + +- Support for persistence volume settings in dumpBackup ## [1.0.0] ### Changed -- Initial version \ No newline at end of file +- Initial version diff --git a/charts/stable/zalando-postgres-cluster/Chart.yaml b/charts/stable/zalando-postgres-cluster/Chart.yaml index d5ffaa75..c0ca57de 100644 --- a/charts/stable/zalando-postgres-cluster/Chart.yaml +++ b/charts/stable/zalando-postgres-cluster/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -version: 2.1.0 +version: 2.2.0 description: Creates a postgres cluster using the Zalando Postgres operator and local storage name: zalando-postgres-cluster appVersion: 1.0.0 diff --git a/charts/stable/zalando-postgres-cluster/README.md b/charts/stable/zalando-postgres-cluster/README.md index 8aa777ac..2f915db1 100644 --- a/charts/stable/zalando-postgres-cluster/README.md +++ b/charts/stable/zalando-postgres-cluster/README.md @@ -1,6 +1,6 @@ # zalando-postgres-cluster -![Version: 2.1.0](https://img.shields.io/badge/Version-2.1.0-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) +![Version: 2.2.0](https://img.shields.io/badge/Version-2.2.0-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) Creates a postgres cluster using the Zalando Postgres operator and local storage @@ -80,15 +80,17 @@ Features added by this wrapper: | Key | Type | Default | Description | |-----|------|---------|-------------| -| dumpBackup.existingClaim | string | `nil` | | -| dumpBackup.image.pullPolicy | string | `"IfNotPresent"` | | -| dumpBackup.image.repository | string | `"postgres"` | | -| dumpBackup.image.tag | string | `"latest"` | | -| dumpBackup.resources.requests.cpu | string | `"5m"` | | -| dumpBackup.resources.requests.memory | string | `"10Mi"` | | +| dumpBackup.enabled | bool | `false` | Enable backups to a PVC | +| dumpBackup.existingClaim | string | `nil` | existing claim | +| dumpBackup.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | +| dumpBackup.image.repository | string | `"postgres"` | image used for the backups | +| dumpBackup.image.tag | string | `"latest"` | image pull tag | +| dumpBackup.resources.requests.cpu | string | `"5m"` | requested cpu for backup | +| dumpBackup.resources.requests.memory | string | `"10Mi"` | requested memory for backup | | dumpBackup.schedule | string | `"@daily"` | Backup schedule for postgres dumps | | dumpBackup.subpath | string | `nil` | Persistent volume claim subpath for the backups @default: | | dumpBackup.subpathPrefix | string | `"backup/db"` | Persistent volume claim subpath prefix for the backups | +| dumpBackup.type | string | `nil` | Sets the persistence type. Valid options are pvc, emptyDir, hostPath or custom. See [common chart persistence doc](https://github.com/k8s-at-home/library-charts/blob/main/charts/stable/common/values.yaml) | | persistentVolumes.accessModes[0] | string | `"ReadWriteOnce"` | | | persistentVolumes.annotations | object | `{}` | | | persistentVolumes.hostPath | string | `nil` | Local path for the persistent volumes @default: | diff --git a/charts/stable/zalando-postgres-cluster/templates/backupCronjob.yaml b/charts/stable/zalando-postgres-cluster/templates/backupCronjob.yaml index a483c3d2..c7ce64ad 100644 --- a/charts/stable/zalando-postgres-cluster/templates/backupCronjob.yaml +++ b/charts/stable/zalando-postgres-cluster/templates/backupCronjob.yaml @@ -1,4 +1,4 @@ -{{- if .Values.dumpBackup.existingClaim -}} +{{- if or .Values.dumpBackup.enabled .Values.dumpBackup.existingClaim -}} # ------------------- CronJob ------------------- # apiVersion: batch/v1beta1 kind: CronJob @@ -50,7 +50,7 @@ spec: subPath: {{ include "zalando-postgres-cluster.backupPVCSubpath" . }} restartPolicy: OnFailure volumes: - - name: backup-volume - persistentVolumeClaim: - claimName: {{ .Values.dumpBackup.existingClaim }} + {{- $valuesCopy := deepCopy . -}} + {{- $_ := set $valuesCopy.Values "persistence" (dict "backup-volume" .Values.dumpBackup ) -}} + {{- include "common.controller.volumes" $valuesCopy | nindent 12 }} {{- end -}} diff --git a/charts/stable/zalando-postgres-cluster/values.yaml b/charts/stable/zalando-postgres-cluster/values.yaml index 3f134bb1..08bcd016 100644 --- a/charts/stable/zalando-postgres-cluster/values.yaml +++ b/charts/stable/zalando-postgres-cluster/values.yaml @@ -59,8 +59,15 @@ persistentVolumes: dumpBackup: - # Enable backups to a PVC + # -- Enable backups to a PVC + enabled: false + # -- existing claim existingClaim: + # -- Sets the persistence type. + # Valid options are pvc, emptyDir, hostPath or custom. + # See + # [common chart persistence doc](https://github.com/k8s-at-home/library-charts/blob/main/charts/stable/common/values.yaml) + type: # -- Backup schedule for postgres dumps schedule: "@daily" # -- Persistent volume claim subpath prefix for the backups @@ -69,10 +76,15 @@ dumpBackup: # @default: subpath: image: + # -- image used for the backups repository: postgres + # -- image pull policy pullPolicy: IfNotPresent + # -- image pull tag tag: latest resources: requests: + # -- requested memory for backup memory: "10Mi" + # -- requested cpu for backup cpu: "5m"