Skip to content

Commit a84c660

Browse files
chart: bump version to 0.4.3 and add Supabase Vault configuration options
1 parent 585376b commit a84c660

4 files changed

Lines changed: 51 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/volumes/db/data
2+
3+
.DS_Store

charts/cnpg-cluster/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.4.2
18+
version: 0.4.3
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/cnpg-cluster/templates/cnpg-cluster.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ spec:
5656
max_parallel_workers_per_gather: "2"
5757
max_parallel_workers: "4"
5858

59+
{{- if .Values.vault.enabled }}
60+
# pgsodium configuration for Supabase Vault
61+
# https://github.com/michelp/pgsodium
62+
pgsodium.enable_event_trigger: "off"
63+
pgsodium.getkey_script: {{ .Values.vault.getkeyScript | quote }}
64+
{{- end }}
65+
{{- $libs := .Values.sharedPreloadLibraries | default list }}
66+
{{- if .Values.vault.enabled }}
67+
{{- $libs = append $libs "supabase_vault" }}
68+
{{- end }}
69+
{{- if $libs }}
70+
shared_preload_libraries:
71+
{{- range $libs }}
72+
- {{ . }}
73+
{{- end }}
74+
{{- end }}
75+
5976
{{ if (gt (.Values.instances | int) 1) }}
6077
# Synchronous replication for data durability
6178
synchronous:
@@ -64,6 +81,22 @@ spec:
6481
number: 1
6582
{{- end }}
6683

84+
{{- if .Values.vault.enabled }}
85+
# https://cloudnative-pg.io/documentation/current/cluster_conf/#environment-variables
86+
env:
87+
- name: EXTENSION_PGSODIUM_KEY_FILE
88+
value: /projected/pgsodium_root.key
89+
90+
# https://cloudnative-pg.io/documentation/current/cluster_conf/#projected-volumes
91+
projectedVolumeTemplate:
92+
sources:
93+
- secret:
94+
name: {{ .Values.vault.secretName }}
95+
items:
96+
- key: {{ .Values.vault.secretKey }}
97+
path: pgsodium_root.key
98+
{{- end }}
99+
67100
storage:
68101
storageClass: {{ .Values.storageClass }}
69102
size: {{ .Values.storageSize }}

charts/cnpg-cluster/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ connections:
5252
storageClass: standard
5353
storageSize: 4Gi
5454

55+
# Additional shared preload libraries
56+
# vault.enabled automatically adds supabase_vault
57+
sharedPreloadLibraries: []
58+
5559
objectStore:
5660
endpoint: https://s3.ap-southeast-1.amazonaws.com
5761
bucketName: cnpg-backups
@@ -100,3 +104,14 @@ pooler:
100104
enabled: true
101105
instances: 1
102106
mode: transaction
107+
108+
# Supabase Vault (pgsodium) configuration
109+
# https://supabase.com/docs/guides/database/vault
110+
vault:
111+
enabled: false
112+
# Secret containing the pgsodium root key
113+
secretName: pgsodium-root-key
114+
# Key name within the secret
115+
secretKey: pgsodium_root.key
116+
# Path to the getkey script in the container
117+
getkeyScript: /usr/share/postgresql/extension/pgsodium_getkey

0 commit comments

Comments
 (0)