Skip to content

Commit 43060ba

Browse files
committed
Update image tags
* add JWT expiry * update `db` JWT schema * update `db` arguments based on docker-compose * update README with local testing suite * fix testing conditions * remove `db` ingress
1 parent a8004fe commit 43060ba

17 files changed

+58
-85
lines changed

charts/supabase/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ kong:
211211
annotations:
212212
nginx.ingress.kubernetes.io/rewrite-target: /
213213
```
214+
215+
### Testing suite
216+
217+
Before creating a merge request, you can test the charts locally by using [helm/chart-testing](https://github.com/helm/chart-testing). If you have Docker and a Kubernetes environment to test with, simply run:
218+
219+
```shell
220+
docker run -it \
221+
--network host \
222+
--workdir=/data \
223+
--volume ~/.kube/config:/root/.kube/config:ro \
224+
--volume $(pwd)/charts/supabase:/data \
225+
quay.io/helmpack/chart-testing:v3.7.1 \
226+
ct install --chart-dirs . --charts .
227+
```
228+
214229
### Version compatibility
215230

216231
#### `0.0.x` to `0.1.x`

charts/supabase/templates/db/ingress.yaml

-57
This file was deleted.

charts/supabase/templates/db/initdb.config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ metadata:
66
labels:
77
{{- include "supabase.labels" . | nindent 4 }}
88
data:
9+
99-jwt.sql: |
10+
\set jwt_secret `echo "$JWT_SECRET"`
11+
\set jwt_exp `echo "$JWT_EXP"`
12+
13+
ALTER DATABASE postgres SET "app.settings.jwt_secret" TO :jwt_secret;
14+
ALTER DATABASE postgres SET "app.settings.jwt_exp" TO :jwt_exp;
915
99-logs.sql: |
1016
\set pguser `echo "$POSTGRES_USER"`
1117

charts/supabase/templates/rest/deployment.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ spec:
6565
secretKeyRef:
6666
name: {{ include "supabase.secret.jwt" . }}
6767
key: secret
68+
- name: JWT_EXPIRY
69+
valueFrom:
70+
secretKeyRef:
71+
name: {{ include "supabase.secret.jwt" . }}
72+
key: expiry
6873
{{- with .Values.rest.livenessProbe }}
6974
livenessProbe:
7075
{{- toYaml . | nindent 12 }}

charts/supabase/templates/secrets/jwt.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ metadata:
88
type: Opaque
99
data:
1010
{{- range $key, $value := .Values.secret.jwt }}
11-
{{ $key }}: {{ $value | b64enc }}
11+
{{ $key }}: {{ $value | toString | b64enc }}
1212
{{- end }}
1313
{{- end }}

charts/supabase/templates/test/analytics.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.analytics.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.analytics.fullname" . }}:{{ .Values.analytics.service.port }}/health
2223
echo "Sevice {{ include "supabase.analytics.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/templates/test/auth.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.auth.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.auth.fullname" . }}:{{ .Values.auth.service.port }}/health
2223
echo "Sevice {{ include "supabase.auth.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/templates/test/db.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.db.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -35,3 +36,4 @@ spec:
3536
imagePullPolicy: IfNotPresent
3637
name: test-db
3738
restartPolicy: Never
39+
{{- end }}

charts/supabase/templates/test/imgproxy.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.imgproxy.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.imgproxy.fullname" . }}:{{ .Values.imgproxy.service.port }}/health
2223
echo "Sevice {{ include "supabase.imgproxy.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/templates/test/kong.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.kong.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -28,10 +29,11 @@ spec:
2829
- /bin/bash
2930
- -c
3031
- |
31-
RETURN_CODE=$(curl -sL \
32-
-w "%{http_code}\n" \
32+
echo "Attempting to access dashboard with provided credentials..."
33+
curl -sL --fail \
3334
-o /dev/null \
34-
http://${DASHBOARD_USERNAME}:${DASHBOARD_PASSWORD}@{{ include "supabase.kong.fullname" . }}:{{ .Values.kong.service.port }})
35-
! [[ "$RETURN_CODE" =~ 20[0-9] ]] && echo -e "\e[0;31mFailed to get a valid response." && exit 1
35+
"http://${DASHBOARD_USERNAME}:${DASHBOARD_PASSWORD}@{{ include "supabase.kong.fullname" . }}:{{ .Values.kong.service.port }}" \
36+
|| ( echo -e "\e[0;31mFailed to get a valid response." && exit 1 )
3637
echo "Successfully connected."
3738
restartPolicy: Never
39+
{{- end }}

charts/supabase/templates/test/meta.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.meta.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.meta.fullname" . }}:{{ .Values.meta.service.port }}/health
2223
echo "Sevice {{ include "supabase.meta.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/templates/test/realtime.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.realtime.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.realtime.fullname" . }}:{{ .Values.realtime.service.port }}
2223
echo "Sevice {{ include "supabase.realtime.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/templates/test/rest.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.rest.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.rest.fullname" . }}:{{ .Values.rest.service.port }}
2223
echo "Sevice {{ include "supabase.rest.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/templates/test/storage.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.storage.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.storage.fullname" . }}:{{ .Values.storage.service.port }}/status
2223
echo "Sevice {{ include "supabase.storage.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/templates/test/studio.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.studio.enabled -}}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -21,3 +22,4 @@ spec:
2122
http://{{ include "supabase.studio.fullname" . }}:{{ .Values.studio.service.port }}/api/profile
2223
echo "Sevice {{ include "supabase.studio.fullname" . }} is healthy."
2324
restartPolicy: Never
25+
{{- end }}

charts/supabase/values.example.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ auth:
6060

6161
rest:
6262
image:
63-
tag: v11.2.0
63+
tag: v11.2.2
6464

6565
realtime:
6666
image:
@@ -77,7 +77,7 @@ meta:
7777

7878
storage:
7979
image:
80-
tag: v0.40.4
80+
tag: v0.43.11
8181
livenessProbe:
8282
httpGet:
8383
path: /status
@@ -145,4 +145,4 @@ vector:
145145

146146
functions:
147147
image:
148-
tag: v1.22.3
148+
tag: v1.22.4

charts/supabase/values.yaml

+4-20
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ secret:
2020
anonKey: ""
2121
serviceKey: ""
2222
secret: ""
23+
expiry: 3600
2324
# database credentials
2425
# these fields must be provided even if using external database
2526
db:
@@ -82,25 +83,9 @@ db:
8283
PGPORT: "5432"
8384
POSTGRES_PORT: "5432"
8485
# POSTGRES_HOST_AUTH_METHOD: md5
85-
ingress:
86-
enabled: false
87-
className: "nginx"
88-
annotations:
89-
nginx.ingress.kubernetes.io/rewrite-target: /
90-
# cert-manager.io/cluster-issuer: "letsencrypt-staging"
91-
# kubernetes.io/tls-acme: "true"
92-
tls:
93-
- secretName: DB.EXAMPLE.COM
94-
hosts:
95-
- DB.EXAMPLE.COM
96-
hosts:
97-
- host: DB.EXAMPLE.COM
98-
paths:
99-
- path: /
100-
pathType: Prefix
101-
backend:
102-
serviceName: database
103-
servicePort: 5432
86+
# Enable SSL for postgres by specifying paths for mounted certificate key pair
87+
# POSTGRES_SSL_CERT: /path/to/ssl/server.crt
88+
# POSTGRES_SSL_KEY: /path/to/ssl/server.key
10489
# volumeMounts:
10590
# - name: volume_name
10691
# mountPath: /path/to/my/secret
@@ -357,7 +342,6 @@ rest:
357342
PGRST_DB_SCHEMAS: public,storage,graphql_public
358343
PGRST_DB_ANON_ROLE: anon
359344
PGRST_DB_USE_LEGACY_GUCS: false
360-
JWT_EXPIRY: 3600
361345
# volumeMounts:
362346
# - name: volume_name
363347
# mountPath: /path/to/my/secret

0 commit comments

Comments
 (0)