Convert Figma logo to code with AI

openfaas logofaas

OpenFaaS - Serverless Functions Made Simple

26,157
1,969
26,157
31

Top Related Projects

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.

Kubernetes Native Serverless Framework

5,686

High-Performance Serverless event and data processing platform

6,004

Kubernetes-based, scale-to-zero, request-driven compute

8,839

Fast and Simple Serverless Functions for Kubernetes

IronFunctions - the serverless microservices platform by

Quick Overview

OpenFaaS (Functions as a Service) is an open-source framework for building serverless functions with Docker and Kubernetes. It allows developers to deploy event-driven functions and microservices to Kubernetes without repetitive, boiler-plate coding. OpenFaaS aims to make serverless technology accessible to everyone by leveraging existing technologies and providing a simple developer experience.

Pros

  • Easy to use and deploy, with a simple CLI and UI
  • Supports multiple languages and can run any binary as a function
  • Highly scalable and portable across different cloud providers
  • Strong community support and active development

Cons

  • Requires knowledge of Docker and Kubernetes for advanced usage
  • May have higher resource overhead compared to some cloud-native serverless platforms
  • Limited built-in integrations compared to some proprietary serverless platforms
  • Learning curve for developers new to serverless architectures

Getting Started

To get started with OpenFaaS, follow these steps:

  1. Install the OpenFaaS CLI:
curl -sL https://cli.openfaas.com | sudo sh
  1. Deploy OpenFaaS to a Kubernetes cluster:
git clone https://github.com/openfaas/faas-netes
cd faas-netes
kubectl apply -f namespaces.yml
kubectl apply -f ./yaml
  1. Log in to the OpenFaaS gateway:
PASSWORD=$(kubectl get secret -n openfaas basic-auth -o jsonpath="{.data.basic-auth-password}" | base64 --decode; echo)
echo -n $PASSWORD | faas-cli login --username admin --password-stdin
  1. Deploy a sample function:
faas-cli deploy -f https://raw.githubusercontent.com/openfaas/faas/master/stack.yml

For more detailed instructions and advanced usage, refer to the official OpenFaaS documentation.

Competitor Comparisons

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.

Pros of Serverless

  • Supports multiple cloud providers (AWS, Azure, GCP, etc.)
  • Extensive plugin ecosystem for enhanced functionality
  • Strong community support and active development

Cons of Serverless

  • Steeper learning curve due to complex configuration
  • Vendor lock-in potential with cloud-specific features
  • Higher latency for cold starts compared to OpenFaaS

Code Comparison

Serverless (serverless.yml):

service: my-service
provider:
  name: aws
  runtime: nodejs14.x
functions:
  hello:
    handler: handler.hello

OpenFaaS (stack.yml):

provider:
  name: openfaas
  gateway: http://127.0.0.1:8080
functions:
  hello:
    lang: node14
    handler: ./hello
    image: hello:latest

Both frameworks use YAML for configuration, but Serverless focuses on cloud provider specifics, while OpenFaaS emphasizes container-based deployment. Serverless requires more detailed configuration for cloud services, whereas OpenFaaS simplifies function deployment with a more straightforward approach.

Kubernetes Native Serverless Framework

Pros of Kubeless

  • Native Kubernetes integration, leveraging Custom Resource Definitions (CRDs)
  • Supports multiple runtimes (Python, Node.js, Ruby, PHP, Go, .NET, Ballerina)
  • Built-in CLI for easy function management

Cons of Kubeless

  • Less active community and development (archived project)
  • Limited ecosystem and third-party integrations compared to OpenFaaS
  • Steeper learning curve for users not familiar with Kubernetes concepts

Code Comparison

Kubeless function deployment:

apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
  name: hello
spec:
  handler: handler.hello
  runtime: python3.7

OpenFaaS function deployment:

version: 1.0
provider:
  name: openfaas
functions:
  hello:
    lang: python3
    handler: ./hello
    image: hello-function

Both projects aim to simplify serverless deployments on Kubernetes, but OpenFaaS offers a more active ecosystem and broader platform support. Kubeless provides tighter Kubernetes integration but has been archived, potentially limiting its future development and support.

5,686

High-Performance Serverless event and data processing platform

Pros of Nuclio

  • High-performance: Optimized for low latency and high throughput
  • Built-in support for GPU acceleration
  • Extensive data processing capabilities with native support for various data sources

Cons of Nuclio

  • Steeper learning curve due to more complex architecture
  • Less extensive ecosystem compared to OpenFaaS
  • Primarily focused on data processing workloads, which may limit general-purpose use cases

Code Comparison

Nuclio function example:

apiVersion: "nuclio.io/v1"
kind: Function
metadata:
  name: hello-world
spec:
  handler: main:handler
  runtime: python:3.6
  env:
    - name: MESSAGE
      value: "Hello, Nuclio!"

OpenFaaS function example:

version: 1.0
provider:
  name: openfaas
  gateway: http://127.0.0.1:8080
functions:
  hello-world:
    lang: python3
    handler: ./hello-world
    environment:
      MESSAGE: "Hello, OpenFaaS!"

Both frameworks use YAML for function configuration, but Nuclio's format is more Kubernetes-native, while OpenFaaS uses its own custom format. Nuclio's configuration includes more detailed specifications for runtime and resources, reflecting its focus on performance and data processing capabilities.

6,004

Kubernetes-based, scale-to-zero, request-driven compute

Pros of Knative Serving

  • Deeper Kubernetes integration, leveraging native K8s features
  • More extensive autoscaling capabilities, including scale-to-zero
  • Broader ecosystem support and backing from major cloud providers

Cons of Knative Serving

  • Steeper learning curve and more complex setup compared to OpenFaaS
  • Requires a Kubernetes cluster, which may be overkill for smaller projects
  • Less focus on developer experience and simplicity

Code Comparison

OpenFaaS function example:

version: 1.0
provider:
  name: openfaas
  gateway: http://127.0.0.1:8080
functions:
  hello-world:
    lang: python3
    handler: ./hello-world
    image: hello-world:latest

Knative Serving configuration example:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: hello-world
spec:
  template:
    spec:
      containers:
        - image: gcr.io/knative-samples/helloworld-go
          env:
            - name: TARGET
              value: "World"

Both OpenFaaS and Knative Serving are serverless platforms, but they differ in their approach and target use cases. OpenFaaS focuses on simplicity and ease of use, making it suitable for smaller projects and quick deployments. Knative Serving, on the other hand, offers more advanced features and deeper Kubernetes integration, making it a better fit for larger, more complex applications and organizations already invested in the Kubernetes ecosystem.

8,839

Fast and Simple Serverless Functions for Kubernetes

Pros of Fission

  • Native Kubernetes integration, allowing for easier deployment and management in Kubernetes environments
  • Supports multiple languages and runtimes out of the box, including Python, Node.js, Go, and Java
  • Offers built-in support for workflows and function composition

Cons of Fission

  • Less extensive ecosystem and community support compared to OpenFaaS
  • May have a steeper learning curve for users not familiar with Kubernetes concepts
  • Limited support for non-Kubernetes environments

Code Comparison

Fission function example:

def hello(context):
    return "Hello, World!"

OpenFaaS function example:

def handle(req):
    return "Hello, World!"

Both frameworks use similar syntax for defining functions, with minor differences in function signatures and context handling.

Summary

Fission is a Kubernetes-native serverless framework that offers strong integration with Kubernetes ecosystems. It supports multiple languages and provides built-in workflow capabilities. However, it may have a steeper learning curve and less community support compared to OpenFaaS. OpenFaaS, on the other hand, offers a more extensive ecosystem and easier adoption for users not familiar with Kubernetes, but may lack some of the native Kubernetes features that Fission provides.

IronFunctions - the serverless microservices platform by

Pros of Functions

  • Supports multiple languages and runtimes out of the box
  • Integrates well with Iron.io's other services like IronMQ and IronWorker
  • Provides a simple CLI tool for easy deployment and management

Cons of Functions

  • Less active community and development compared to OpenFaaS
  • Limited documentation and examples for advanced use cases
  • Fewer built-in monitoring and observability features

Code Comparison

Functions:

func Handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintln(w, "Hello from Functions!")
}

OpenFaaS:

func Handle(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintln(w, "Hello from OpenFaaS!")
}

Both projects use similar handler functions for Go, with minor differences in naming conventions. OpenFaaS typically uses Handle while Functions uses Handler.

Key Differences

  • OpenFaaS has a more active community and frequent updates
  • Functions is more tightly integrated with Iron.io's ecosystem
  • OpenFaaS offers a wider range of templates and language support
  • Functions provides a simpler deployment process for basic use cases
  • OpenFaaS has more advanced features for scaling and monitoring

Both projects aim to simplify serverless function deployment, but OpenFaaS generally offers more flexibility and features, while Functions provides a more straightforward experience within the Iron.io ecosystem.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

OpenFaaS ® - Serverless Functions Made Simple

Build Status go.dev reference OpenFaaS

OpenFaaS Logo

OpenFaaS® makes it easy for developers to deploy event-driven functions and microservices to Kubernetes without repetitive, boiler-plate coding. Package your code or an existing binary in an OCI-compatible image to get a highly scalable endpoint with auto-scaling and metrics.

Twitter URL

Highlights

Want to dig deeper into OpenFaaS?

OpenFaaS Tiers and Pricing

This repository is part of OpenFaaS Community Edition (CE), which is licensed for non-commercial use by individuals, and a time-limited trial for commercial Proof Of Concepts (PoC). Internal use within a company or business requires a license.

OpenFaaS CE:

  • has usage restrictions, which you can learn about in the OpenFaaS CE EULA
  • has basic or primitive features and capabilities compared to the commercial versions
  • is not licensed for commercial use of any kind beyond an initial trial period

