Welcome to the OpenFaaS workshop! In this workshop, we will guide you through setting up a development environment for working with serverless functions using OpenFaaS. You will learn how to create, deploy, and manage functions, using a local setup on your own machine.
The workshop toolchain includes:
We provide step-by-step setup instructions for both Silicon-based macOS and Windows environments.
Please follow the appropriate guide for your operating system:
Each guide will walk you through installing the necessary dependencies, setting up the virtualization backend, and preparing the environment for the workshop.
For the rest of the module, I will provide an instance of OpenFaaS in the cloud. This means you do not need to install or set up OpenFaaS on your own computer. You will only need to install a simple tool (called the CLI, or command line interface) to create and manage your functions on the cloud server.
The CLI is a tool that helps you interact with OpenFaaS. Depending on your operating system (MacOS, Linux, or Windows), the installation steps are different.
curl -sSLf https://cli.openfaas.com | sh
This command will install the faas-cli tool, which is what you’ll use to interact with the OpenFaaS cloud instance (as we did already in the workshop).
You’ll need to install the faas-cli tool in two steps:
curl -sLS https://get.arkade.dev | sh
arkade get faas-cli
Once you’ve installed the faas-cli, you need to tell it to connect to the correct OpenFaaS server, which is hosted in the cloud (not on your own computer).
export OPENFAAS_URL=<IP>:8080
Replace <IP>
with the actual IP address of the cloud server. You can find this IP address in Moodle or Teams (it’s not shared publicly for security reasons).
[Environment]::SetEnvironmentVariable("OPENFAAS_URL", "<IP>:8080", "User")
Again, replace <IP>
with the actual IP address of the OpenFaaS server, which is provided in Moodle or Teams.
Note: This setup will only last as long as your terminal (or PowerShell) is open. If you close and reopen it, you’ll need to run the above commands again to reconnect to the server.
Now that you’ve connected to the correct server, you need to log in to it. Use the following command:
faas-cli login --password <password>
You’ll find the password in Moodle or Teams, just like the IP address.
Now that you’re logged in, you can follow the workshop tutorials to create and deploy your own functions. Remember: you don’t need a local instance of OpenFaaS, everything will run on the cloud server!
This workshop content is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. You are free to share and adapt the material, as long as you give appropriate credit and distribute your contributions under the same license.