To start off with we are going to look at deploying two very simple hello world functions. The first simply prints Hello World! and the second takes an input and then displays it back to you.
Hello world
The basic example
First of all, we need our function. The static hello-world function requires the following three lines of Python code:
import json
def handler():
return "Hello World!"
Place the preceding code, which is also available in the Chapter04/hello-world folder of the GitHub repository that accompanies this book, in a file called hello.py.
Now we have our function we can deploy it into the default namespace by running the following command:
$ kubeless function deploy hello \
--from-file hello.py
--handler...