Open alexander-alvarez opened 6 years ago
The reason why that's a warning and not an error is because it's difficult to know the size in which the file will be too big. We now that the limitation of an etcd entry is 1MB but in our case the size should be calculated for the entire object not just the function file. That means that a huge dependencies file and a small zip will be an issue too. For that reason we let the user receive the error from the K8s API:
Serverless: WARNING! Function zip file is 10MB. The maximum size allowed is 1MB: please use package.exclude directives to include only the required files
Serverless: Deploying function hello...
Error --------------------------------------------------
Found errors while processing the given functions:
Error: Unable to deploy the function hello. Received:
Code: 500
Message: rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (13814928 vs. 2097152)
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Running into this now with a fairly large serverless package. Is there any way to increase the limit to get around this?
hi @dwelch2344,
In theory, in the serverless package you should only include source code (so it's difficult to hit the limit of 1MB). If you are including some unnecessary files you can use the exclude:
field to avoid adding those files.
Running into this problem also ... I've got a pre-compiled "chromium" binary that's packaged up as part of my deployment - Works fine in AWS Lambda, however not Kubeless...
https://kubeless.io/docs/advanced-function-deployment/ - Documentation here explains that the "function" can actually be a link to a ZIP file that is downloaded upon initial execution of the function...
What would be the chances of implementing this?
Hi @ned-kelly,
It doesn't work right now with the serverless plugin but you can upload the zip file somewhere (accessible from within your cluster) and use the URL to deploy the function using kubeless
CLI:
kubeless function deploy --from-file http://.../function.zip ...
That file doesn't have the restriction to be under 1MB. You can find more info here: https://kubeless.io/docs/advanced-function-deployment/#deploying-large-functions
Right now we just log the warning, but I'm curious if the build pipeline should just stop at that point? https://github.com/serverless/serverless-kubeless/blob/cb1f2216484dd4d9e2ce71e1112a57b0f697b19b/deploy/kubelessDeploy.js#L74