# OpenFaaS — Serverless Functions Made Simple > OpenFaaS is a framework for packaging code, binaries or containers as portable serverless functions that run on Kubernetes or containerd with autoscaling, metrics, and a rich CLI. ## Install Save in your project root: # OpenFaaS — Serverless Functions Made Simple ## Quick Use ```bash # Install on Kubernetes with arkade arkade install openfaas # Forward the gateway and log in kubectl -n openfaas port-forward svc/gateway 8080 & export OPENFAAS_URL=http://127.0.0.1:8080 faas-cli login --username admin --password-stdin < password.txt # Scaffold and deploy a Python function faas-cli new hello --lang python3-http faas-cli up -f hello.yml curl $OPENFAAS_URL/function/hello -d ''hi'' ``` ## Introduction OpenFaaS turns any container into a function with a uniform HTTP interface and scale-to-zero behavior. It is the most popular open-source FaaS platform and runs on anything that speaks the Kubernetes or containerd APIs — including Raspberry Pi clusters. ## What OpenFaaS Does - Packages handlers as OCI images with a minimal watchdog process - Exposes functions behind a single gateway with auth and metrics - Autoscales via Prometheus alerts or HPA v2 - Supports async invocations through NATS JetStream - Ships templates for Python, Node, Go, Ruby, Rust, PHP, Java and more ## Architecture Overview A gateway service (Go) routes HTTP requests to per-function Deployments; each function pod runs a watchdog that forks the handler or proxies HTTP. Metrics flow to Prometheus, which triggers scaling decisions. An optional queue-worker pulls async jobs from NATS and invokes functions with retries. ## Self-Hosting & Configuration - `arkade install openfaas` or the `openfaas` Helm chart - faasd variant runs on a single VM via containerd (no K8s needed) - Use `OPENFAAS_URL` and basic-auth/OIDC for the gateway - Define functions in a `stack.yml` — `faas-cli up` builds, pushes, deploys - Wire Prometheus + Grafana dashboards shipped with the chart ## Key Features - True scale-to-zero with configurable idle timeout - Async invocations with NATS-backed retries and callbacks - Function templates store and `of-watchdog` streaming handlers - Works on ARM64 — great for edge and homelab - Pro version adds multi-tenancy, CRDs and single sign-on ## Comparison with Similar Tools - **Knative Serving** — heavier, tied to Kubernetes and Istio/Contour - **Fission** — similar idea, pool-based cold starts, less active - **AWS Lambda** — managed only, provider lock-in - **Kubeless** — archived - **Nuclio** — data-science focused, richer triggers ## FAQ **Q:** Do I need Kubernetes? A: No — `faasd` runs the core stack on one VM with systemd + containerd. **Q:** How do cold starts compare to Lambda? A: Warm pods are sub-10 ms; cold starts depend on image pull and usually land at 1–3 s. **Q:** Can I use my own container image? A: Yes — set `image:` and `fprocess:` in `stack.yml` and skip the template. **Q:** Is OpenFaaS CE still open source? A: Yes, MIT licensed; OpenFaaS Pro adds commercial features under EULA. ## Sources - https://github.com/openfaas/faas - https://docs.openfaas.com/ --- Source: https://tokrepo.com/en/workflows/258f31fe-38fa-11f1-9bc6-00163e2b0d79 Author: AI Open Source