Compare commits

...

10 Commits

Author SHA1 Message Date
202a534e8e fix missing field 2024-12-21 23:48:11 -06:00
c36e4e371f reorganize values 2024-12-21 23:40:21 -06:00
1ac9444bb2 fix condition flow 2024-12-21 23:29:50 -06:00
275fcd8568 use cluster values 2024-12-21 23:26:40 -06:00
158d4ca676 change method 2024-12-21 23:22:34 -06:00
32e232d8e2 force hardcoded value for testing 2024-12-21 23:08:17 -06:00
93d2f916fb use value for name 2024-12-21 22:53:59 -06:00
b1a6a2fd39 remove condition 2024-12-21 22:46:17 -06:00
d3307d4f70 use different function 2024-12-21 22:39:52 -06:00
1b7018d3bd fix database naming 2024-12-21 22:31:00 -06:00
4 changed files with 11 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: postgres-cluster name: postgres-cluster
version: 3.20.0 version: 3.20.10
description: Chart for cloudnative-pg cluster description: Chart for cloudnative-pg cluster
keywords: keywords:
- database - database

View File

@@ -2,7 +2,7 @@
bootstrap: bootstrap:
{{- if eq .Values.mode "standalone" }} {{- if eq .Values.mode "standalone" }}
initdb: initdb:
{{- with .Values.cluster.initdb }} {{- with .Values.bootstrap.initdb }}
{{- with (omit . "postInitApplicationSQL") }} {{- with (omit . "postInitApplicationSQL") }}
{{- . | toYaml | nindent 4 }} {{- . | toYaml | nindent 4 }}
{{- end }} {{- end }}
@@ -10,7 +10,7 @@ bootstrap:
{{- if eq .Values.type "tensorchord" }} {{- if eq .Values.type "tensorchord" }}
dataChecksums: true dataChecksums: true
{{- end }} {{- end }}
{{- if or (eq .Values.type "postgis") (eq .Values.type "timescaledb") (eq .Values.type "tensorchord") (.Values.cluster.initdb.postInitApplicationSQL) }} {{- if or (eq .Values.type "postgis") (eq .Values.type "timescaledb") (eq .Values.type "tensorchord") (.Values.bootstrap.initdb.postInitApplicationSQL) }}
postInitApplicationSQL: postInitApplicationSQL:
{{- if eq .Values.type "postgis" }} {{- if eq .Values.type "postgis" }}
- CREATE EXTENSION IF NOT EXISTS postgis; - CREATE EXTENSION IF NOT EXISTS postgis;
@@ -29,7 +29,7 @@ bootstrap:
- GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA vectors TO "app"; - GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA vectors TO "app";
- GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "app"; - GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "app";
{{- end }} {{- end }}
{{- with .Values.cluster.initdb }} {{- with .Values.bootstrap.initdb }}
{{- range .postInitApplicationSQL }} {{- range .postInitApplicationSQL }}
{{- printf "- %s" . | nindent 6 }} {{- printf "- %s" . | nindent 6 }}
{{- end }} {{- end }}
@@ -37,11 +37,6 @@ bootstrap:
{{- end }} {{- end }}
{{- else if eq .Values.mode "replica" }} {{- else if eq .Values.mode "replica" }}
initdb: initdb:
{{- if .eq .Values.replica.importType "microservice" }}
{{- with index .Values.replica.importDatabases 0 }}
database: {{- . | quote }}
{{- end }}
{{- end }}
import: import:
type: {{ .Values.replica.importType }} type: {{ .Values.replica.importType }}
databases: databases:
@@ -66,6 +61,11 @@ bootstrap:
{{- end }} {{- end }}
source: source:
externalCluster: "{{ include "cluster.name" . }}-cluster" externalCluster: "{{ include "cluster.name" . }}-cluster"
{{- with .Values.bootstrap.initdb }}
{{- with (omit . "postInitApplicationSQL") }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- end }}
externalClusters: externalClusters:
- name: "{{ include "cluster.name" . }}-cluster" - name: "{{ include "cluster.name" . }}-cluster"
{{- with .Values.replica.externalCluster }} {{- with .Values.replica.externalCluster }}

View File

@@ -60,4 +60,5 @@ spec:
enablePodMonitor: {{ and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled }} enablePodMonitor: {{ and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled }}
{{ include "cluster.bootstrap" . | nindent 2 }} {{ include "cluster.bootstrap" . | nindent 2 }}
{{ include "cluster.backup" . | nindent 2 }} {{ include "cluster.backup" . | nindent 2 }}

View File

@@ -80,6 +80,7 @@ cluster:
hot_standby_feedback: "on" hot_standby_feedback: "on"
shared_preload_libraries: [] shared_preload_libraries: []
bootstrap:
# BootstrapInitDB is the configuration of the bootstrap process when initdb is used. # BootstrapInitDB is the configuration of the bootstrap process when initdb is used.
# See: https://cloudnative-pg.io/documentation/current/bootstrap/ # See: https://cloudnative-pg.io/documentation/current/bootstrap/
# See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-bootstrapinitdb # See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-bootstrapinitdb