[zalando-postgres-cluster ] Enable additional settings for dumpBackup (#1037)

* enable additional settings for dumpBackup

* Update charts/stable/zalando-postgres-cluster/values.yaml

Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <bernd@bjws.nl>

* add feedback

Co-authored-by: angelnu <git@angelnucom>
Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <bernd@bjws.nl>
This commit is contained in:
Angel Nunez Mencias 2021-06-20 22:12:35 +02:00 committed by GitHub
parent ee3c2a7fe0
commit 6eae653ea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 14 deletions

View File

@ -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
- Initial version

View File

@ -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

View File

@ -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: <subpathPrefix/<release-name> |
| 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: <hostPathPrefix/<release-name> |

View File

@ -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 -}}

View File

@ -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: <subpathPrefix/<release-name>
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"