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

Fix kong configuration for edge-functions #75

Closed
wants to merge 6 commits into from

Conversation

SimoneLazzaris
Copy link

What kind of change does this PR introduce?

Kong configuration is incorrect: requests to service supabase-functions are routed to functions which doesn't exists

What is the current behavior?

Currently configuration for kong is as follows:

      - name: functions-v1
        _comment: 'Edge Functions: /functions/v1/* -> http://zupa-supabase-functions:9000/*'
        url: http://functions:9000/
        routes:
          - name: functions-v1-all
            strip_path: true
            paths:
              - /functions/v1/

But the functions dns name doesn't exists, and it is hardwired in the code.

What is the new behavior?

Now the configuration is instead using the correct naming used for all other services:

      - name: functions-v1
        _comment: 'Edge Functions: /functions/v1/* -> http://zupa-supabase-functions:9000/*'
        url: http://zupa-supabase-functions:9000/
        routes:
          - name: functions-v1-all
            strip_path: true
            paths:
              - /functions/v1/

Of course, in this example zupa-supabase-functions is the name of the service,

Additional context

$ kubectl get svc -n supa
NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
zupa-supabase-analytics   ClusterIP   10.43.231.15    <none>        4000/TCP   4h42m
zupa-supabase-auth        ClusterIP   10.43.125.164   <none>        9999/TCP   97d
zupa-supabase-db          ClusterIP   10.43.226.152   <none>        5432/TCP   97d
zupa-supabase-functions   ClusterIP   10.43.78.210    <none>        9000/TCP   97d
zupa-supabase-imgproxy    ClusterIP   10.43.215.115   <none>        5001/TCP   4h42m
zupa-supabase-kong        ClusterIP   10.43.220.106   <none>        8000/TCP   97d
zupa-supabase-meta        ClusterIP   10.43.144.5     <none>        8080/TCP   97d
zupa-supabase-realtime    ClusterIP   10.43.190.45    <none>        4000/TCP   97d
zupa-supabase-rest        ClusterIP   10.43.59.209    <none>        3000/TCP   97d
zupa-supabase-storage     ClusterIP   10.43.30.150    <none>        5000/TCP   97d
zupa-supabase-studio      ClusterIP   10.43.148.129   <none>        3000/TCP   97d
zupa-supabase-vector      ClusterIP   10.43.198.10    <none>        9001/TCP   4h42m

@bbo76
Copy link

bbo76 commented Oct 22, 2024

+1

SimoneLazzaris and others added 2 commits October 24, 2024 14:37
Changed the DB component into a stateful set. This avoid having two instances of
the DB running *on the same data*, which can happen with a deployment (i.e., during
an update/reconfiguration).
Also, added a shutdown command to properly shut down the database, to prevent
data corruption.
@SimoneLazzaris
Copy link
Author

Please check out #99, it's a cleaned up PR that replaces this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants