Skip to content

Commit

Permalink
Added ParadeDB support to the Helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
itay-grudev committed Sep 3, 2024
1 parent 7e0025a commit 24fb8cc
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
24 changes: 20 additions & 4 deletions charts/cluster/templates/_bootstrap.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
bootstrap:
initdb:
{{- with .Values.cluster.initdb }}
{{- with (omit . "postInitApplicationSQL") }}
{{- with (omit . "postInitApplicationSQL" "postInitTemplateSQL") }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- end }}
Expand All @@ -15,11 +15,27 @@ bootstrap:
- CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
{{- else if eq .Values.type "timescaledb" }}
- CREATE EXTENSION IF NOT EXISTS timescaledb;
{{- else if eq .Values.type "paradedb" }}
- CREATE EXTENSION IF NOT EXISTS pg_search;
- CREATE EXTENSION IF NOT EXISTS pg_analytics;
- CREATE EXTENSION IF NOT EXISTS pg_ivm;
- CREATE EXTENSION IF NOT EXISTS vector;
- CREATE EXTENSION IF NOT EXISTS vectorscale;
- ALTER DATABASE "{{ default "app" .Values.cluster.initdb.database }}" SET search_path TO public,paradedb;
{{- end }}
{{- with .Values.cluster.initdb }}
{{- range .postInitApplicationSQL }}
{{- printf "- %s" . | nindent 6 }}
{{- end -}}
{{- range .postInitApplicationSQL }}
{{- printf "- %s" . | nindent 6 }}
{{- end -}}
{{- end }}
postInitTemplateSQL:
{{- if eq .Values.type "paradedb" }}
- ALTER DATABASE template1 SET search_path TO public,paradedb;
{{- end }}
{{- with .Values.cluster.initdb }}
{{- range .postInitTemplateSQL }}
{{- printf "- %s" . | nindent 6 }}
{{- end -}}
{{- end -}}
{{- else if eq .Values.mode "recovery" -}}
bootstrap:
Expand Down
2 changes: 2 additions & 0 deletions charts/cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ If a custom imageName is available, use it, otherwise use the defaults based on
{{- printf "ghcr.io/cloudnative-pg/postgresql:%s" .Values.version.postgresql -}}
{{- else if eq .Values.type "postgis" -}}
{{- printf "ghcr.io/cloudnative-pg/postgis:%s-%s" .Values.version.postgresql .Values.version.postgis -}}
{{- else if eq .Values.type "paradedb" -}}
{{- printf "paradedb/paradedb:%s-v%s" .Values.version.postgresql .Values.version.paradedb -}}
{{- else -}}
{{ fail "Invalid cluster type!" }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ spec:
shared_preload_libraries:
{{- if eq .Values.type "timescaledb" }}
- timescaledb
{{- else if eq .Values.type "paradedb" }}
- pg_search
- pg_analytics
- pg_cron
{{- end }}
{{- with .Values.cluster.postgresql }}
parameters:
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fullnameOverride: ""
# * `postgresql`
# * `postgis`
# * `timescaledb`
# * `paradedb`
type: postgresql

version:
Expand All @@ -17,6 +18,8 @@ version:
timescaledb: "2.15"
# -- If using PostGIS, specify the version
postgis: "3.4"
# -- If using ParadeDB, specify the version
paradedb: "0.9.3"

###
# -- Cluster mode of operation. Available modes:
Expand Down

0 comments on commit 24fb8cc

Please sign in to comment.