diff --git a/charts/supabase/templates/db/deployment.yaml b/charts/supabase/templates/db/statefulset.yaml similarity index 97% rename from charts/supabase/templates/db/deployment.yaml rename to charts/supabase/templates/db/statefulset.yaml index 314842ed..7506bc0b 100644 --- a/charts/supabase/templates/db/deployment.yaml +++ b/charts/supabase/templates/db/statefulset.yaml @@ -1,6 +1,6 @@ {{- if .Values.db.enabled -}} apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: name: {{ include "supabase.db.fullname" . }} labels: @@ -58,6 +58,10 @@ spec: {{- toYaml .Values.db.securityContext | nindent 12 }} image: "{{ .Values.db.image.repository }}:{{ .Values.db.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.db.image.pullPolicy }} + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "pg_ctl -D /var/lib/postgres/data -w -t 60 -m fast stop"] env: {{- range $key, $value := .Values.db.environment }} - name: {{ $key }} @@ -170,4 +174,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/supabase/templates/kong/config.yaml b/charts/supabase/templates/kong/config.yaml index 2edd25af..7692e834 100644 --- a/charts/supabase/templates/kong/config.yaml +++ b/charts/supabase/templates/kong/config.yaml @@ -177,7 +177,7 @@ data: {{- if .Values.functions.enabled }} - name: functions-v1 _comment: 'Edge Functions: /functions/v1/* -> http://{{ include "supabase.functions.fullname" . }}:{{ .Values.functions.service.port }}/*' - url: http://functions:{{ .Values.functions.service.port }}/ + url: http://{{ include "supabase.functions.fullname" . }}:{{ .Values.functions.service.port }}/ routes: - name: functions-v1-all strip_path: true @@ -230,4 +230,4 @@ data: config: hide_credentials: true {{- end }} -{{- end }} \ No newline at end of file +{{- end }}