Closed jsenon closed 6 years ago
Hey @jsenon thanks for the question.
So you want to completely remove the deployment from the system? What's the use-case for that? Can you outline it?
Hi @alexellis thanks for your reply. Find bellow a quick overview of our use case. If I have plenty of functions around 200-300 shared between many projects, some of these functions are not used all the time. We can think about downloader service that could be a good example, this function is not used all the time but could be trigger by a scheduler to launch it and download datas. Because we have limited space with cloud provider, that provisioned k8s node, we want to clean up function that is not used, and wake up this function when is triggered. Think about k8s autoscaling, we don't want to provision a new node is our cloud provider due to lack of "space" due to unused functions. In my mind I think that the major added value of FAAS is the capability (like AWS lambda) to spawn/delete/trigger functions by an orchestrator, but perhaps I'm wrong. Let me know if my explanation is unclear. Regards
When you say 200-300 functions - is this a business use-case you have in production? Are your functions functions within a code file or individual Serverless functions?
Perhaps of the 200-300 functions some could be part of the same function code and use variables like a HTTP Header or Query string to decide which part of the code to invoke. This would make sense if there is at least some cohesion between them.
You may find that scaling down to zero is enough to satisfy the constraints of saving space on your cloud Kubernetes cluster. Deleting the deployment would result in the function not being available again - at all - unless you deliberately redeployed it.
Ping @jsenon
Hi @alexellis, sorry for delay. Yes we will have this business use case. Functions will function with individual serverless function. If we come back to downloader we use the same part of code to invoke, we could have same use case if we talk about an uploader that retrieve a stream and send it to an application backend. Depending of amount of charge we can scale to 0 if we don't launch download or don't receive anything. Scale to zero seems to be a good solution for these use case, but I know that we could lost time to spawn the function.
This is on the radar for the project. It is something we will probably tackle this year. I'm closing this issue. Please feel free to raise the suggestion on the main site openfaas/faas
Hello,
Is it possible to automatically delete an unused function/pod after predefined period? Is it part of incoming improvement: Scale to zero 0/0 replicas
Thanks a lot.