Steps

Nomad OpenFaaS Playground

Step1 of 4

Getting started

OpenFaaS is a private Functions as a Service (FaaS) platform which you can run on your existing scheduler such as Nomad, Kubernetes, and Docker Swarm. It brings the convenience and efficacy of a function based workflow for developers while providing a very low operational impact.

Useful URLS

Local Docker registry URL

OpenFaaS Gateway

Architecture

OpenFaaS is built around Docker, all functions are just Docker images which immediately gives a familiar workflow.The three core components consist of a gateway, a provider, and a monitoring element. The gateway is the external API which allows the administration and execution of functions. It does not directly interact with your scheduler, but delegates this responsibility to a provider which can trigger function deployments and scale functions. Both the gateway and the provider emit metrics such as invocation count and timing data for a function which is collected by Prometheus.

Besides being an excellent way of monitoring your system Prometheus also has the capability of broadcasting alerts based on the stored metrics. This capability allows the gateway to listen for these alerts and react to them. A common example of this is to automatically trigger the scaling of a function based on load.

That is all that is required to get the most basic function created and deployed, to see a more comprehensive example including how you can take a Test Driven approach to creating functions why not take a look at my example function for sending Tweets: OpenFaaS Tweet Function

Debugging Scenarios

Help

Katacoda offerings an Interactive Learning Environment for Developers. This course uses a command line and a pre-configured sandboxed environment for you to use. Below are useful commands when working with the environment.

cd <directory>

Change directory

ls

List directory

echo 'contents' > <file>

Write contents to a file

cat <file>

Output contents of file

Vim

In the case of certain exercises you will be required to edit files or text. The best approach is with Vim. Vim has two different modes, one for entering commands (Command Mode) and the other for entering text (Insert Mode). You need to switch between these two modes based on what you want to do. The basic commands are: