Lambda resources
The luna-lambda service provides ways to configure available resources for lambda.
- User can adjust multiple parameters during lambda creation, lambda import or lambda update:
‘cpu_limit’ - CPU resource units limit for each of a lambda’s pods. 1 unit means 1/1000 of a CPU core.
‘ram_limit’ - The maximum RAM usage limit in GB for each of a lambda’s pods.
‘cpu_request’ - The CPU resource units request for each of a lambda’s pods.
‘ram_request’ - The RAM usage request in GB for each of a lambda’s pods.
‘enable_gpu’ - Whether to enable GPU usage for a lambda.
By default this parameters does not checked before lambda creation and the resulting lambda deployment could fail this limits are in conflict with k8s cluster configuration.
Limits for this parameters can be set via the LAMBDA_DEPLOYMENT_SETTINGS setting, that should describe resources limits per namespace (the allowed_namespaces section should not contain duplicates). If this setting set correct and the deploy_parameters.check_resources parameter is set to true during lambda creation, update, or import, then the provided limits will be checked before lambda creation.
Note: that resource limits of k8s cluster can still differ from ‘LAMBDA_DEPLOYMENT_SETTINGS’ which can cause a lambda launch fail
Configured resource limits could be checked via the lambda resources request.
LAMBDA_DEPLOYMENT_SETTINGS also carries a per-namespace custom Kubernetes deployment manifest — see custom deployment manifest.