Closed centerorbit closed 5 years ago
Hi @centerorbit,
Thank you for the detailed notes. It seems that you are hitting the limit for the package size. See https://kubeless.io/docs/advanced-function-deployment/#deploying-large-functions.
If you are using web pack you can read the section regarding that here: http://kubeless.io/docs/runtimes/#nodejs. Basically you'll need to skip including dependencies in the zip file to avoid the 1.5MB limit. Unfortunately I don't have a serverless examples for you using that.
Let us know if you manage to make that work.
Hey @andresmgot,
Thank you so much for that tip! Your suggestion got it working!
Interestingly enough though, the resulting zip file was only 924KB. I figured, perhaps it was also base64 encoded, but that brings it up to 1,248 KB. Perhaps the remaining 252 KB was consumed by additional config wrapped around the function in the etcd?
What I did realize was that the handler.js.map file was being included in the zip, and as soon as I excluded that, it dropped the zip size to about 511 KB, and deployed right away!
It'd be nice to understand if it was the inclusion of the map, or nearing of the size limit, but I'm just happy it's working!
I am glad you got it working!
Regarding the limit, only newer versions of etcd allow fields of 1.5MB. In previous versions, the limit was 1MB. Depending on the version that your Kubernetes cluster includes that may be the reason. The other possibility is indeed that the rest of elements in the ConfigMap causes the size to be over the limit.
Describe the problem:
I get a failed serverless deploy with this error in the controller logs:
The build that's failing is much larger and complex, and uses typescript compiled down to js using webpack. In the end, a handler.js is created and a zip formed.
I don't know how to retrieve the ConfigMap to inspect the contents, or how one might go about modifying the data that's put in there.
I may be tracking down the wrong log error, there are other things that show up in the config logs, like:
But, the ConfigMap one seemed the most likely? But I'm not sure where else to look.
Steps to reproduce:
kubeless function ls
serverless deploy -v
kubeless function ls
kubectl get pods -n kubeless
kubectl logs kubeless-controller-manager-598dd94559-2kq8c --container=kubeless-function-controller --namespace=kubeless
"Tricking" it to work:
kubeless function delete get-asset
get-asset
Configs:
Failing:
Working config (slightly modified from example template):