Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supabase deployment #380

Merged
merged 286 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
286 commits
Select commit Hold shift + click to select a range
5e9ddd8
Removes sidecar changes, default jwt gen, adds kong
CollectiveUnicorn Apr 17, 2024
8e752cf
Set default jwt values
CollectiveUnicorn Apr 17, 2024
1d83718
Adds config back to disable sidecar
CollectiveUnicorn Apr 17, 2024
42ca281
Configure labels as actions
CollectiveUnicorn Apr 17, 2024
74cfc11
Adds overwrite to namespace commands
CollectiveUnicorn Apr 17, 2024
db958e9
Enables kong db persistence
CollectiveUnicorn Apr 17, 2024
50ed00b
sets kong postgres default secret
CollectiveUnicorn Apr 17, 2024
b754917
Disables kong database
CollectiveUnicorn Apr 17, 2024
9d2ffdd
Adds uds package to manifests
CollectiveUnicorn Apr 17, 2024
5d26ee9
Adds separate component for uds
CollectiveUnicorn Apr 17, 2024
a0c2677
Adds disable force jwwt token gen and manually set uds package
CollectiveUnicorn Apr 18, 2024
5a2a567
Adjusts kong timeout
CollectiveUnicorn Apr 18, 2024
f697043
Adds database pvc removal to cleanup
CollectiveUnicorn Apr 18, 2024
1db30c5
Fixes typo
CollectiveUnicorn Apr 18, 2024
87d0f89
Removes namespace from uds package
CollectiveUnicorn Apr 18, 2024
f089bdb
Adds label for istio
CollectiveUnicorn Apr 18, 2024
c699c5d
Removes quotes around label
CollectiveUnicorn Apr 18, 2024
8335e10
Move back istio configs to separate component
CollectiveUnicorn Apr 18, 2024
8eb65b0
Attempts to escape label
CollectiveUnicorn Apr 18, 2024
985b140
Alternative formatting for label
CollectiveUnicorn Apr 18, 2024
c0a4dbc
Alternative formatting for label
CollectiveUnicorn Apr 18, 2024
6980171
Adds isstio label to auth
CollectiveUnicorn Apr 18, 2024
4872cd5
Attempts to escape problematic label
CollectiveUnicorn Apr 18, 2024
58dcf4a
Escapes istio label
CollectiveUnicorn Apr 18, 2024
bf5b689
Moves from label to annotation
CollectiveUnicorn Apr 18, 2024
9965a43
Removes unneeded zarf-config file and move annotation to auth
CollectiveUnicorn Apr 19, 2024
afb2831
Adds annotations to all pods
CollectiveUnicorn Apr 19, 2024
0debbe4
Overwrites pod label for startup
CollectiveUnicorn Apr 19, 2024
a15b03a
Reformat istio config
CollectiveUnicorn Apr 19, 2024
c6dd34a
Disables diagnostic mode
CollectiveUnicorn Apr 19, 2024
03c99d9
Updates the default services for bitnami
CollectiveUnicorn Apr 19, 2024
c3140c7
Modifies the default ports to match the services
CollectiveUnicorn Apr 19, 2024
a74482d
Collapse zarf.yaml and change studio port to 3000
CollectiveUnicorn Apr 19, 2024
1447fb6
Fix auth port and update uds-package
CollectiveUnicorn Apr 19, 2024
2435d4c
Fixes for istio config typos
CollectiveUnicorn Apr 19, 2024
9fa7d73
Removes uds package from zarf.yaml
CollectiveUnicorn Apr 19, 2024
4d61dfb
Adds back the explicit apply of the uds-package
CollectiveUnicorn Apr 19, 2024
fe7a5b2
Apply istio configs only to studio
CollectiveUnicorn Apr 19, 2024
5069344
Disables istio injection
CollectiveUnicorn Apr 19, 2024
5c9da4d
Disables diagnostic mode
CollectiveUnicorn Apr 19, 2024
fb45a08
Adds istio disable to common labels
CollectiveUnicorn Apr 19, 2024
226af72
Re-enable diagnostic mode
CollectiveUnicorn Apr 19, 2024
be11fc3
Set default supabase public url
CollectiveUnicorn Apr 19, 2024
c3aced7
Disables diagnostic mode
CollectiveUnicorn Apr 19, 2024
e61cc55
Disables netpols in chart
CollectiveUnicorn Apr 19, 2024
7d3b2e2
Enables diagnostic mode and removes istio suppression on studio
CollectiveUnicorn Apr 19, 2024
654d244
Removes common label disabling istio
CollectiveUnicorn Apr 19, 2024
3f4f0a6
Disables diagnostic mode
CollectiveUnicorn Apr 19, 2024
21f2eba
Adds istio disabling to all pods
CollectiveUnicorn Apr 19, 2024
08de05e
Changes labels to podlabels for postgres
CollectiveUnicorn Apr 19, 2024
4a5be55
Adds podlabels for kong
CollectiveUnicorn Apr 19, 2024
7c25a0b
Moves kong podLabels up a level
CollectiveUnicorn Apr 19, 2024
1f5b481
Removes community chart, moves uds-package.yaml up to root
CollectiveUnicorn Apr 19, 2024
6d634bc
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn Apr 19, 2024
08f6804
Tests re-enabling network policies for studio
CollectiveUnicorn Apr 19, 2024
9de9069
Adds kong to exposed services for auth integration
CollectiveUnicorn Apr 19, 2024
fbe1e2d
Sets all resource values to medium
CollectiveUnicorn Apr 19, 2024
95825f6
Fixes typo in external url
CollectiveUnicorn Apr 19, 2024
625425f
Force generate jwt keys on startup
CollectiveUnicorn Apr 19, 2024
757abb9
Sets public api url to supabase-kong
CollectiveUnicorn Apr 22, 2024
ad08494
Removes default jwt values
CollectiveUnicorn Apr 22, 2024
0f88971
Returns default jwt values
CollectiveUnicorn Apr 22, 2024
8310501
bumps timeout time, removes jwt secrets
CollectiveUnicorn Apr 22, 2024
69353e0
Adds job to create jwt
CollectiveUnicorn Apr 22, 2024
3bd70e0
Generates all necessary jwt values
CollectiveUnicorn Apr 22, 2024
3083077
Disable istio inject for jwt creator
CollectiveUnicorn Apr 23, 2024
8fe66d2
Removes jwt secret jobs
CollectiveUnicorn Apr 23, 2024
04ff2f9
Removes yaml for redundant job
CollectiveUnicorn Apr 23, 2024
bd2ff3a
Removes post-install hook
CollectiveUnicorn Apr 23, 2024
a571c3c
Sets hook to pre-install
CollectiveUnicorn Apr 23, 2024
f1454f1
Removes hook and set weight to 0
CollectiveUnicorn Apr 23, 2024
8fa3c50
Removes annotations
CollectiveUnicorn Apr 23, 2024
0401d88
Adds pre-install
CollectiveUnicorn Apr 23, 2024
bf1cc82
Adds component for creating namespace
CollectiveUnicorn Apr 23, 2024
1660bd5
Adds manifest for service account creation
CollectiveUnicorn Apr 23, 2024
85fb528
Adds chart for jwt bootstrapping
CollectiveUnicorn Apr 23, 2024
e0fd357
Adds chart directory
CollectiveUnicorn Apr 23, 2024
ddc50af
Moves service account creator to manifests
CollectiveUnicorn Apr 23, 2024
15be1dc
Replace helm templating
CollectiveUnicorn Apr 23, 2024
dbe9f57
Adds minimal chart for deploying jwt cli
CollectiveUnicorn Apr 23, 2024
d3fe3b5
Changes pre-install to post-install
CollectiveUnicorn Apr 23, 2024
56a330f
Adds post-install to minimal values
CollectiveUnicorn Apr 23, 2024
d01c75c
Disables persistence in minimal chart
CollectiveUnicorn Apr 23, 2024
74c206a
Removes post-install hook
CollectiveUnicorn Apr 23, 2024
4fa9d50
Removes unneeded values for minimal jwt values file
CollectiveUnicorn Apr 23, 2024
57759fb
Add and disable persistence
CollectiveUnicorn Apr 23, 2024
060cb60
Moves persistence config under storage
CollectiveUnicorn Apr 23, 2024
1e6c54d
Adds initial keycloak configs and zarf vars
CollectiveUnicorn Apr 23, 2024
8eb8fb4
Adds quotes around description
CollectiveUnicorn Apr 23, 2024
3ff1faf
Removes description
CollectiveUnicorn Apr 23, 2024
d1ec777
Revert "Removes description"
CollectiveUnicorn Apr 23, 2024
2ed2e5f
Replaces = with :
CollectiveUnicorn Apr 23, 2024
156b102
Replace keycloak vars with zarf vars, start external secrets
CollectiveUnicorn Apr 24, 2024
445d89c
Adds values file for external secrets
CollectiveUnicorn Apr 24, 2024
8d465a8
Fixes Zarf variable syntax
CollectiveUnicorn Apr 24, 2024
92125ee
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn Apr 24, 2024
f872b9b
Adds keycloak configs to the manifest
CollectiveUnicorn Apr 24, 2024
e0339f0
Removes all of the external secrets configs
CollectiveUnicorn Apr 24, 2024
d5a60c7
Adds additional keycloak secret to supabase configs
CollectiveUnicorn Apr 24, 2024
a32345a
Adds readme that includes keycloak startup information
CollectiveUnicorn Apr 24, 2024
5a00a53
Moves keycloak secret out of envvarssecret and into env vars
CollectiveUnicorn Apr 24, 2024
49fda18
Adds zarf variable to optionally overwrite the postgres db
CollectiveUnicorn Apr 25, 2024
b87eee7
Sets postgres secret to prompt on Zarf deploy
CollectiveUnicorn Apr 25, 2024
b723b94
Fixes typo in zarf var
CollectiveUnicorn Apr 25, 2024
0704a06
Temporarily removes Zarf var
CollectiveUnicorn Apr 25, 2024
c990e5c
Returns postgres secret var
CollectiveUnicorn Apr 25, 2024
44e4e12
Attempts to backup secret on deploy
CollectiveUnicorn Apr 25, 2024
7aeb41d
Add readme notes to address database issue
CollectiveUnicorn Apr 25, 2024
5f19fe3
Fixes namespace typo
CollectiveUnicorn Apr 25, 2024
f521194
Updates script to have graceful failures
CollectiveUnicorn Apr 25, 2024
985cd20
Forces successful state on script end
CollectiveUnicorn Apr 25, 2024
5f0572e
Removes multi-line ports of script
CollectiveUnicorn Apr 25, 2024
08d21c0
One line only script
CollectiveUnicorn Apr 25, 2024
8ff3fc8
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn Apr 25, 2024
192d994
Moves postgres fixes into a script
CollectiveUnicorn Apr 25, 2024
33d54ad
Fixes issue with script not having permission to run
CollectiveUnicorn Apr 25, 2024
9f05721
Handles case where secrets don't exist
CollectiveUnicorn Apr 25, 2024
eff3c7a
Updates script sha sum
CollectiveUnicorn Apr 25, 2024
dd34f68
Postgres script fixes
CollectiveUnicorn Apr 25, 2024
440965c
Updates script sha sum
CollectiveUnicorn Apr 25, 2024
aa737b6
Updates script sha sum
CollectiveUnicorn Apr 25, 2024
53f826a
Removes unneeded configs, sets default dashboard user/pass updates re…
CollectiveUnicorn Apr 26, 2024
7547a78
Swap studio egress rule with kong
CollectiveUnicorn Apr 26, 2024
f1ef023
Allows studio egress but not kong
CollectiveUnicorn Apr 26, 2024
2aa6e45
Adds supabase basic-auth configs
CollectiveUnicorn Apr 26, 2024
bbabc4f
Removes supabase metadata, fixes config
CollectiveUnicorn Apr 26, 2024
b5a1e72
Updates the configmap for kong
CollectiveUnicorn Apr 26, 2024
bad11e8
Removes unnecessary variables and generates a dashboard in the helm t…
CollectiveUnicorn Apr 26, 2024
2a08140
Adds configmap values as kustomizations
CollectiveUnicorn Apr 26, 2024
483265d
Moves configmap to kustomizations folder
CollectiveUnicorn Apr 26, 2024
d1bf883
Adds start of secret manifest, kustomization, and kong tpl
CollectiveUnicorn Apr 26, 2024
6226781
Replaces var with const uses merge configmap instead of gnerating
CollectiveUnicorn Apr 26, 2024
c91b2ff
Moves configmap to kustomizations folder
CollectiveUnicorn Apr 26, 2024
5d5445c
Removes managed by helm
CollectiveUnicorn Apr 26, 2024
bf51345
Moves configs into bootstrap manifest
CollectiveUnicorn Apr 26, 2024
9ed8956
Replace the built in Supabase declarative configmap
CollectiveUnicorn Apr 26, 2024
c8edf6b
Replaces var with const uses merge configmap instead of gnerating
CollectiveUnicorn Apr 26, 2024
44083ad
Adds post-processing for supabase install
CollectiveUnicorn Apr 26, 2024
6a919be
Change ondeploy from after to before
CollectiveUnicorn Apr 26, 2024
c879d4b
Adds basic auth plugin to kong, restarts on cm update
CollectiveUnicorn Apr 26, 2024
302570b
Fixes routing and tests env variable replacement
CollectiveUnicorn Apr 26, 2024
179ffde
Moves variable into init container
CollectiveUnicorn Apr 26, 2024
b971447
Create dashboard secrets
CollectiveUnicorn Apr 26, 2024
780a835
Use kustomization to generate secret
CollectiveUnicorn Apr 26, 2024
afbfba9
Removes hash at end of secret
CollectiveUnicorn Apr 26, 2024
81d3750
Ensure secret is overwritten
CollectiveUnicorn Apr 26, 2024
4ad2060
Replaces unnecessary merge behavior
CollectiveUnicorn Apr 26, 2024
54ace35
Revert change
CollectiveUnicorn Apr 26, 2024
85e281d
Adds dummy secret for overwriting with random gen secret
CollectiveUnicorn Apr 26, 2024
a0435a5
Fixes dashboard secret
CollectiveUnicorn Apr 26, 2024
29c64e0
Improves secretgenerator
CollectiveUnicorn Apr 26, 2024
b4aa8ab
Fix kustomization
CollectiveUnicorn Apr 26, 2024
c8a6c92
Removes external secrets values and creats chart for secrets gen
CollectiveUnicorn Apr 26, 2024
c733e9d
Fixes go syntax
CollectiveUnicorn Apr 26, 2024
4184cc9
Splits up component into jst and secrets
CollectiveUnicorn Apr 26, 2024
76d56d3
Prevents jwt secret removal
CollectiveUnicorn Apr 26, 2024
1e31c21
Adds back images
CollectiveUnicorn Apr 26, 2024
69f385e
Disables force run on supabase deploy of jwt init
CollectiveUnicorn Apr 26, 2024
81b6f88
Puts all bootstrap into one component
CollectiveUnicorn Apr 26, 2024
765abc9
Fixes secret name
CollectiveUnicorn Apr 26, 2024
1203eaf
Changes chart name
CollectiveUnicorn Apr 26, 2024
ea21297
Temporarily disable realtime
CollectiveUnicorn Apr 26, 2024
769fbe0
Deconflicts helm chart names
CollectiveUnicorn Apr 26, 2024
5a4c6bb
Improves clena script and changes password name
CollectiveUnicorn Apr 26, 2024
28b8ac6
Updates secret name to match chart
CollectiveUnicorn Apr 26, 2024
acabed2
Moves postgres out of primary deployment and into the bootstrap
CollectiveUnicorn Apr 27, 2024
6293ddc
Moves postgres back to primary deployment
CollectiveUnicorn Apr 27, 2024
b8599f6
Bumps common annotations back a level
CollectiveUnicorn Apr 27, 2024
b5f4bd1
Allows for enabling and disabling components via Zarf variables
CollectiveUnicorn Apr 27, 2024
ac61eca
Improve readme
CollectiveUnicorn Apr 27, 2024
51fd7a6
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn Apr 27, 2024
91b1a74
Removes postgres persistence scripts
CollectiveUnicorn Apr 27, 2024
dd2d2f2
Cleanup zarf configs
CollectiveUnicorn Apr 27, 2024
f779bb0
Adds access information for supabase-studio to readme
CollectiveUnicorn Apr 27, 2024
8f3675d
Moves cm deletion to after successful deployment
CollectiveUnicorn Apr 27, 2024
16840bc
Fixes typo and reverts config
CollectiveUnicorn Apr 27, 2024
9bd3f19
Fixes remaining zarf var typos
CollectiveUnicorn Apr 27, 2024
2b79aa5
chore: adding basic e2e-test for supabase (#446)
gphorvath Apr 29, 2024
be4f670
Merge branch 'main' into add-supabase-deployment
gphorvath Apr 30, 2024
20e8369
Adds local registry push to mkaefile, updates readme, and comments
CollectiveUnicorn Apr 30, 2024
0df761b
Removes unnecessary secret creation in e2e workflow
CollectiveUnicorn Apr 30, 2024
8b6b473
Changes default keycloak client id to leapfrogai
CollectiveUnicorn Apr 30, 2024
228e1ee
Removes clean-cluster script
CollectiveUnicorn Apr 30, 2024
143f9da
Moves Zarf const out of configmap and into values
CollectiveUnicorn Apr 30, 2024
a018099
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn Apr 30, 2024
3cfe7d8
Improves readme instructions
CollectiveUnicorn Apr 30, 2024
0004ebf
Adds additional info to readme
CollectiveUnicorn Apr 30, 2024
52c1042
Moves variables to consts
CollectiveUnicorn Apr 30, 2024
1ed4d18
Adds templating to uds package
CollectiveUnicorn Apr 30, 2024
f45fee0
Shrinks basic values file with assumption of overwrite
CollectiveUnicorn Apr 30, 2024
d4836e2
Adds uds package configs
CollectiveUnicorn Apr 30, 2024
6c1a63a
Removes manifest
CollectiveUnicorn Apr 30, 2024
d345134
Returns the manifest
CollectiveUnicorn Apr 30, 2024
a98028d
Fixes UI reference for new jwt name
CollectiveUnicorn Apr 30, 2024
0e4d858
Moves uds-package into local chart
CollectiveUnicorn Apr 30, 2024
363aae8
Adds bitnami-values to local chart
CollectiveUnicorn Apr 30, 2024
e045903
Adds local registry dependency for supabase
CollectiveUnicorn Apr 30, 2024
d62fa74
Adds initial health check test for Supabase
CollectiveUnicorn May 1, 2024
d1818c9
Ruff fixes
CollectiveUnicorn May 1, 2024
786f055
Adds image version to create command
CollectiveUnicorn May 1, 2024
a7e7a70
Removes local registry and unnecessary uds configs
CollectiveUnicorn May 1, 2024
c1c2c4c
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn May 1, 2024
cb8b35d
Removes testing variable in favor of pulling the creds out of k8s
CollectiveUnicorn May 1, 2024
92d157c
Ruff formatting changes to test
CollectiveUnicorn May 1, 2024
5894f1a
Sets the local version to the expected value of e2e-test
CollectiveUnicorn May 1, 2024
cbb8d10
Adds smaller values file for supabase
CollectiveUnicorn May 1, 2024
344250c
Adds dummy secret and readme updates
CollectiveUnicorn May 1, 2024
ba35218
Fixes new keycloak secret template
CollectiveUnicorn May 1, 2024
04c931e
Replaces bitnami-values with bitnami-values-shrunk
CollectiveUnicorn May 1, 2024
38a5dbf
Updates how env is being set
CollectiveUnicorn May 1, 2024
194d087
Adds step for setting env variable
CollectiveUnicorn May 1, 2024
df558ed
Set env variable per the docs suggestion
CollectiveUnicorn May 1, 2024
b207352
Adds script to wait for network connection
CollectiveUnicorn May 1, 2024
f2e20e8
Replaces blank resource type with correct value
CollectiveUnicorn May 1, 2024
bf6fe98
Adds namespace to check
CollectiveUnicorn May 1, 2024
ec74e9f
Changes resource name from supabase-studio to supabase
CollectiveUnicorn May 1, 2024
d73d93d
Adds script to zarf package
CollectiveUnicorn May 1, 2024
5ffb0fa
Adds chmod to wait script
CollectiveUnicorn May 1, 2024
bbecc70
Waits for kong to be ready after rollout restart
CollectiveUnicorn May 1, 2024
b8a30b8
Look for ready sand status to confirm deployment has been rolled out
CollectiveUnicorn May 1, 2024
a53ceda
Performs an initial check to see if pods are ready
CollectiveUnicorn May 1, 2024
f9be536
Removes scripts in favor of rollout status
CollectiveUnicorn May 1, 2024
0eb155c
Removes insecure flag from zarf package creation
CollectiveUnicorn May 6, 2024
db813f3
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn May 6, 2024
63b24c3
Starts adding sso configs to package
CollectiveUnicorn May 6, 2024
8ea6735
Upadates the descriptions of components in Zarf.yaml
CollectiveUnicorn May 6, 2024
010f935
Adds comments to yaml to explain kong config steps
CollectiveUnicorn May 7, 2024
220a54b
Removes public exposure, adds sso, updates tests
CollectiveUnicorn May 7, 2024
61b9ac0
Removes dashboard references
CollectiveUnicorn May 7, 2024
4528519
Removes dashboard secret
CollectiveUnicorn May 7, 2024
413788b
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn May 7, 2024
30cc128
Ruff linting and keycloak secret refactor
CollectiveUnicorn May 7, 2024
af73535
Reverts removed config
CollectiveUnicorn May 7, 2024
20e7201
Adds exclusive auth redirect
CollectiveUnicorn May 7, 2024
b5f3c98
Add missing volume mount loader
CollectiveUnicorn May 8, 2024
4a22848
Reverts volume mount change
CollectiveUnicorn May 8, 2024
5427296
Updates e2e test based on the new config
CollectiveUnicorn May 8, 2024
92cddaf
Swaps bundle order due to the UI depending on supabase
CollectiveUnicorn May 8, 2024
fca9822
Removes auth only endpoint constraint
CollectiveUnicorn May 8, 2024
9efda0a
Reverts dashboard changes
CollectiveUnicorn May 8, 2024
b7ed4ad
Updates readme
CollectiveUnicorn May 8, 2024
ebdebfb
Removes superfluous information
CollectiveUnicorn May 8, 2024
f95bc5f
Fixes test variable and readme reference
CollectiveUnicorn May 8, 2024
9b7192b
Minimize keycloak configs
CollectiveUnicorn May 8, 2024
9147c7e
Removes protocol from sso configs
CollectiveUnicorn May 9, 2024
d2b8292
Merge branch 'main' into add-supabase-deployment
CollectiveUnicorn May 9, 2024
e5c8360
Adds test comment and vector to default libraries
CollectiveUnicorn May 9, 2024
9f0a810
Adds sso clientId to leapfrogai to replace hardcoded value
CollectiveUnicorn May 9, 2024
dad80fc
Adds ui templating for supabase jwt secret
CollectiveUnicorn May 9, 2024
dd80199
Reverts templating for jwt secret name in the ui
CollectiveUnicorn May 9, 2024
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
3 changes: 3 additions & 0 deletions packages/supabase/clean-cluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kubectl delete deployments --all -n leapfrogai
helm uninstall supabase -n leapfrogai
zarf package remove supabase --confirm
26 changes: 26 additions & 0 deletions packages/supabase/initial-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
docker tag supabase/studio:20230127-6bfd87b localhost:5000/supabase/studio:20230127-6bfd87b
docker push localhost:5000/supabase/studio:20230127-6bfd87b

docker tag supabase/postgres:14.1.0.105 localhost:5000/supabase/postgres:14.1.0.105
docker push localhost:5000/supabase/postgres:14.1.0.105

docker tag postgres:15-alpine localhost:5000/postgres:15-alpine
docker push localhost:5000/postgres:15-alpine

docker tag supabase/gotrue:v2.146.0 localhost:5000/supabase/gotrue:v2.146.0
docker push localhost:5000/supabase/gotrue:v2.146.0

docker tag postgrest/postgrest:latest localhost:5000/postgrest/postgrest:latest
docker push localhost:5000/postgrest/postgrest:latest

docker tag supabase/realtime:v2.1.0 localhost:5000/supabase/realtime:v2.1.0
docker push localhost:5000/supabase/realtime:v2.1.0

docker tag supabase/storage-api:v0.26.1 localhost:5000/supabase/storage-api:v0.26.1
docker push localhost:5000/supabase/storage-api:v0.26.1

docker tag kong:2.8.1 localhost:5000/kong:2.8.1
docker push localhost:5000/kong:2.8.1

docker tag supabase/postgres-meta:latest localhost:5000/supabase/postgres-meta:latest
docker push localhost:5000/supabase/postgres-meta:latest
25 changes: 25 additions & 0 deletions packages/supabase/supabase-kubernetes/charts/supabase/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v2
name: supabase
description: The open source Firebase alternative.

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
# Not used because too difficult to follow correctly
# appVersion: "1.16.0"
189 changes: 189 additions & 0 deletions packages/supabase/supabase-kubernetes/charts/supabase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Supabase for Kubernetes with Helm 3
CollectiveUnicorn marked this conversation as resolved.
Show resolved Hide resolved

This directory contains the configurations and scripts required to run Supabase inside a Kubernetes cluster.

## Disclamer

We use [supabase/postgres](https://hub.docker.com/r/supabase/postgres) to create and manage the Postgres database. This permit you to use replication if needed but you'll have to use the Postgres image provided Supabase or build your own on top of it. You can also choose to use other databases provider like [StackGres](https://stackgres.io/) or [Postgres Operator](https://github.com/zalando/postgres-operator).

For the moment we are using a root container to permit the installation of the missing `pgjwt` and `wal2json` extension inside the `initdbScripts`. This is considered a security issue, but you can use your own Postgres image instead with the extension already installed to prevent this. We provide an example of `Dockerfile`for this purpose, you can use [ours](https://hub.docker.com/r/tdeoliv/supabase-bitnami-postgres) or build and host it on your own.

The database configuration we provide is an example using only one master. If you want to go to production, we highly recommend you to use a replicated database.

## Quickstart

> For this section we're using Minikube and Docker to create a Kubernetes cluster

```bash
# Clone Repository
git clone https://github.com/supabase-community/supabase-kubernetes

# Switch to charts directory
cd supabase-kubernetes/charts/supabase/

# Create JWT secret
kubectl -n default create secret generic demo-supabase-jwt \
--from-literal=anonKey='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICAgInJvbGUiOiAiYW5vbiIsCiAgICAiaXNzIjogInN1cGFiYXNlIiwKICAgICJpYXQiOiAxNjc1NDAwNDAwLAogICAgImV4cCI6IDE4MzMxNjY4MDAKfQ.ztuiBzjaVoFHmoljUXWmnuDN6QU2WgJICeqwyzyZO88' \
--from-literal=serviceKey='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICAgInJvbGUiOiAic2VydmljZV9yb2xlIiwKICAgICJpc3MiOiAic3VwYWJhc2UiLAogICAgImlhdCI6IDE2NzU0MDA0MDAsCiAgICAiZXhwIjogMTgzMzE2NjgwMAp9.qNsmXzz4tG7eqJPh1Y58DbtIlJBauwpqx39UF-MwM8k' \
--from-literal=secret='abcdefghijklmnopqrstuvwxyz123456'

# Create SMTP secret
kubectl -n default create secret generic demo-supabase-smtp \
--from-literal=username='[email protected]' \
--from-literal=password='example123456'

# Create DB secret
kubectl -n default create secret generic demo-supabase-db \
--from-literal=username='postgres' \
--from-literal=password='example123456'

# Install the chart
helm -n default install demo -f values.example.yaml .
```

The first deployment can take some time to complete (especially auth service). You can view the status of the pods using:

```bash
kubectl -n default get pod

NAME READY STATUS RESTARTS AGE
demo-supabase-auth-78547c5c8d-chkbm 1/1 Running 2 (40s ago) 47s
demo-supabase-db-5bc75fbf56-4cxcv 1/1 Running 0 47s
demo-supabase-kong-8c666695f-5vzwt 1/1 Running 0 47s
demo-supabase-meta-6779677c7-s77qq 1/1 Running 0 47s
demo-supabase-realtime-6b55986d7d-csnr7 1/1 Running 0 47s
demo-supabase-rest-5d864469d-bk5rv 1/1 Running 0 47s
demo-supabase-storage-6c878dcbd4-zzzcv 1/1 Running 0 47s
```

### Tunnel with Minikube

When the installation will be complete you'll be able to create a tunnel using minikube:

```bash
# First, enable the ingress addon in Minikube
minikube addons enable ingress

# Then enable the tunnel (will need sudo credentials because you are opening Port 80/443 on your local machine)
minikube tunnel
```

If you just use the `value.example.yaml` file, you can access the API or the Studio App using the following endpoints:

- <http://api.localhost>
- <http://studio.localhost>

### Uninstall

```Bash
# Uninstall Helm chart
helm -n default uninstall demo

# Delete secrets
kubectl -n default delete secret demo-supabase-db
kubectl -n default delete secret demo-supabase-jwt
kubectl -n default delete secret demo-supabase-smtp
```

## Customize

You should consider to adjust the following values in `values.yaml`:

- `JWT_SECRET_NAME`: Reference to Kubernetes secret with JWT secret data `secret`, `anonKey` & `serviceKey`
- `SMTP_SECRET_NAME`: Reference to Kubernetes secret with SMTP credentials `username` & `password`
- `DB_SECRET_NAME`: Reference to Kubernetes secret with Postgres credentials `username` & `password`
- `RELEASE_NAME`: Name used for helm release
- `NAMESPACE`: Namespace used for the helm release
- `API.EXAMPLE.COM` URL to Kong API
- `STUDIO.EXAMPLE.COM` URL to Studio

If you want to use mail, consider to adjust the following values in `values.yaml`:

- `SMTP_ADMIN_MAIL`
- `SMTP_HOST`
- `SMTP_PORT`
- `SMTP_SENDER_NAME`

### JWT Secret

We encourage you to use your own JWT keys by generating a new Kubernetes secret and reference it in `values.yaml`:

```yaml
jwt:
secretName: "JWT_SECRET_NAME"
```

The secret can be created with kubectl via command-line:

```bash
kubectl -n NAMESPACE create secret generic JWT_SECRET_NAME \
--from-literal=secret='JWT_TOKEN_AT_LEAST_32_CHARACTERS_LONG' \
--from-literal=anonKey='JWT_ANON_KEY' \
--from-literal=serviceKey='JWT_SERVICE_KEY'
```

> 32 characters long secret can be generated with `openssl rand 64 | base64`
> You can use the [JWT Tool](https://supabase.com/docs/guides/hosting/overview#api-keys) to generate anon and service keys.

### SMTP Secret

Connection credentials for the SMTP mail server will also be provided via Kubernetes secret referenced in `values.yaml`:

```yaml
smtp:
secretName: "SMTP_SECRET_NAME"
```

The secret can be created with kubectl via command-line:

```bash
kubectl -n NAMESPACE create secret generic SMTP_SECRET_NAME \
--from-literal=username='SMTP_USER' \
--from-literal=password='SMTP_PASSWORD'
```

### DB Secret

DB credentials will also be stored in a Kubernetes secret and referenced in `values.yaml`:

```yaml
db:
secretName: "DB_SECRET_NAME"
```

The secret can be created with kubectl via command-line:

```bash
kubectl -n NAMESPACE create secret generic DB_SECRET_NAME \
--from-literal=username='DB_USER' \
--from-literal=password='PW_USER'
```

> If you depend on database providers like [StackGres](https://stackgres.io/) or [Postgres Operator](https://github.com/zalando/postgres-operator) you only need to reference the already existing secret in `values.yaml`.

## How to use in Production

We didn't provide a complete configuration to go production because of the multiple possibility.

But here are the important points you have to think about:

- Use a replicated version of the Postgres database.
- Add SSL to the Postgres database.
- Add SSL configuration to the ingresses endpoints using either the `cert-manager` or a LoadBalancer provider.
- Change the domain used in the ingresses endpoints.
- Generate a new secure JWT Secret.

## Troubleshooting

### Ingress Controller and Ingress Class

Depending on your Kubernetes version you might want to fill the `className` property instead of the `kubernetes.io/ingress.class` annotations. For example:

```yml
kong:
ingress:
enabled: 'true'
className: "nginx"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "supabase.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "supabase.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "supabase.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "supabase.labels" -}}
helm.sh/chart: {{ include "supabase.chart" . }}
{{ include "supabase.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "supabase.selectorLabels" -}}
app.kubernetes.io/name: {{ include "supabase.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "supabase.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "supabase.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "supabase.auth.name" -}}
{{- default (print .Chart.Name "-auth") .Values.auth.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "supabase.auth.fullname" -}}
{{- if .Values.auth.fullnameOverride }}
{{- .Values.auth.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default (print .Chart.Name "-auth") .Values.auth.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "supabase.auth.selectorLabels" -}}
app.kubernetes.io/name: {{ include "supabase.auth.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "supabase.auth.serviceAccountName" -}}
{{- if .Values.auth.serviceAccount.create }}
{{- default (include "supabase.auth.fullname" .) .Values.auth.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.auth.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.auth.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "supabase.auth.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
data:
{{- toYaml .Values.auth.environment | nindent 2 }}
{{- end }}
Loading