Back

Appwrite Function on Kubernetes?

  • 0
  • Databases
  • Functions
  • Self Hosted
  • Web
ORIZON
6 Apr, 2023, 13:22

I know that Appwrite Functions cannot be run on Kubernetes because of Docker Sock. But I want to run it With Kubernetes Cronjob. Is it Possible? . My Use case is, At 12 PM Midnight daily, I need to clear some values in DB. How can i do this? Any Help is Appreciated

TL;DR
The user is seeking help with running an Appwrite function on Kubernetes using a cron job. They mentioned that the Executor needs Docker-sock to be mounted, which is not possible in Kubernetes due to security risks. They are searching for alternatives. One suggestion was to set up a server that calls the function with a cron job or to use the Appwrite SDK directly. It was also mentioned that there are other services available for hosting cron jobs. The user's specific use case is to clear certain values in the database at midnight every day. A solution suggested setting up a Kubernetes cron job using the schedule `0 12 * * *`.
Arth
6 Apr, 2023, 13:27

you can setup a server which calls the function with cron job or not use function and use the sdk directly

Arth
6 Apr, 2023, 13:28

and there are other services as well for hosting cron jobs

ORIZON
6 Apr, 2023, 13:28

I don't understand what you mean? I currenly have managed Kubernetes in Vultr with Appwrite setup there.

Arth
6 Apr, 2023, 13:31

wait I think appwrite also has cron jobs give me a minute

ORIZON
6 Apr, 2023, 13:32

Sure

Arth
6 Apr, 2023, 13:32

yes when creating a function you can schedule it

Arth
6 Apr, 2023, 13:33

you can use this 0 12 * * * for your use case here

ORIZON
6 Apr, 2023, 13:34

But To start a Function, I think we need Executor-worker running. But the Executor needs Docker-sock to be mounted. Which is not possible in Kubernetes(Security Risk). Thats why I'm searching for alternatives

Arth
6 Apr, 2023, 13:40

Ah I see. One alternative I can think of is setting up your own server for doing this task and using server side SDKs to perform a task on DB periodically and adding it to your kubernetes cluster as I said above But my knowledge on appwrite is limited, you should wait for someone else to share their thoughts I think πŸ˜„

ORIZON
6 Apr, 2023, 13:41

Sure, Will keep your Idea in MindπŸ‘

ORIZON
6 Apr, 2023, 14:33

Anybody Help me?

joeyouss
6 Apr, 2023, 15:44

I hope your doubt got resolved in office hours? @ORIZON

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more