Skip to content

Commit 13981f1

Browse files
committed
[ADD] cnpg initdb
1 parent 39b16e0 commit 13981f1

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

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

+22
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ data:
1616
username: {{ "postgres" | b64enc }}
1717
---
1818
{{- end }}
19+
{{- if .Values.cloudNativePG.initDb }}
20+
apiVersion: v1
21+
kind: Secret
22+
metadata:
23+
name: {{ include "adhoc-odoo.fullname" . }}-pg-odoo
24+
labels:
25+
{{- include "adhoc-odoo.labels" . | nindent 4 }}
26+
type: kubernetes.io/basic-auth
27+
data:
28+
username: {{ "odoo" | b64enc | quote }}
29+
password: {{ .Values.cloudNativePG.superUserPassword | b64enc | quote }}
30+
---
31+
{{- end }}
1932
{{- if and .Values.cloudNativePG.backup.bucket.enabled ( eq (lower .Values.adhoc.appType) "prod" ) }}
2033
apiVersion: v1
2134
kind: Secret
@@ -151,6 +164,7 @@ spec:
151164
retentionPolicy: "360d"
152165
{{- end }}
153166

167+
{{- if or .Values.cloudNativePG.restore.inTimeRecovery .Values.cloudNativePG.initDb }}
154168
bootstrap:
155169
{{- if .Values.cloudNativePG.restore.inTimeRecovery }}
156170
recovery:
@@ -176,6 +190,14 @@ spec:
176190
targetTime: {{ .Values.cloudNativePG.restore.inTimeRecovery | quote }}
177191
{{- end }}
178192
{{- end }}
193+
{{- if .Values.cloudNativePG.initDb }}
194+
initdb:
195+
database: "odoo"
196+
owner: "odoo"
197+
secret:
198+
name: {{ include "adhoc-odoo.fullname" . }}-pg-odoo
199+
{{- end }}
200+
{{- end }}
179201

180202
{{- if .Values.cloudNativePG.backup.bucket.enabled }}
181203
externalClusters:

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,5 @@ cloudNativePG:
245245
volumeSnapshotClass: gcp-r # gcp
246246
# Not implemented
247247
fromDump: ""
248-
inTimeRecovery: null # null for no recovery (initdb), latest for or timestamp (in the RFC3339 standard)
248+
inTimeRecovery: null # null for no recovery, latest for or timestamp (in the RFC3339 standard)
249+
initDb: false

0 commit comments

Comments
 (0)