OpenFaaS Standard and OpenFaaS for Enterprises are full and distinct commercial products.

They are maintained and developed independently, by a full-time team, with commercial support, and active maintenance for CVEs, and updates in the Kubernetes and Cloud Native ecosystem.

Learn more about the tiers at https://www.openfaas.com/pricing/

Overview of OpenFaaS (Serverless Functions Made Simple)

Conceptual architecture

Conceptual architecture and stack, more detail available in the docs

Code samples

You can scaffold a new function using the faas-cli new command passing in the name of the function and the language template you want to use i.e. faas-cli new --lang node20 stripe-webhooks.

Official templates exist for many popular languages and are easily extensible with Dockerfiles.

Learn about OpenFaaS templates in the docs

  • Node.js (node20) example:

    "use strict"
    
    module.exports = async (event, context) => {
        return context
            .status(200)
            .headers({"Content-Type": "text/html"})
            .succeed(`
            <h1>
                👋 Hello World 🌍
            </h1>`);
    }
    
    

    handler.js

  • Python 3 example (python3-http):

    def handle(event, context):
        return {
            "statusCode": 200,
            "body": "Hello from OpenFaaS!"
        }
    

    handler.py

  • Golang example (golang-middleware)

    package function
    
    import (
     	"fmt"
     	"io"
     	"net/http"
    )
    
    func Handle(w http.ResponseWriter, r *http.Request) {
        var input []byte
        
       	if r.Body != nil {
        		defer r.Body.Close()
        		body, _ := io.ReadAll(r.Body)
        		input = body
       	}
        
       	w.WriteHeader(http.StatusOK)
       	w.Write([]byte(fmt.Sprintf("Body: %s", string(input))))
    }
    

Get started with OpenFaaS

Official training resources

View our official training materials

Official eBook and video workshop

eBook logo

The founder of OpenFaaS wrote Serverless For Everyone Else to help developers understand the use-case for functions through practical hands-on exercises using JavaScript and Node.js. No programming experience is required to try the exercises.

The examples use the faasd project, which is an easy to use and lightweight way to start learning about OpenFaaS and functions.

Check out Serverless For Everyone Else on Gumroad

OpenFaaS and Golang

Everyday Go is a practical, hands-on guide to writing CLIs, web pages, and microservices in Go. It also features a chapter dedicated to development and testing of functions using OpenFaaS and Go.

Community blog and documentation

Quickstart

OpenFaaS Community Edition UI

Here is a screenshot of the OpenFaaS Community Edition UI which was designed for ease of use. The inception function is being run which is available on the in the store.

Deploy OpenFaaS to Kubernetes, OpenShift, or faasd now with a deployment guide

OpenFaaS Standard and OpenFaaS for Enterprises have their own, brand new dashboard with multi-tenancy support, learn more about the OpenFaaS Dashboard.

Video presentations

Community events and blog posts

Have you written a blog about OpenFaaS? Do you have a speaking event? Send a Pull Request to the community page below.

Contributing

OpenFaaS Community Edition is written in Golang. All third-party contributions to the source code are made under the MIT license, additional restrictions apply to OpenFaaS CE as a whole, where contributions from OpenFaaS Ltd are licensed under the OpenFaaS CE EULA. Various types of contributions are welcomed whether that means providing feedback, testing existing and new feature or hacking on the source code.

How do I become a contributor?

Please see the guide on community & contributing

Dashboards

Example of a Grafana dashboard linked to OpenFaaS showing auto-scaling live in action: here

OpenFaaS Pro auto-scaling dashboard with Grafana

OpenFaaS Pro auto-scaling dashboard with Grafana

An alternative community dashboard is available here

Press / Branding / Website Sponsorship

  • Website Sponsorship 🌎

    If you'd like to gain visibility by displaying your logon on the openfaas.com homepage, feel free to reach out via email or browse the tiers via GitHub Sponsors.

  • Press / Analysts

    Looking at these repositories for commit counts and activity? All public repositories are part of OpenFaaS CE, a limited version of OpenFaaS aimed at giving people a low-barrier trial experience without having to sign up with a credit card. OpenFaaS CE is maintained on a best effort basis, but is not "OpenFaaS" itself. All OpenFaaS product development is done in private repositories, and cannot be tracked by third parties or by simply browsing GitHub.

    How are GitHub Stars and Forks counted? OpenFaaS CE is not a mono-repo, you cannot simply look at one repository and say "ah that's the count" - statistics are gathered from the whole GitHub organisation.

Governance

OpenFaaS ® is an independent open-source project created by Alex Ellis, which is being built and shaped by a growing community of contributors.

OpenFaaS is hosted by OpenFaaS Ltd (registration: 11076587), a company which also offers commercial services, homepage sponsorships, and support. OpenFaaS ® is a registered trademark in England and Wales.

Users

View a selection of end-user companies who have given permission to have their logo listed at openfaas.com.