Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions charts/supabase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [0.1.4] - 2025-07-27

Merging some pull requests from [original](https://github.com/supabase-community/supabase-kubernetes) repository:

- <https://github.com/supabase-community/supabase-kubernetes/pull/62>
- <https://github.com/supabase-community/supabase-kubernetes/pull/89>
- <https://github.com/supabase-community/supabase-kubernetes/pull/91>
- <https://github.com/supabase-community/supabase-kubernetes/pull/94>
- <https://github.com/supabase-community/supabase-kubernetes/pull/95>
- <https://github.com/supabase-community/supabase-kubernetes/pull/96>
- <https://github.com/supabase-community/supabase-kubernetes/pull/101>
- <https://github.com/supabase-community/supabase-kubernetes/pull/106>
- <https://github.com/supabase-community/supabase-kubernetes/pull/107>
- <https://github.com/supabase-community/supabase-kubernetes/pull/113>

## [0.1.3] - 2025-07-27

- Initial release (cloned from [supabase-community/supabase-kubernetes](https://github.com/supabase-community/supabase-kubernetes))
2 changes: 1 addition & 1 deletion charts/supabase/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: supabase
description: The open source Firebase alternative.
type: application
version: 0.1.3
version: 0.1.4
kubeVersion: ">=1.18.0"
appVersion: latest
sources:
Expand Down
12 changes: 9 additions & 3 deletions charts/supabase/templates/analytics/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.analytics.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.analytics.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.analytics.autoscaling.enabled }}
replicas: {{ .Values.analytics.replicaCount }}
Expand Down Expand Up @@ -70,10 +74,12 @@ spec:
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.db.enabled }}
- name: DB_HOSTNAME
value: {{ include "supabase.db.fullname" . }}
{{- end }}
{{- if .Values.db.enabled }}
value: {{ include "supabase.db.fullname" . | quote }}
{{- else }}
value: {{ .Values.auth.environment.DB_HOST | quote }}
{{- end }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/analytics/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.analytics.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.analytics.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.analytics.service.type }}
ports:
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/auth/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.auth.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.auth.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.auth.autoscaling.enabled }}
replicas: {{ .Values.auth.replicaCount }}
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/auth/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.auth.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.auth.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.auth.service.type }}
ports:
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/db/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.db.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.db.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.db.service.type }}
ports:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{{- if .Values.db.enabled -}}
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: {{ include "supabase.db.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.db.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.db.autoscaling.enabled }}
replicas: {{ .Values.db.replicaCount }}
Expand Down Expand Up @@ -58,6 +62,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 }}
Expand Down Expand Up @@ -170,4 +178,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/supabase/templates/functions/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.functions.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.functions.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.functions.autoscaling.enabled }}
replicas: {{ .Values.functions.replicaCount }}
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/functions/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.functions.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.functions.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.functions.service.type }}
ports:
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/imgproxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.imgproxy.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.imgproxy.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.imgproxy.autoscaling.enabled }}
replicas: {{ .Values.imgproxy.replicaCount }}
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/imgproxy/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.imgproxy.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.imgproxy.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.imgproxy.service.type }}
ports:
Expand Down
4 changes: 2 additions & 2 deletions charts/supabase/templates/kong/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -230,4 +230,4 @@ data:
config:
hide_credentials: true
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/supabase/templates/kong/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.kong.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.kong.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.kong.autoscaling.enabled }}
replicas: {{ .Values.kong.replicaCount }}
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/kong/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.kong.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.kong.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.kong.service.type }}
ports:
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/meta/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.meta.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.meta.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.meta.autoscaling.enabled }}
replicas: {{ .Values.meta.replicaCount }}
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/meta/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.meta.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.meta.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.meta.service.type }}
ports:
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/minio/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.minio.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.minio.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.minio.autoscaling.enabled }}
replicas: {{ .Values.minio.replicaCount }}
Expand Down
4 changes: 4 additions & 0 deletions charts/supabase/templates/minio/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.minio.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.minio.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.minio.service.type }}
ports:
Expand Down
4 changes: 2 additions & 2 deletions charts/supabase/templates/minio/volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.minio.persistence.minioClassName }}
minioClassName: {{ .Values.minio.persistence.minioClassName }}
{{- if .Values.minio.persistence.storageClassName }}
storageClassName: {{ .Values.minio.persistence.storageClassName }}
{{- end }}
accessModes:
{{- range .Values.minio.persistence.accessModes }}
Expand Down
18 changes: 15 additions & 3 deletions charts/supabase/templates/realtime/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.realtime.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.realtime.deployment.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.realtime.autoscaling.enabled }}
replicas: {{ .Values.realtime.replicaCount }}
Expand Down Expand Up @@ -76,6 +80,8 @@ spec:
- name: DB_HOST
value: {{ include "supabase.db.fullname" . }}
{{- end }}
- name: TENANT_NAME
value: {{ include "supabase.realtime.fullname" . }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -132,14 +138,20 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.realtime.volumeMounts }}
volumeMounts:
{{- with .Values.realtime.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.realtime.volumes }}
- name: realtime-seed-volume
mountPath: /app/lib/realtime-{{ .Values.realtime.image.tag | trimPrefix "v" }}/priv/repo/seeds.exs
subPath: seeds.exs
volumes:
{{- with .Values.realtime.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
- name: realtime-seed-volume
configMap:
name: {{ printf "%s-seeds" (include "supabase.realtime.fullname" .) }}
{{- with .Values.realtime.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -152,4 +164,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
66 changes: 66 additions & 0 deletions charts/supabase/templates/realtime/seeds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-seeds" (include "supabase.realtime.fullname" .) }}
data:
seeds.exs: |
require Logger
alias Realtime.{Api.Tenant, Repo}
import Ecto.Adapters.SQL, only: [query: 3]

tenant_name = System.get_env("TENANT_NAME", "realtime-dev")

env = if :ets.whereis(Mix.State) != :undefined, do: Mix.env(), else: :prod
default_db_host = if env in [:dev, :test], do: "localhost", else: "host.docker.internal"

Repo.transaction(fn ->
case Repo.get_by(Tenant, external_id: tenant_name) do
%Tenant{} = tenant -> Repo.delete!(tenant)
nil -> {:ok, nil}
end

%Tenant{}
|> Tenant.changeset(%{
"name" => tenant_name,
"external_id" => tenant_name,
"jwt_secret" =>
System.get_env("API_JWT_SECRET", "super-secret-jwt-token-with-at-least-32-characters-long"),
"jwt_jwks" => System.get_env("API_JWT_JWKS") |> then(fn v -> if v, do: Jason.decode!(v) end),
"extensions" => [
%{
"type" => "postgres_cdc_rls",
"settings" => %{
"db_name" => System.get_env("DB_NAME", "postgres"),
"db_host" => System.get_env("DB_HOST", default_db_host),
"db_user" => System.get_env("DB_USER", "supabase_admin"),
"db_password" => System.get_env("DB_PASSWORD", "postgres"),
"db_port" => System.get_env("DB_PORT", "5433"),
"region" => "us-east-1",
"poll_interval_ms" => 100,
"poll_max_record_bytes" => 1_048_576,
"ssl_enforced" => false
}
}
],
"notify_private_alpha" => true
})
|> Repo.insert!()
end)

if env in [:dev, :test] do
publication = "supabase_realtime"

{:ok, _} =
Repo.transaction(fn ->
[
"drop publication if exists #{publication}",
"drop table if exists public.test_tenant;",
"create table public.test_tenant ( id SERIAL PRIMARY KEY, details text );",
"grant all on table public.test_tenant to anon;",
"grant all on table public.test_tenant to postgres;",
"grant all on table public.test_tenant to authenticated;",
"create publication #{publication} for table public.test_tenant"
]
|> Enum.each(&query(Repo, &1, []))
end)
end
4 changes: 4 additions & 0 deletions charts/supabase/templates/realtime/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "supabase.realtime.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
{{- with .Values.realtime.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.realtime.service.type }}
ports:
Expand Down
Loading