Skip to content

Commit 206bb1f

Browse files
committedFeb 14, 2025·
[REM] remove cnpg bucket buckup support
1 parent b1368d1 commit 206bb1f

File tree

5 files changed

+0
-110
lines changed

5 files changed

+0
-110
lines changed
 

‎charts/adhoc-odoo/v0.2.9/questions.yml

-16
Original file line numberDiff line numberDiff line change
@@ -512,22 +512,6 @@ questions:
512512
type: "boolean"
513513
required: true
514514
default: false
515-
- variable: cloudNativePG.backup.schedule
516-
group: "CloudNativePG"
517-
label: "Backup cron schedule"
518-
description: " S M H Dm Mo Dw (Golang CRON Expression Format https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format) \n only enabled on adhoc.appType == 'prod' \n Default: Daily at UTC midnight "
519-
type: "string"
520-
required: false
521-
default: "0 0 0 * * *"
522-
show_if: "cloudNativePG.enabled=true && adhoc.appType=prod"
523-
# - variable: cloudNativePG.restore.fromSnapshot
524-
# group: "CloudNativePG"
525-
# label: "Snapshot Name"
526-
# description: "Snapshot name to recover"
527-
# type: "string"
528-
# required: false
529-
# default: null
530-
# show_if: "cloudNativePG.enabled=true"
531515
- variable: cloudNativePG.restore.fromGCPSnapshot
532516
group: "CloudNativePG"
533517
label: "GCP Snapshot path"

‎charts/adhoc-odoo/v0.2.9/templates/_cnpg_helpers.tpl

-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
{{/*
2-
https://cloudnative-pg.io/documentation/1.22/appendixes/object_stores/#google-cloud-storage
3-
*/}}
4-
{{- define "barmanObjectStore.gcp" -}}
5-
{{- if and .Values.cloudNativePG.backup.bucket.enabled .Values.cloudNativePG.backup.bucket.bucketName }}
6-
destinationPath: {{ printf "gs://%s/%s" ( .Values.cloudNativePG.backup.bucket.bucketName | default "notSet" ) ( .Release.Name | lower ) }}
7-
googleCredentials:
8-
applicationCredentials:
9-
name: {{ include "adhoc-odoo.fullname" . }}-backup-secret
10-
key: backup-key.json
11-
wal:
12-
compression: gzip
13-
encryption: AES256
14-
maxParallel: 8
15-
data:
16-
compression: gzip
17-
encryption: AES256
18-
immediateCheckpoint: false
19-
jobs: 2
20-
{{- end }}
21-
{{- end }}
22-
231
{{/*
242
Expand the name of the chart.
253
*/}}

‎charts/adhoc-odoo/v0.2.9/templates/cnpg_check-crd.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,4 @@
1111
{{- fail "El valor de timestamp debe ser null, 'latest' o un timestamp UTC en el formato RFC3339 (YYYY-MM-DDTHH:MM:SSZ)." }}
1212
{{- end }}
1313

14-
{{- if and .Values.cloudNativePG.backup.bucket.enabled (not .Values.cloudNativePG.backup.bucket.bucketName) }}
15-
{{- fail (print "\nbucketName must be set\n") }}
16-
{{- end }}
17-
1814
{{- end }}

‎charts/adhoc-odoo/v0.2.9/templates/cnpg_pg.yaml

