Skip to content

Commit

Permalink
Try to replace how the realtimme seed is happening
Browse files Browse the repository at this point in the history
  • Loading branch information
CollectiveUnicorn committed Aug 5, 2024
1 parent 4a30a4b commit ffa7ffa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 29 deletions.
44 changes: 16 additions & 28 deletions packages/supabase/bitnami-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ realtime:
value: "''"
sidecars:
- name: realtime-init
image: docker.io/curlimages/curl:latest
image: docker.io/bitnami/kubectl:1.30.0-debian-12-r0
imagePullPolicy: IfNotPresent
env:
- name: SUPABASE_SERVICE_KEY
Expand All @@ -99,38 +99,26 @@ realtime:
secretKeyRef:
name: supabase-postgresql
key: postgres-password
- name: DB_ENC_KEY
value: "testenckeychaangethisforsuresure"
command:
- sh
- -c
- >-
echo "Waiting for supabase-realtime to be ready...";
curl --max-time 60 --insecure -L -X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer $SUPABASE_SERVICE_KEY"
-H "apiKey: $SUPABASE_SERVICE_KEY"
-d '{
"tenant": {
"name": "supabase-realtime",
"external_id": "supabase-realtime",
"jwt_secret": "'"$DB_ENC_KEY"'",
"extensions": [{
"type": "postgres_cdc_rls",
"settings": {
"db_name": "postgres",
"db_host": "supabase-postgresql",
"db_user": "supabase_admin",
"db_password": "'"$POSTGRESQL_PASSWORD"'",
"db_port": "5432",
"region": "us-east-1",
"publication": "supabase_realtime",
"ssl_enforced": "false",
"poll_interval_ms": "100",
"poll_max_record_bytes": "1048576"
}
}]
}
}'
https://supabase-kong.leapfrogai.svc.cluster.local/realtime/v1/api/tenants
until kubectl get pod supabase-realtime -n leapfrogai -o jsonpath='{.status.containerStatuses[?(@.name=="supabase-realtime")].ready}' | grep -q "true"; do
echo "Waiting for supabase-realtime container to be ready...";
sleep 5;
done;
echo "supabase-realtime container is ready. Creating job to run curl command...";
kubectl create job --from=cronjob/curl-job curl-job-$(date +%s) -n leapfrogai;
volumeMounts:
- name: curl-job-config
mountPath: /etc/config
volumes:
- name: curl-job-config
configMap:
name: curl-job-config

rest:
enabled: ###ZARF_VAR_ENABLE_REST###
Expand Down
1 change: 0 additions & 1 deletion packages/supabase/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ components:
- docker.io/bitnami/supabase-storage:0.48.4-debian-12-r2
- docker.io/bitnami/supabase-studio:0.24.3-debian-12-r3
- docker.io/bitnami/kong:3.6.1-debian-12-r18
- docker.io/curlimages/curl:latest
- name: supabase-post-process
description: "Perform necessary post processing here"
required: true
Expand Down

0 comments on commit ffa7ffa

Please sign in to comment.