From 678ce1aec5825ba3965d68ef384b9b6e46cc3f18 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 12 Mar 2024 23:23:34 -0600 Subject: [PATCH] split recovery and backup values --- charts/postgres-cluster/Chart.yaml | 2 +- .../templates/postgresql-cluster.yaml | 16 ++++++++-------- .../templates/scheduled-backup.yaml | 1 - charts/postgres-cluster/values.yaml | 10 ++++++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index e762e6a..aa74337 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 0.1.1 +version: 0.2.1 description: Chart for cloudnative-pg cluster keywords: - database diff --git a/charts/postgres-cluster/templates/postgresql-cluster.yaml b/charts/postgres-cluster/templates/postgresql-cluster.yaml index e7668e3..79b279c 100644 --- a/charts/postgres-cluster/templates/postgresql-cluster.yaml +++ b/charts/postgres-cluster/templates/postgresql-cluster.yaml @@ -42,12 +42,12 @@ spec: {{- if .Values.backup.recoveryEnabled }} bootstrap: recovery: - source: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.backup.recoveryIndex }}" + source: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.bootstrap.recoveryIndex }}" externalClusters: - - name: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.backup.recoveryIndex }}" + - name: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.bootstrap.recoveryIndex }}" barmanObjectStore: - endpointURL: {{ .Values.backup.endpointURL }} - destinationPath: "s3://{{ .Values.backup.bucket }}/{{ .Values.cluster.name }}/postgresql/{{ .Release.Name }}-cluster" + endpointURL: {{ .Values.bootstrap.endpointURL }} + destinationPath: "s3://{{ .Values.bootstrap.bucket }}/{{ .Values.cluster.name }}/postgresql/{{ .Release.Name }}-cluster" s3Credentials: accessKeyId: name: "postgresql-{{ .Release.Name }}-cluster-backup-secret" @@ -56,9 +56,9 @@ spec: name: "postgresql-{{ .Release.Name }}-cluster-backup-secret" key: ACCESS_SECRET_KEY data: - compression: {{ .Values.backup.compression }} + compression: {{ .Values.cluster.compression }} wal: - compression: {{ .Values.backup.compression }} + compression: {{ .Values.cluster.compression }} {{- end }} {{- if .Values.backup.backupEnabled }} @@ -76,7 +76,7 @@ spec: name: "postgresql-{{ .Release.Name }}-cluster-backup-secret" key: ACCESS_SECRET_KEY data: - compression: {{ .Values.backup.compression }} + compression: {{ .Values.cluster.compression }} wal: - compression: {{ .Values.backup.compression }} + compression: {{ .Values.cluster.compression }} {{- end }} diff --git a/charts/postgres-cluster/templates/scheduled-backup.yaml b/charts/postgres-cluster/templates/scheduled-backup.yaml index 5dc0457..1ec8706 100644 --- a/charts/postgres-cluster/templates/scheduled-backup.yaml +++ b/charts/postgres-cluster/templates/scheduled-backup.yaml @@ -9,7 +9,6 @@ metadata: app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: database app.kubernetes.io/part-of: {{ .Release.Name }} - app.kubernetes.io/managed-by: helm spec: schedule: {{ .Values.backup.schedule }} backupOwnerReference: self diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index a1ba68c..6a53f57 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -8,6 +8,7 @@ cluster: shared_buffers: 128MB max_slot_wal_keep_size: 2000MB hot_standby_feedback: "on" + compression: snappy resources: requests: memory: 512Mi @@ -24,17 +25,18 @@ cluster: storageClass: ceph-block size: 2Gi bootstrap: + recoveryEnabled: false + recoveryIndex: 1 + endpointURL: https://nyc3.digitaloceanspaces.com + bucket: alexlebens.net initdbEnabled: false initdb: database: app owner: app backup: backupEnabled: true - recoveryEnabled: false schedule: "0 0 0 * * *" retentionPolicy: 14d backupIndex: 1 - recoveryIndex: 1 endpointURL: https://nyc3.digitaloceanspaces.com - bucket: net-infra - compression: snappy + bucket: alexlebens.net