diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..19e1105 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,41 @@ +name: Deploy pages +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: "0" + fetch-tags: "true" + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + + - name: Install python packages + run: pip install -r requirements.txt + + - name: Build the website + run: mkdocs build + + - name: Copy files to the s3 website content bucket + run: aws s3 sync site s3://${{ secrets.HCLOUD_BUCKET }} --delete + env: + AWS_ACCESS_KEY_ID: ${{ secrets.HCLOUD_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.HCLOUD_SECRET_KEY }} + AWS_DEFAULT_REGION: hel1 + AWS_ENDPOINT_URL: ${{ secrets.HCLOUD_ENDPOINT }} diff --git a/.gitignore b/.gitignore index dc21135..e68c122 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ bin/ out/ .idea/ .venv/ -# Added by goreleaser init: +site/ dist/ diff --git a/README.md b/README.md index 6b5ffdc..32aba2f 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,46 @@ # supabase-operator -// TODO(user): Add simple overview of use/purpose + +This is a Kubernetes operator for managing Supabase instances. +It is built using the [Kubebuilder](https://book.kubebuilder.io/) framework. ## Description -// TODO(user): An in-depth paragraph about your project and overview of use + +This is currently a work-in-progress experiment to replace existing Helm charts for Supabase as they tend to be hard to deploy and to manage and the default Supabase stack - although working great as a single instance or in their SaaS instances - isn't a perfect fit for Kubernetes. +This operator replaces tedious Helm values files with a small set of custom resources that allow an user to quickly deploy a Supabase instance without having to know much (if anything) of the Supabase internals. + +## Targets + +- Make it as easy as possible to deploy Supabase on a Kubernetes cluster +- Manage updates of components +- Run Supabase specific migrations on the database (those managed in the supabase/postgres repository) +- Make Supabase as resource effective as possible (e.g. replaced Kong with Envoy) +- Keep it as secure as possible (e.g. adding OAuth2/Basic auth to studio if desired) +- Manage **all** aspects of the Kubernetes resources, this operator manages everything where a user would need deeper insights into Supabase like: + - Deployments + - Services + - Secrets (although you can ship your own if you want to) + - ConfigMaps + - *soon*: NetworkPolicies + +## Non-Targets + +- Manage **all** Kubernetes aspects, it does **not** create: + - PodDisruptionBudgets + - HorizontalPodAutoscalers + - Ingress or HTTPRoutes +- Replace existing Postgres operators like cloudnative-pg, CrunchyData, Zalando Postgres Operator, ... +- Manage the database instance e.g. making backups, ... that should be done by the Postgres operator or by the user +- Manage your application e.g. run app specific migrations, host your frontend, ... + +This operator tries to be as un-opionionated as possible and thereofore does not make assumptions on how you expose APIs to your users (Ingress, GatewayAPI, LoadBalancer service (coming soon))... ## Getting Started ### Prerequisites -- go version v1.22.0+ -- docker version 17.03+. -- kubectl version v1.11.3+. -- Access to a Kubernetes v1.11.3+ cluster. +- go version v1.23.x+ +- docker version 27.+. +- kubectl version v1.30.0+. +- Access to a Kubernetes v1.30.+ cluster. ### To Deploy on the cluster **Build and push your image to the location specified by `IMG`:** @@ -89,16 +119,9 @@ Users can just run kubectl apply -f to install the project kubectl apply -f https://raw.githubusercontent.com//supabase-operator//dist/install.yaml ``` -## Contributing -// TODO(user): Add detailed information on how you would like others to contribute to this project - -**NOTE:** Run `make help` for more information on all potential `make` targets - -More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) - ## License -Copyright 2024 Peter Kurfer. +Copyright 2025 Peter Kurfer. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -111,4 +134,3 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - diff --git a/docs/components/core.md b/docs/components/core.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/components/overview.md b/docs/components/overview.md new file mode 100644 index 0000000..95bd195 --- /dev/null +++ b/docs/components/overview.md @@ -0,0 +1,19 @@ +# Overview + +## Architecture + +The following diagram explains the overall architecture of Supabase as it is deployed from this operator: + +```kroki-excalidraw +@from_file:./images/overview.excalidraw +``` + +The dashed parts on the left are not managed by this operator but illustrate how traffic can be routed to the Supabase instance. + +## Core + +The `Core` custom resource (CR) is the basic resource that - if not in an 'edge case' (pun intended) - configures all basic aspects of a Supabase instance: + +- PostgREST API +- Supabase Auth +- initial database migrations diff --git a/docs/getting_started.md b/docs/getting_started.md index e69de29..939137b 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -0,0 +1,14 @@ +# Getting Started + +## Deploying the operator + +The easiest way to deploy the operator is to fetch the manifest from the [releases](https://code.icb4dc0.de/prskr/supabase-operator/releases) and apply it like this: + +```bash +kubectl apply --server-side -f manifest.yaml +``` + +The manifest is rendered as part of the release workflow and based on [kustomize](https://kustomize.io/). +If you want to customize the deployment, you can start from the [release/default](https://code.icb4dc0.de/prskr/supabase-operator/src/branch/main/config/release/default) layer and build your own manifest. + +## Deploying a basic Supabase instance diff --git a/docs/images/overview.excalidraw b/docs/images/overview.excalidraw new file mode 100644 index 0000000..977bbd5 --- /dev/null +++ b/docs/images/overview.excalidraw @@ -0,0 +1,1368 @@ +{ + "type": "excalidraw", + "version": 2, + "source": "https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor", + "elements": [ + { + "id": "ejUrKXpo4iZVW3jBLrd7_", + "type": "diamond", + "x": 349.02734375, + "y": 503.396484375, + "width": 281.9296875, + "height": 175.828125, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 1242170585, + "version": 320, + "versionNonce": 599047801, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "cUBABwUzmvgMXgxc9-De1" + }, + { + "id": "pC99qr7U3A8juLWAUObHK", + "type": "arrow" + }, + { + "id": "u9BGCwnS8XgZHK0gnQYoZ", + "type": "arrow" + }, + { + "id": "fdCztyeGlfulEMnyXgQlF", + "type": "arrow" + }, + { + "id": "Azsw14rZug0MOJLy-2TOg", + "type": "arrow" + }, + { + "id": "iUsPrQvsaz_aihPTYsooG", + "type": "arrow" + }, + { + "id": "U6hRiuEz4b7lGMVdS4lHJ", + "type": "arrow" + }, + { + "id": "F9JWBdBv3cMGG9dRk3-Ih", + "type": "arrow" + }, + { + "id": "H_7Sh4TTYk3oaJyHWlMGY", + "type": "arrow" + }, + { + "id": "wSbE9bNPtKVogvCrRraWF", + "type": "arrow" + } + ], + "updated": 1737450353296, + "link": null, + "locked": false + }, + { + "id": "cUBABwUzmvgMXgxc9-De1", + "type": "text", + "x": 428.25980377197266, + "y": 578.853515625, + "width": 123.49992370605469, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 1043131545, + "version": 558, + "versionNonce": 523374809, + "isDeleted": false, + "boundElements": null, + "updated": 1737450160367, + "link": null, + "locked": false, + "text": "APIGateway", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "ejUrKXpo4iZVW3jBLrd7_", + "originalText": "APIGateway", + "lineHeight": 1.25 + }, + { + "id": "7R_fvrV_cnrU5O0fRsrzh", + "type": "rectangle", + "x": 899.82421875, + "y": 483.3125, + "width": 246.109375, + "height": 215.99609375, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "lrJL1xRdaxRXbRSHo8QbD" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 1289392505, + "version": 180, + "versionNonce": 724580311, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "KCrvdGm85llxJupkrvPVv" + } + ], + "updated": 1737450154539, + "link": null, + "locked": false + }, + { + "id": "KCrvdGm85llxJupkrvPVv", + "type": "text", + "x": 1001.1289291381836, + "y": 578.810546875, + "width": 43.49995422363281, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "lrJL1xRdaxRXbRSHo8QbD" + ], + "frameId": null, + "roundness": null, + "seed": 254171993, + "version": 128, + "versionNonce": 150017305, + "isDeleted": false, + "boundElements": null, + "updated": 1737450154539, + "link": null, + "locked": false, + "text": "Core", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "7R_fvrV_cnrU5O0fRsrzh", + "originalText": "Core", + "lineHeight": 1.25 + }, + { + "id": "tCc1517C33_iWMg4YouPU", + "type": "rectangle", + "x": 957.41796875, + "y": 500.7734375, + "width": 130.921875, + "height": 55.96874999999998, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "lrJL1xRdaxRXbRSHo8QbD" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 10872471, + "version": 122, + "versionNonce": 523199033, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "KthHSyJTqh56TPhU3wJOK" + }, + { + "id": "pC99qr7U3A8juLWAUObHK", + "type": "arrow" + } + ], + "updated": 1737450168918, + "link": null, + "locked": false + }, + { + "id": "KthHSyJTqh56TPhU3wJOK", + "type": "text", + "x": 966.9989547729492, + "y": 516.2578125, + "width": 111.75990295410156, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "lrJL1xRdaxRXbRSHo8QbD" + ], + "frameId": null, + "roundness": null, + "seed": 2102153431, + "version": 96, + "versionNonce": 1679886841, + "isDeleted": false, + "boundElements": null, + "updated": 1737450154539, + "link": null, + "locked": false, + "text": "PostgREST", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "tCc1517C33_iWMg4YouPU", + "originalText": "PostgREST", + "lineHeight": 1.25 + }, + { + "id": "k1lNisNZbTw-LN0QWcnJi", + "type": "rectangle", + "x": 962.705078125, + "y": 625.89453125, + "width": 120.34765625, + "height": 47.92578125, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "lrJL1xRdaxRXbRSHo8QbD" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 1481042649, + "version": 149, + "versionNonce": 459040823, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "D09TZ6kO6k308NekA7IPm" + }, + { + "id": "u9BGCwnS8XgZHK0gnQYoZ", + "type": "arrow" + } + ], + "updated": 1737450174962, + "link": null, + "locked": false + }, + { + "id": "D09TZ6kO6k308NekA7IPm", + "type": "text", + "x": 991.2289428710938, + "y": 637.357421875, + "width": 63.2999267578125, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "lrJL1xRdaxRXbRSHo8QbD" + ], + "frameId": null, + "roundness": null, + "seed": 1487896279, + "version": 102, + "versionNonce": 1128227545, + "isDeleted": false, + "boundElements": null, + "updated": 1737450154539, + "link": null, + "locked": false, + "text": "gotrue", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "k1lNisNZbTw-LN0QWcnJi", + "originalText": "gotrue", + "lineHeight": 1.25 + }, + { + "id": "pC99qr7U3A8juLWAUObHK", + "type": "arrow", + "x": 640.0625, + "y": 590.953125, + "width": 308.01953125, + "height": 69.67578125, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 686957431, + "version": 122, + "versionNonce": 183858521, + "isDeleted": false, + "boundElements": null, + "updated": 1737450168918, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 308.01953125, + -69.67578125 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": 0.38207018247422886, + "gap": 5.121714614879693 + }, + "endBinding": { + "elementId": "tCc1517C33_iWMg4YouPU", + "focus": 0.570198686377111, + "gap": 9.3359375 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "u9BGCwnS8XgZHK0gnQYoZ", + "type": "arrow", + "x": 649.03125, + "y": 595.625, + "width": 304.45703125, + "height": 54.77734375, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 1935192857, + "version": 90, + "versionNonce": 140174103, + "isDeleted": false, + "boundElements": null, + "updated": 1737450174961, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 304.45703125, + 54.77734375 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": -0.27640128333280845, + "gap": 13.225381667657288 + }, + "endBinding": { + "elementId": "k1lNisNZbTw-LN0QWcnJi", + "focus": -0.37452813049941647, + "gap": 9.216796875 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "2pRzn8XHEqXNtNBvSi0r-", + "type": "rectangle", + "x": 859.19140625, + "y": 218.91015625, + "width": 223.3671874999999, + "height": 163.10546875, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "vV22YwgtFImuOJvy83rlm" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 383048601, + "version": 190, + "versionNonce": 399187801, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "fwVBA_PtMQ4oZdIMmiWrg" + } + ], + "updated": 1737450224182, + "link": null, + "locked": false + }, + { + "id": "fwVBA_PtMQ4oZdIMmiWrg", + "type": "text", + "x": 918.7550430297852, + "y": 287.962890625, + "width": 104.23991394042969, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "vV22YwgtFImuOJvy83rlm" + ], + "frameId": null, + "roundness": null, + "seed": 441173977, + "version": 154, + "versionNonce": 1971052215, + "isDeleted": false, + "boundElements": null, + "updated": 1737450224182, + "link": null, + "locked": false, + "text": "Dashboard", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "2pRzn8XHEqXNtNBvSi0r-", + "originalText": "Dashboard", + "lineHeight": 1.25 + }, + { + "id": "OakatxCdvyqhWJIXCXiHv", + "type": "rectangle", + "x": 917.201171875, + "y": 227.4375, + "width": 107.34765625, + "height": 53.01953125, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "vV22YwgtFImuOJvy83rlm" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 947700823, + "version": 119, + "versionNonce": 1844958647, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "KVc-NXh1pRGQm6uUwH_sY" + }, + { + "id": "Azsw14rZug0MOJLy-2TOg", + "type": "arrow" + } + ], + "updated": 1737450234508, + "link": null, + "locked": false + }, + { + "id": "KVc-NXh1pRGQm6uUwH_sY", + "type": "text", + "x": 932.7050399780273, + "y": 241.447265625, + "width": 76.33992004394531, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "vV22YwgtFImuOJvy83rlm" + ], + "frameId": null, + "roundness": null, + "seed": 557162167, + "version": 69, + "versionNonce": 505212887, + "isDeleted": false, + "boundElements": null, + "updated": 1737450224182, + "link": null, + "locked": false, + "text": "pg-meta", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "OakatxCdvyqhWJIXCXiHv", + "originalText": "pg-meta", + "lineHeight": 1.25 + }, + { + "id": "EXcJAN0eDXxEMMLH6iQxp", + "type": "rectangle", + "x": 910.708984375, + "y": 317.29296875, + "width": 120.33203125, + "height": 54.16796875, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "vV22YwgtFImuOJvy83rlm" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 986664537, + "version": 98, + "versionNonce": 28016249, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "tMSqUacKS9oVHN4-BEY_D" + }, + { + "id": "iUsPrQvsaz_aihPTYsooG", + "type": "arrow" + } + ], + "updated": 1737450238131, + "link": null, + "locked": false + }, + { + "id": "tMSqUacKS9oVHN4-BEY_D", + "type": "text", + "x": 940.6950378417969, + "y": 331.876953125, + "width": 60.35992431640625, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "vV22YwgtFImuOJvy83rlm" + ], + "frameId": null, + "roundness": null, + "seed": 1090835993, + "version": 62, + "versionNonce": 1858002167, + "isDeleted": false, + "boundElements": null, + "updated": 1737450224182, + "link": null, + "locked": false, + "text": "studio", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "EXcJAN0eDXxEMMLH6iQxp", + "originalText": "studio", + "lineHeight": 1.25 + }, + { + "id": "Azsw14rZug0MOJLy-2TOg", + "type": "arrow", + "x": 532.5625, + "y": 505.859375, + "width": 375.11328125, + "height": 252.0234375, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 797597145, + "version": 76, + "versionNonce": 422969495, + "isDeleted": false, + "boundElements": null, + "updated": 1737450234508, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 375.11328125, + -252.0234375 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": -0.6466531016883963, + "gap": 20.437605278139415 + }, + "endBinding": { + "elementId": "OakatxCdvyqhWJIXCXiHv", + "focus": 0.6803838779173502, + "gap": 9.525390625 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "iUsPrQvsaz_aihPTYsooG", + "type": "arrow", + "x": 544.34375, + "y": 517.640625, + "width": 356.83984375, + "height": 176.42578125, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 838993623, + "version": 69, + "versionNonce": 1607473561, + "isDeleted": false, + "boundElements": null, + "updated": 1737450238131, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 356.83984375, + -176.42578125 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": -0.5323138760607853, + "gap": 16.675518107774195 + }, + "endBinding": { + "elementId": "EXcJAN0eDXxEMMLH6iQxp", + "focus": 0.6619364355085288, + "gap": 9.525390625 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "myPSEsjL284ERLsPM8NzO", + "type": "rectangle", + "x": 912.25, + "y": 760.26171875, + "width": 261.51562499999994, + "height": 149.20312500000003, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "5zY8vbaiVn6hwGMH4xVaJ" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 66467511, + "version": 338, + "versionNonce": 1969546071, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "zuQg9jrDKpq6DlXKlNSZV" + }, + { + "id": "U6hRiuEz4b7lGMVdS4lHJ", + "type": "arrow" + } + ], + "updated": 1737450292595, + "link": null, + "locked": false + }, + { + "id": "zuQg9jrDKpq6DlXKlNSZV", + "type": "text", + "x": 1004.2878494262695, + "y": 822.36328125, + "width": 77.43992614746094, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "5zY8vbaiVn6hwGMH4xVaJ" + ], + "frameId": null, + "roundness": null, + "seed": 465295255, + "version": 298, + "versionNonce": 153696215, + "isDeleted": false, + "boundElements": null, + "updated": 1737450286219, + "link": null, + "locked": false, + "text": "Storage", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "myPSEsjL284ERLsPM8NzO", + "originalText": "Storage", + "lineHeight": 1.25 + }, + { + "id": "tQHLoyxNq1Pm2kveFMgxF", + "type": "rectangle", + "x": 1051.75, + "y": 850.4765625, + "width": 110.359375, + "height": 49.796875, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "5zY8vbaiVn6hwGMH4xVaJ" + ], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 642989815, + "version": 135, + "versionNonce": 1090659575, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "3yrABVydK7rXzfvhH4S2J" + } + ], + "updated": 1737450286219, + "link": null, + "locked": false + }, + { + "id": "3yrABVydK7rXzfvhH4S2J", + "type": "text", + "x": 1068.3197326660156, + "y": 862.875, + "width": 77.21990966796875, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [ + "5zY8vbaiVn6hwGMH4xVaJ" + ], + "frameId": null, + "roundness": null, + "seed": 195129273, + "version": 94, + "versionNonce": 629173783, + "isDeleted": false, + "boundElements": null, + "updated": 1737450286219, + "link": null, + "locked": false, + "text": "imgproxy", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "tQHLoyxNq1Pm2kveFMgxF", + "originalText": "imgproxy", + "lineHeight": 1.25 + }, + { + "id": "U6hRiuEz4b7lGMVdS4lHJ", + "type": "arrow", + "x": 574.4375, + "y": 647.15625, + "width": 326.58984375, + "height": 162.21484375, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 935084185, + "version": 55, + "versionNonce": 396116535, + "isDeleted": false, + "boundElements": null, + "updated": 1737450292595, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 326.58984375, + 162.21484375 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": 0.15813533007031727, + "gap": 17.476539575000345 + }, + "endBinding": { + "elementId": "myPSEsjL284ERLsPM8NzO", + "focus": -0.322673822380746, + "gap": 11.22265625 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "KYGPx9cwhKNvgh7Auyb6B", + "type": "rectangle", + "x": 738.21484375, + "y": 960.359375, + "width": 231.5703125, + "height": 92.51171875, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 738313335, + "version": 77, + "versionNonce": 533863543, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "pSZqKwmFDcl3pTi6zYtVo" + }, + { + "id": "F9JWBdBv3cMGG9dRk3-Ih", + "type": "arrow" + } + ], + "updated": 1737450316019, + "link": null, + "locked": false + }, + { + "id": "pSZqKwmFDcl3pTi6zYtVo", + "type": "text", + "x": 812.8100357055664, + "y": 994.115234375, + "width": 82.37992858886719, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 228317815, + "version": 37, + "versionNonce": 408060375, + "isDeleted": false, + "boundElements": null, + "updated": 1737450309795, + "link": null, + "locked": false, + "text": "Realtime", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "KYGPx9cwhKNvgh7Auyb6B", + "originalText": "Realtime", + "lineHeight": 1.25 + }, + { + "id": "F9JWBdBv3cMGG9dRk3-Ih", + "type": "arrow", + "x": 515.265625, + "y": 675.0625, + "width": 294.6328125, + "height": 273.12109375, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 1147222233, + "version": 74, + "versionNonce": 1686249303, + "isDeleted": false, + "boundElements": null, + "updated": 1737450316019, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 294.6328125, + 273.12109375 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": 0.6861675718943563, + "gap": 9.842629177568469 + }, + "endBinding": { + "elementId": "KYGPx9cwhKNvgh7Auyb6B", + "focus": 0.1142673770638955, + "gap": 12.17578125 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "P7UdLlBnQTARXdnC-UvuJ", + "type": "rectangle", + "x": -118.509765625, + "y": 442.296875, + "width": 195.4765625, + "height": 83.55859375, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "seed": 1963430745, + "version": 68, + "versionNonce": 661664825, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "D1ovad9MG0MnYIBsc3D12" + }, + { + "id": "H_7Sh4TTYk3oaJyHWlMGY", + "type": "arrow" + } + ], + "updated": 1737450781332, + "link": null, + "locked": false + }, + { + "id": "D1ovad9MG0MnYIBsc3D12", + "type": "text", + "x": -56.53144836425781, + "y": 471.576171875, + "width": 71.51992797851562, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": null, + "seed": 694569817, + "version": 10, + "versionNonce": 2054583575, + "isDeleted": false, + "boundElements": null, + "updated": 1737450343612, + "link": null, + "locked": false, + "text": "Ingress", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "baseline": 18, + "containerId": "P7UdLlBnQTARXdnC-UvuJ", + "originalText": "Ingress", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 128, + "versionNonce": 1958015225, + "isDeleted": false, + "id": "9oVEvU9QIyRrZFJsrAu5H", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": -118.509765625, + "y": 609.2306566484307, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 195.4765625, + "height": 83.55859375, + "seed": 202010745, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "type": "text", + "id": "sTWK2H2oendhNXq0YKLdU" + }, + { + "id": "wSbE9bNPtKVogvCrRraWF", + "type": "arrow" + } + ], + "updated": 1737450783455, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 79, + "versionNonce": 517667479, + "isDeleted": false, + "id": "sTWK2H2oendhNXq0YKLdU", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": -78.0914306640625, + "y": 638.5099535234307, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 114.639892578125, + "height": 25, + "seed": 641202521, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1737450782446, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "HTTPRoute", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "9oVEvU9QIyRrZFJsrAu5H", + "originalText": "HTTPRoute", + "lineHeight": 1.25, + "baseline": 18 + }, + { + "id": "H_7Sh4TTYk3oaJyHWlMGY", + "type": "arrow", + "x": 87.046875, + "y": 474.203125, + "width": 252.10546875, + "height": 109.87109375, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 1644777081, + "version": 54, + "versionNonce": 437812279, + "isDeleted": false, + "boundElements": null, + "updated": 1737450785872, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 252.10546875, + 109.87109375 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "P7UdLlBnQTARXdnC-UvuJ", + "focus": -0.673917534818646, + "gap": 10.080078125 + }, + "endBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": -0.6654428935383178, + "gap": 11.365750412649888 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + }, + { + "id": "wSbE9bNPtKVogvCrRraWF", + "type": "arrow", + "x": 91.46875000000001, + "y": 653.8830465692987, + "width": 248.65497063509258, + "height": 59.80197597888525, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 2, + "strokeStyle": "dashed", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "seed": 2030316119, + "version": 81, + "versionNonce": 445708759, + "isDeleted": false, + "boundElements": null, + "updated": 1737450790356, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + 248.65497063509258, + -59.80197597888525 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "9oVEvU9QIyRrZFJsrAu5H", + "focus": 0.4574838231667544, + "gap": 14.501953125000014 + }, + "endBinding": { + "elementId": "ejUrKXpo4iZVW3jBLrd7_", + "focus": 0.3784732064655286, + "gap": 7.062440698262833 + }, + "startArrowhead": null, + "endArrowhead": "arrow" + } + ], + "appState": { + "gridSize": null, + "viewBackgroundColor": "#ffffff" + }, + "files": {} +} \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 000ea34..7f3f5ee 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,17 +1,36 @@ -# Welcome to MkDocs +# About -For full documentation visit [mkdocs.org](https://www.mkdocs.org). +This is a Kubernetes operator for managing self-hosted [Supabase](https://supabase.com/) instances. +It is built using the [Kubebuilder](https://book.kubebuilder.io/) framework. +This project is not affiliated with the Supabase project or company in any way. -## Commands +## Description -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs -h` - Print help message and exit. +This is currently a work-in-progress experiment to replace existing Helm charts for Supabase as they tend to be hard to deploy and to manage and the default Supabase stack - although working great as a single instance or in their SaaS instances - isn't a perfect fit for Kubernetes. +This operator replaces tedious Helm values files with a small set of custom resources that allow an user to quickly deploy a Supabase instance without having to know much (if anything) of the Supabase internals. -## Project layout +## Targets - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. +- Make it as easy as possible to deploy Supabase on a Kubernetes cluster +- Manage updates of components +- Run Supabase specific migrations on the database (those managed in the supabase/postgres repository) +- Make Supabase as resource effective as possible (e.g. replaced Kong with Envoy) +- Keep it as secure as possible (e.g. adding OAuth2/Basic auth to studio if desired) +- Manage **all** aspects of the Kubernetes resources, this operator manages everything where a user would need deeper insights into Supabase like: + - Deployments + - Services + - Secrets (although you can ship your own if you want to) + - ConfigMaps + - *soon*: NetworkPolicies + +## Non-Targets + +- Manage **all** Kubernetes aspects, it does **not** create: + - PodDisruptionBudgets + - HorizontalPodAutoscalers + - Ingress or HTTPRoutes +- Replace existing Postgres operators like cloudnative-pg, CrunchyData, Zalando Postgres Operator, ... +- Manage the database instance e.g. making backups, ... that should be done by the Postgres operator or by the user +- Manage your application e.g. run app specific migrations, host your frontend, ... + +This operator tries to be as un-opionionated as possible and thereofore does not make assumptions on how you expose APIs to your users (Ingress, GatewayAPI, LoadBalancer service (coming soon))... diff --git a/mkdocs.yml b/mkdocs.yml index 85dd5dc..6660376 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -9,18 +9,16 @@ theme: - search.highlight - toc.integrate -markdown_extensions: - - pymdownx.superfences: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:pymdownx.superfences.fence_code_format - plugins: - search + - kroki: + HttpMethod: POST nav: - Home: - About: index.md - Getting Started: getting_started.md + - Components: + - Overview: components/overview.md + - Core: components/core.md - API Reference: api/supabase.k8s.icb4dc0.de.md diff --git a/requirements.txt b/requirements.txt index 2d2fc8b..b79bd2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -Pygments mkdocs-material +mkdocs-kroki-plugin