Debugging a Kubeless Function
A Kubeless function can fail at different stages of the function life cycle (for example, from deployment time to function execution time) due to a number of reasons. In this section, we are going to debug a function to identify the cause of failure.
In order to demonstrate multiple error scenarios, first, we are going to create a sample function with the following code block in the debug.py
file:
def main(event, context) Â Â Â Â name = event['data']['name'] Â Â Â Â return "Hello " +Â Â name
Error Scenario 01
Now, let's try to deploy this function using the kubeless function deploy
command:
$ kubeless function deploy debug --runtime python \ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â --from-file debug.py \ Â Â Â Â Â Â Â ...