-
Notifications
You must be signed in to change notification settings - Fork 117
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
Improve Edge Function Documentation #60
Comments
Moreover, here is how I configured a map to the functions with a persistent storage class:
functions:
enabled: true
nodeSelector:
nodeName: "ai-server-1"
image:
tag: v1.41.2
environment:
DB_PORT: 5433
VERIFY_JWT: false
service:
type: ClusterIP
port: 9002
volumeMounts:
- name: myfunctions
mountPath: /home/deno/functions/custom/
volumes:
- name: myfunctions then in # LN:76
const servicePath = `/home/deno/functions/custom/${service_name}` Finally, to get the functions in there, I deploy it with a kubectl copy: #!/bin/bash
functionspod=`kubectl get pods -l app.kubernetes.io/name=supabase-functions --output=jsonpath={.items..metadata.name}`
kubectl cp ./supabase/functions/* ${functionspod}:/home/deno/functions/custom/ now I get to the hook as expected and can continue developing |
But this needs to be run for each pod in which case it would not work with autoscaling, right? Is there a recommended way to persist the functions and update them every time a new version is deployed using GitHub Actions? One way would be to move all functions into a config map (like this) and mount that map as is done with the main function. But I don't think that's what config maps are meant for and it also does not work if all edge functions exceed 1MB. I am currently looking into Persistent Volumes, but I am very inexperienced with Kubernetes. Any pointers from someone running this in production would be helpful. |
As you're inexperienced in kubernetes, check out storage providers for k8s. Many storage providers allow you to configure multi-node access to the same storage. I use an NFS mount for this function which makes it available to all deno pods that spin up. Just make sure that your functions don't do anything filesystem dependent or you can conflict when the pods scale. |
Improve documentation
Link
Chart Documentation
Add a link to the page which needs improvement (if relevant)
Describe the problem
There is no documentation or example on creating an edge function in this chart. While I'd love to
supabase functions deploy
the client doesn't support connecting to a local improvement.Describe the improvement
The text was updated successfully, but these errors were encountered: