OpenFaaS was created to have the freedom to run serverless functions anywhere you want, whether that be within your on-premises environment, on AWS, or even on a Raspberry Pi in your home. Whichever way you’re running OpenFaaS, you won’t get far without a way to build and deploy functions, and at small scale, you may be doing this manually.

When you’re ready to level-up your operations, and update functions after each commit is pushed, or each Pull Request is merged, then build systems like GitLab CI, Travis, CircleCI and GitHub Actions become essentials parts of your infrastructure.

Over the past few years this has meant installing Docker on the build system, and running the docker command to build an image, push it to a registry, and to then deploy it. Recently advancements in cross-compilation and the newer container builder buildkit means we can build images for multiple platforms with ease, so that an image can be deployed to an AWS Graviton instance with an ARM processor, and to a regular EC2 node using a x86_64 (Intel) processor.

So in this tutorial I’ll show you how to build and deploy functions anywhere using GitHub Actions and multi-arch images that can run on a cloud instance, or on your Raspberry Pi homelab.

Prerequisites

Kubernetes is our recommendation for teams running at scale, but faasd provides a suitable alternative for smaller teams.

  • An OpenFaaS deployment using Kubernetes or faasd
  • You can deploy OpenFaaS here
  • Publicly accessible network OpenFaaS gateway
  • Your OpenFaaS gateway should be accessible from the Internet and have TLS enabled for security. If you are running behind a firewall, or at home then checkout the inlets-operator project to make your OpenFaaS gateway accessible from the Internet.
  • faas-cli

#github #openfaas

Build and deploy OpenFaaS functions with GitHub Actions
4.15 GEEK