-61
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ data:
2727
username: {{ "odoo" | b64enc | quote }}
2828
password: {{ .Values.cloudNativePG.superUserPassword | b64enc | quote }}
2929
---
30-
{{- if and .Values.cloudNativePG.backup.bucket.enabled ( eq (lower .Values.adhoc.appType) "prod" ) }}
31-
apiVersion: v1
32-
kind: Secret
33-
metadata:
34-
name: {{ .Release.Name }}-backup-secret
35-
labels:
36-
{{- include "adhoc-odoo.labels" . | nindent 4 }}
37-
type: Opaque
38-
data:
39-
backup-key.json: {{ .Values.cloudNativePG.backup.bucket.bucketCredential | b64enc }}
40-
{{- end }}
41-
---
4230
apiVersion: postgresql.cnpg.io/v1
4331
kind: Cluster
4432
metadata:
@@ -128,19 +116,8 @@ spec:
128116
# wal_sender_timeout = '5s'
129117
# wal_receiver_timeout = '5s'
130118
*/}}
131-
{{- if eq (lower .Values.adhoc.appType) "prod" }}
132119
{{/* https://cloudnative-pg.io/documentation/1.22/cloudnative-pg.v1/#postgresql-cnpg-io-v1-BackupConfiguration */}}
133120
backup:
134-
{{- if .Values.cloudNativePG.backup.bucket.enabled }}
135-
barmanObjectStore:
136-
tags:
137-
{{- include "adhoc-odoo.labels" . | nindent 8 }}
138-
{{- if .Values.cloudNativePG.backup.bucket.backupServerName }}
139-
serverName: {{ .Values.cloudNativePG.backup.bucket.backupServerName | quote }}
140-
{{- end }}
141-
{{- include "barmanObjectStore.gcp" . | nindent 6 }}
142-
{{- end }}
143-
144121
{{- if .Values.cloudNativePG.backup.volumeSnapshot.enabled }}
145122
volumeSnapshot:
146123
# no ownership is set, meaning that VolumeSnapshot objects persist after the Backup and/or the Cluster resources are removed
@@ -160,7 +137,6 @@ spec:
160137
{{- end }}
161138
target: prefer-standby
162139
retentionPolicy: "360d"
163-
{{- end }}
164140

165141
bootstrap:
166142
{{- if .Values.cloudNativePG.restore.inTimeRecovery }}
@@ -179,9 +155,6 @@ spec:
179155
apiGroup: snapshot.storage.k8s.io
180156
{{- end }}
181157
{{- end }}
182-
{{- if .Values.cloudNativePG.backup.bucket.enabled }}
183-
source: {{ include "adhoc-odoo.fullname" . }}-pg
184-
{{- end }}
185158
{{- if ne .Values.cloudNativePG.restore.inTimeRecovery "latest" }}
186159
recoveryTarget:
187160
targetTime: {{ .Values.cloudNativePG.restore.inTimeRecovery | quote }}
@@ -199,38 +172,4 @@ spec:
199172
secret:
200173
name: {{ include "adhoc-odoo.fullname" . }}-pg-app
201174
{{- end }}
202-
203-
{{- if .Values.cloudNativePG.backup.bucket.enabled }}
204-
externalClusters:
205-
- name: {{ include "adhoc-odoo.fullname" . }}-pg
206-
barmanObjectStore:
207-
{{- include "barmanObjectStore.gcp" . | nindent 6 }}
208-
{{- end }}
209-
210-
{{- if eq (lower .Values.adhoc.appType) "prod" }}
211-
{{- if or .Values.cloudNativePG.backup.bucket.enabled .Values.cloudNativePG.backup.volumeSnapshot.enabled }}
212-
---
213-
apiVersion: postgresql.cnpg.io/v1
214-
kind: ScheduledBackup
215-
metadata:
216-
name: {{ include "adhoc-odoo.fullname" . }}-pg-backup
217-
labels:
218-
{{- include "adhoc-odoo.labels" . | nindent 4 }}
219-
spec:
220-
{{- if .Values.cloudNativePG.backup.bucket.enabled }}
221-
method: barmanObjectStore
222-
{{- end }}
223-
{{- if .Values.cloudNativePG.backup.volumeSnapshot.enabled }}
224-
method: volumeSnapshot
225-
{{- end }}
226-
suspend: false
227-
immediate: true
228-
{{/* S M H Dm Mo Dw */}}
229-
schedule: {{ .Values.cloudNativePG.backup.schedule | default "0 0 0 * * *" }}
230-
backupOwnerReference: none
231-
target: prefer-standby
232-
cluster:
233-
name: {{ include "adhoc-odoo.fullname" . }}-pg
234-
{{- end }}
235-
{{- end }}
236175
{{- end }}

‎charts/adhoc-odoo/v0.2.9/values.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,7 @@ cloudNativePG:
229229
enabled: true
230230
# We want to keep the snapshots as backups.
231231
volumeSnapshotClass: gcp-r # gcp
232-
bucket:
233-
enabled: false
234-
bucketName: ''
235-
bucketCredential: null
236-
backupServerName: null
237232
restore:
238-
# From cnpg bucket backup
239-
fromBucket: null
240233
# From cnpg volume snapshot backup
241234
fromSnapshot: ""
242235
# From the GCP snapshot path of the cnpg volume snapshot backup

0 commit comments

Comments
 (0)
Please sign in to comment.