Giter VIP home page Giter VIP logo

supabase-kubernetes's Introduction

Self-hosted Supabase with Kubernetes

This is a set of plain Kubernetes YAML files to deploy a self-hosted Supabase instance.

There are a few forks of the outdated community supported Supabase Helm chart, you can check them out.

Note

This is a Draft. Not fully tested yet.

Installation

Create namespace for Supabase and set it as default

kubectl create ns supabase
kubectl config set-context --current --namespace=supabase

Postgres

Edit PVC in postgres/postgres.yaml

Create secret with postgres login/password

kubectl create secret generic supabase-db \
    --from-literal=username='postgres' \
    --from-literal=password='YOUR-DB-PASS'

Important

Don't use provided keys in production environments.

Create your own JWT keys here https://supabase.com/docs/guides/self-hosting/docker#generate-api-keys

kubectl create secret generic supabase-jwt \
    --from-literal=secret='x2zhph7hixlm99chy3v1ad2cfemvym6pu25pr0wf' \
    --from-literal=anonKey='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzEyMTc4MDAwLAogICJleHAiOiAxODY5OTQ0NDAwCn0.GcZn--EiwXXV88DHlOjD3m9NNCjVP2McMAO9WwvityI' \
    --from-literal=serviceKey='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogInNlcnZpY2Vfcm9sZSIsCiAgImlzcyI6ICJzdXBhYmFzZSIsCiAgImlhdCI6IDE3MTIxNzgwMDAsCiAgImV4cCI6IDE4Njk5NDQ0MDAKfQ.FBB5oOrnKsQYrD6NzNr34Y3zf_MBUJ7dPSgm2Rk4I30'
kubectl apply -f postgres/postgres-conf.yaml
kubectl apply -f postgres/postgres.yaml

Meta (RESTful API for managing PostgreSQL)

kubectl apply -f meta.yaml

PostgRest (RESTful API for PostgreSQL)

kubectl apply -f rest.yaml

Kong (Routing and REST API authorization)

This service is an entry point to access all Supabase services. Don't expose other services if you don't know what are you doing.

Setup NodePort/LoadBalancer for Service in kong/service.yaml or use kong/ingress.yaml

Create secret for dashboard basic authentication

kubectl create secret generic supabase-kong \
    --from-literal=username='supabase' \
    --from-literal=password='dashboard-password'
kubectl apply -f kong

Realtime (Broadcast messages about Postgres changes)

kubectl apply -f realtime.yaml

Storage (S3 compatible file storage)

Edit PVC in storage.yaml

kubectl apply -f storage.yaml

Imgproxy (REST API for cropping, resizing and rotating images)

kubectl apply -f imgproxy.yaml

Auth (GoTrue. User registration and authentication)

Set API_EXTERNAL_URL, GOTRUE_SITE_URL and SMTP variables in auth.yaml

Create secret for smtp authentication

kubectl create secret generic gotrue-smtp \
    --from-literal=username='[email protected]' \
    --from-literal=password='SMTP-PASSWORD'
kubectl apply -f auth.yaml

Edge functions

kubectl apply -f functions

Analytics (Logflare)

openssl rand -hex 20
e32e83530e9981ee07b9e0757d7bbbccef9c2ef9
kubectl create secret generic supabase-logflare \
    --from-literal=apiKey='e32e83530e9981ee07b9e0757d7bbbccef9c2ef9'
kubectl apply -f analytics.yaml

Studio (Supabase Dashboard)

Set SUPABASE_URL in studio.yaml

kubectl apply -f studio.yaml

Vector (optional) (Collect, transform, and route logs)

Uses hostPath volumes to access pods logs

kubectl apply -f vector

supabase-kubernetes's People

Contributors

sergeykorablin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.