From 2bafaa97f1be81949ef7f4bdcb15eb4b4d9a12f2 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Fri, 21 Feb 2025 09:13:27 +0000 Subject: [PATCH] Updates for faasd/edge Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- docs/deployment.md | 38 +++++++----- docs/deployment/edge.md | 122 +++++++++++++++++++++++++++++++++++++++ docs/deployment/faasd.md | 66 --------------------- docs/deployment/pro.md | 53 +++++++++++++++++ mkdocs.yml | 2 +- 5 files changed, 199 insertions(+), 82 deletions(-) create mode 100644 docs/deployment/edge.md delete mode 100644 docs/deployment/faasd.md diff --git a/docs/deployment.md b/docs/deployment.md index 2115f20..39508b8 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -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 @@ -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 arkade. +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/) diff --git a/docs/deployment/edge.md b/docs/deployment/edge.md new file mode 100644 index 0000000..d6b7f93 --- /dev/null +++ b/docs/deployment/edge.md @@ -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. + + + + + +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. diff --git a/docs/deployment/faasd.md b/docs/deployment/faasd.md deleted file mode 100644 index a80526b..0000000 --- a/docs/deployment/faasd.md +++ /dev/null @@ -1,66 +0,0 @@ -# faasd deployment - a lightweight & portable faas engine - -faasd is [OpenFaaS](https://github.com/openfaas/) reimagined, but without the cost and complexity of Kubernetes. It runs on a single host with very modest requirements, making it fast and easy to manage. Under the hood it uses [containerd](https://containerd.io/) and [Container Networking Interface (CNI)](https://github.com/containernetworking/cni) along with the same core OpenFaaS components from the main project. - -This page covers faasd CE and OpenFaaS Edge (a commercial distribution of faasd). - -Minimal system resources are required such as: - -* 512MB-1GB RAM (1GB recommended) -* 2-4 vCPU cores minimum -* 10-25GB of disk space -* *x86_64* or *64-bit Arm* CPU architecture -* The Raspberry Pi 3, 4 & 5 are *also supported* - -Local development/testing: - -* Windows and Mac users can use multipass to deploy faasd in a VM -* Linux users can deploy faasd directly, or also use multipass - -## When should you use faasd over OpenFaaS on Kubernetes? - -* You have a cost sensitive project - run faasd on a 5-10 USD VPS or on your Raspberry Pi -* When you just need a few functions or microservices, without the cost of a cluster -* When you don't have the bandwidth to learn or manage Kubernetes -* To deploy embedded apps in IoT and edge use-cases -* To shrink-wrap applications for use with a customer or client - -faasd does not create the same maintenance burden you'll find with maintaining, upgrading, and securing a Kubernetes cluster. You can deploy it and walk away, in the worst case, just deploy a new VM and deploy your functions again. - -Watch a video comparing the two: - -[![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) - -## faasd CE - for Personal Use and Small Business Environments - -faasd CE is a static binary which requires a Linux system configured with systemd. faasd CE can be used for Personal Use and within Small Business Environments, with a limit of 15 functions and a single namespace. The [faasd EULA](https://github.com/openfaas/faasd/blob/master/EULA.md) explains the terms of use. - -### OpenFaaS Edge - for production and resale - -OpenFaaS Edge is a commercial distribution of faasd, with enhancements and additional features from [OpenFaaS Pro](/openfaas-pro/introduction). The [OpenFaaS Pro EULA applies](https://github.com/openfaas/faas/blob/master/pro/EULA.md). - -* 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 and rpm package -* Multiple namespace support - -This version is intended for resale as part of a wider solution, and to be deployed both into industrial and on-premises environments. - -Individual [GitHub Sponsors of OpenFaaS](https://github.com/sponsors/openfaas) (25 USD / mo and higher) can use OpenFaaS Edge for personal use. - -When deploying to production, or for customers: - -* Use the bash installation script -* Deploy using the provided cloud-init script -* Deploy using terraform, or adapt the terraform examples -* Bundle it as part of a VM image - -[Deploy OpenFaaS Edge](https://github.com/openfaas/faasd?tab=readme-ov-file#deploy-openfaas-edge-commercial-distribution-of-faasd) - -### Get started with either version - -* Checkout the [faasd course & handbook](http://store.openfaas.com/l/serverless-for-everyone-else) -* Browse the [faasd CE repository](https://github.com/openfaas/faasd/) on GitHubs diff --git a/docs/deployment/pro.md b/docs/deployment/pro.md index 9a0bfd1..0cf569d 100644 --- a/docs/deployment/pro.md +++ b/docs/deployment/pro.md @@ -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. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index fff4dd2..7124695 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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: