Skip to content

Commit

Permalink
Updates for faasd/edge
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Feb 21, 2025
1 parent 88ed1b6 commit 2bafaa9
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 82 deletions.
38 changes: 23 additions & 15 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,36 @@ Find out more about each option and how to deploy OpenFaaS to Kubernetes:

[Deploy to Kubernetes](/deployment/kubernetes/)

## faasd - Serverless for everyone else
## OpenFaaS Edge (faasd-pro) / faasd CE - Serverless for everyone else

faasd is OpenFaaS, reimagined without the complexity and cost of Kubernetes. It runs well on a single host with very modest requirements, and is largely API-compatible with OpenFaaS on Kubernetes. Under the hood it uses [containerd](https://containerd.io/) and [Container Networking Interface (CNI)](https://github.com/containernetworking/cni) along with the same core components from OpenFaaS CE.
The term faas`d` is short for FaaS Daemon, a single binary that runs on a host to manage both stateful services, and functions.

When should you use faasd over OpenFaaS CE on Kubernetes?
faasd is OpenFaaS, reimagined without the complexity and cost of Kubernetes. It runs well on a single host with very modest requirements, and is API-compatible with OpenFaaS on Kubernetes. Under the hood it uses [containerd](https://containerd.io/) and [Container Networking Interface (CNI)](https://github.com/containernetworking/cni), along with the same core components from OpenFaaS.

If you ever outgrow faasd, you can upgrade to OpenFaaS on Kubernetes and bring your existing functions with you.

When should you use faasd over OpenFaaS on Kubernetes?

For internal business use:

* You're building automation/glue-code, web portals, cron jobs, bots, or webhook receivers.
* You want to be able to run your code locally, using containers.
* You want a way to do remote deployments over a REST API.
* You either don't have the bandwidth to manage or learn Kubernetes.
* You don't need planet scale.
* You need a reliable, durable system for asynchronous tasks and ETL jobs.
* You want a way to do remote deployments over a REST API / CLI.
* You don't have the bandwidth to learn and/or manage Kubernetes.
* You don't need to handle large spikes in traffic, or can tolerate some queueing.

You may also be interested in:
For resale to end-clients; or for edge locations, or IoT devices:

* Deploying to constrained IoT or edge devices
* Shrink-wrapping functions into a VM image to deploy for customers or clients.
* You are deploying to edge locations or IoT devices, where physical access is limited.
* You want a stable, low-maintenance system that is easy to deploy and manage.
* You have to deploy to an airgapped environment, or where the network is unstable.
* You need to deploy to a resource constrained device, such as a Dell Edge Gateway or Raspberry Pi.

faasd CE is available for personal use, and limited commercial use in a "Small Business Environment", [read the EULA to find out if you quality](https://github.com/openfaas/faasd/blob/master/EULA.md).
faasd CE is available for personal (non-commercial) use: [read the EULA here](https://github.com/openfaas/faasd/blob/master/EULA.md).

The CE version is limited to a single namespace, with a limit of 15 functions, which should be sufficient for most personal projects and for internal use within a Small Business Environment. OpenFaaS Edge is a commercial distribution of faasd with additional features and higher limits.
The CE version is limited to a single namespace, with a limit of 15 functions, which should be sufficient for most personal projects. OpenFaaS Edge is a commercial distribution of faasd with additional features and higher limits.

[Deploy faasd CE](https://github.com/openfaas/faasd/)
[Deploy faasd CE](/deployment/edge.md)

### OpenFaaS Edge

Expand All @@ -70,13 +78,13 @@ This version is intended for resale as part of a wider solution, and to be deplo

Individual [GitHub Sponsors of OpenFaaS](https://github.com/sponsors/openfaas) (25 USD / mo and higher) can use OpenFaaS Edge for personal use.

[Deploy OpenFaaS Edge](https://github.com/openfaas/faasd?tab=readme-ov-file#deploy-openfaas-edge-commercial-distribution-of-faasd)
[Deploy OpenFaaS Edge](/deployment/edge.md)

## OpenShift - 3.x / 4.x

[OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) is a variant of Kubernetes produced by Red Hat.

You can deploy to OpenShift using the standard Helm chart as per the Kubernetes instructions, or with <a href="https://arkade.dev/">arkade</a>.
You can deploy to OpenShift using the standard Helm chart as per the Kubernetes instructions. Typically OpenShift assigns random user IDs to each namespace, you can set these in the values.yaml file for the Helm chart once you have created the `openfaas` and `openfaas-fn` namespaces.

[Deploy to OpenShift](/deployment/openshift/)

122 changes: 122 additions & 0 deletions docs/deployment/edge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
## OpenFaaS Edge

OpenFaaS Edge (aka faasd-pro) is the commercial distribution of our faasd project.

faasd takes the core OpenFaaS components, and packages them for use on a single host, without the cost and complexity of Kubernetes. It is distributed as a single binary, and runs as a systemd service. It can manage both functions, and a set of stateful services such as databases, messages brokers, monitoring tools, and custom agents.

Kubernetes can be a complex system to install and manage, needing many add-on components to be installed, configured and maintained over time. Each version of Kubernetes can introduce breaking changes. faasd presents a simpler alternative, where clustering and scaling are traded-off in return for a stable system, that can be deployed as an appliance and largely left alone.

faasd combines the following battle-tested components from OpenFaaS and Kubernetes:

* The Core Components of OpenFaaS - the gateway, the queue-worker, Prometheus monitoring
* [containerd](https://containerd.io/) - the container runtime used in Kubernetes
* [Container Networking Interface (CNI)](https://github.com/containernetworking/cni) - the networking interface used in Kubernetes

Minimum system requirements:

* *x86_64* or *64-bit Arm* CPU architecture
* 512MB-1GB RAM (1GB recommended)
* 2-4 vCPU
* 10-25GB disk space
* The Raspberry Pi 3, 4 & 5 are *also supported*

## Getting started (faasd CE or faasd-pro)

If you want to use faasd for non-commercial, personal use, faasd CE is available for you for free. If you need to use faasd at work, on work time, for a commercial product or service, or for an end-client, then you will need to purchase a license for OpenFaaS Edge (faasd-pro). Up to 15 functions are supported, including private registries and a single namespace.

If you need to use faasd for commercial use, you can evaluate a single installation of faasd CE for a period of 60 days. After that time, you will need to purchase a license for OpenFaaS Edge (faasd-pro).

* Upgraded Pro components from OpenFaaS Standard: Gateway, Cron Connector, JetStream Queue Worker and Classic Scale to Zero
* Deploy up to 250 functions per installation*
* Configure private DNS servers
* Airgap-friendly with installation bundled in an OCI image or RPM package
* Detailed RAM/CPU metrics for stateful containers, and functions, including Out Of Memory (OOM) events
* Multiple namespace support
* Network policies/segmentation to secure multi-tenant environments

`*` The number of functions is tied to your license, with a maximum of 250 functions per installation.

This version is intended for resale as part of a wider solution, and to be deployed both into industrial and on-premises environments.

## Documentation and handbook

For either edition, the complete handbook for faasd "Serverless For Everyone Else" is available [in the OpenFaaS Store](https://store.openfaas.com/l/serverless-for-everyone-else?layout=profile). It contains complete examples for deploying faasd, building functions in Node.js, setting up TLS and custom domains, monitoring, background jobs, and cron schedules.

<a href="https://openfaas.gumroad.com/l/serverless-for-everyone-else">
<img src="https://www.alexellis.io/serverless.png" width="40%"></a>


Any examples of functions on the blog or in the documentation for OpenFaaS on Kubernetes, will generally work with faasd without modification.

Additional topics covered by the handbook:

* Should you deploy to a VPS or Raspberry Pi?
* Deploying your server with bash, cloud-init or terraform
* Using a private container registry
* Finding functions in the store
* Building your first function with Node.js
* Using environment variables for configuration
* Using secrets from functions, and enabling authentication tokens
* Customising templates
* Monitoring your functions with Grafana and Prometheus
* Scheduling invocations and background jobs
* Tuning timeouts, parallelism, running tasks in the background
* Adding TLS to faasd and custom domains for functions
* Self-hosting on your Raspberry Pi
* Adding a database for storage with InfluxDB and Postgresql
* Troubleshooting and logs
* CI/CD with GitHub Actions and multi-arch
* Taking things further, community and case-studies

## Prerequisites

The quickest and easiest option for trying out faasd is to use a Linux VM from a cloud provider. You can typically create these in a minute or two, and then delete them when you're finished.

If you want to try out faasd on your Mac or Windows machine, then we recommend [Multipass](https://multipass.run/) by Canonical. Multipass is a tool that allows you to create a Linux VM on your Mac or Windows machine.

faasd must not be co-located with Docker, since they both make use of containerd, iptables and CNI, and will clash with one-another. It is designed to be an appliance, and have sole tenancy of any host.

Images should always be built on another host, and pushed to a registry that faasd can subsequently pull from.

A utility script is provided for either version, which can also be run via cloud-init for automated and production deployments.

## OpenFaaS Edge/faasd-pro (commercial use)

Everything required for faasd-pro is packaged in an container image, which makes for easy off-line installation. An RPM package is also available for RHEL-like Operating Systems.

```bash
curl -sLSf \
https://raw.githubusercontent.com/openfaas/faasd/refs/heads/master/hack/install-edge.sh \
-o install-edge.sh && \
chmod +x install-edge.sh
sudo -E ./install-edge.sh
```

*For an offline installation*

Copy the OCI bundle and the install-edge.sh script to the remote server.

Then mirror the various images from docker-compose.yaml into your private registry, and update the references from i.e. `image: ghcr.io/openfaasltd/gateway` to the equivalents in your registry.

If your system is unable to install apt, yum, or pacman packages, due to limited network access, then set the `SKIP_OS` environment to 1. The list of packages is available in the `install_required_packages` section of the script.

## faasd CE (non-commercial use only)

faasd CE supports 15 functions and needs a computer with a stable Internet connection to run. There are restrictions on commercial use, but [individuals](EULA.md) can use it for free for personal, non-commercial use.

```bash
git clone https://github.com/openfaas/faasd --depth=1
cd faasd

./hack/install.sh
```

## Video overview

Watch the presentation from KubeCon, where faasd was first announced:

[![Thumbnail](https://img.youtube.com/vi/ZnZJXI377ak/hqdefault.jpg)](https://www.youtube.com/watch?v=ZnZJXI377ak)

[Meet faasd. Look Ma’ No Kubernetes! - Serverless Summit](https://www.youtube.com/watch?v=ZnZJXI377ak)

An additional training video and walkthrough is available via the [Serverless For Everyone Else](https://store.openfaas.com/l/serverless-for-everyone-else?layout=profile) handbook package.
66 changes: 0 additions & 66 deletions docs/deployment/faasd.md

This file was deleted.

53 changes: 53 additions & 0 deletions docs/deployment/pro.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,56 @@ Identity and Access Management (IAM) and Single-Sign On (SSO) are closely relate

* [Identity and Access Management (IAM)](/openfaas-pro/iam/overview)
* [Single-Sign On (SSO)](/openfaas-pro/sso/overview)

## A note on upgrading from established OpenFaaS CE installations

For a smooth upgrade experience, we recommend that you test the initial upgrade in a temporary or pre-production environment before rolling out to production.

During the installation of OpenFaaS Standard/Enterprise, the operator and Function Custom Resource Definitions (CRDs) will be enabled. On start-up, the operator will create `Function` Custom Resources for each existing function, and then delete the original Deployments and Services.

Migrated functions contain an OwnerReference that allows the original Deployment and Service to tied to its Function CR. This is a abbreviated example of a migrated Deployment for the `env` function:

```diff
apiVersion: apps/v1
kind: Deployment
metadata:
name: env
namespace: openfaas-fn
+ ownerReferences:
+ - apiVersion: openfaas.com/v1
+ controller: true
+ kind: Function
+ name: env
```

Whilst the original non-CRD mode used in OpenFaaS CE is still available in OpenFaaS Standard/Enterprise, it should be considered deprecated and will be removed in a future version of OpenFaaS.

The only reason to use the old controller mode, without the operator and CRDs, is if you need to bypass the migration of existing functions, or have some other code set up that modifies the Deployments and Services created by OpenFaaS.

To bypass the migration, you can create a ConfigMap in the openfaas namespace with the following content:

```bash
kubectl create configmap -n openfaas \
openfaas-operator-migrated \
--from-literal migrated-functions=0 \
--from-literal migrated-at=2025-02-21
```

Then in your values.yaml file for the openfaas chart, set the following:

```yaml
operator:
create: false
```
When you upgrade to OpenFaaS Standard/Enterprise, the controller mode will be used.
At a later date, you can trigger a migration to the Operator and CRDs by deleting the ConfigMap and restarting the gateway:
```bash
kubectl delete configmap -n openfaas openfaas-operator-migrated

kubectl rollout restart deployment -n openfaas
```

If you run into any issues, or have questions, you can email the team via the support inbox.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ nav:
- Deployment overview: deployment.md
- OpenFaaS CE: ./deployment/kubernetes.md
- OpenFaaS Pro: ./deployment/pro.md
- faasd: ./deployment/faasd.md
- OpenFaaS Edge: ./deployment/edge.md
- OpenShift: ./deployment/openshift.md
- Troubleshooting: ./deployment/troubleshooting.md
- CLI:
Expand Down

0 comments on commit 2bafaa9

Please sign in to comment.