OpenFaaS
OpenFaaS is an open-source platform for running functions (FaaS) on top of Kubernetes. It simplifies the deployment of small code units that execute on demand or in response to events.
At its core, OpenFaaS follows the Function as a Service (FaaS) model: you write a function, package it into a Docker image, and OpenFaaS handles scaling, networking, and lifecycle management.
It offers a user-friendly web interface and a command-line tool called faas-cli. You can write functions in popular languages such as Python, Node.js, Go, and others using pre-built templates.
The complete documentation for OpenFaaS on Kubernetes is available on the official website.
Installing the Addon Copy link
To install OpenFaaS:
- Go to the Kubernetes section and click on your cluster.
- In the Addons tab, click OpenFaaS.
- In the Configuration window, find the
ingresssection and enable it by settingenabled: true. Also, specify your domain in thehostparameter. This will simplify access to the dashboard and allow usage offaas-cli. If you enableingress, you can disableexposeServices, which is used by default. - Once parameters are set, click Install and wait for the installation to finish.
To verify everything is running, check the status of pods in the openfaas-fn namespace:
kubectl get pods -n openfaas-fnExample output:
NAME READY STATUS RESTARTS AGE
alertmanager-57767d864c-hdqdn 1/1 Running 0 19h
gateway-5f9c4b5754-ksr6x 2/2 Running 1 (19h ago) 19h
nats-6ddf479847-dxr2g 1/1 Running 0 19h
prometheus-6cbd946f66-wqdf8 1/1 Running 0 19h
queue-worker-57c7479989-bw282 1/1 Running 0 19h
If all pods are in Running status, the installation was successful.
Installing the CLI Copy link
To work with OpenFaaS from the terminal, you need the faas-cli tool. It allows you to create functions, build and push images, deploy them to the cluster, invoke functions, and check their status.
It is available for Linux, macOS, and Windows. Use the following commands to install it:
Linux/macOS
curl -sSL https://cli.openfaas.com | shmacOS
curl -sSL https://cli.openfaas.com | shOr, via Homebrew:
brew install faas-cliWindows (PowerShell)
$version = (Invoke-WebRequest "https://api.github.com/repos/openfaas/faas-cli/releases/latest" | ConvertFrom-Json)[0].tag_name
(New-Object System.Net.WebClient).DownloadFile("https://github.com/openfaas/faas-cli/releases/download/$version/faas-cli.exe", "faas-cli.exe")Verify the installation:
faas-cli versionExample Usage Copy link
In this example, we will:
- Deploy the OpenFaaS addon.
- Bind a domain for easy dashboard access and CLI use.
- Deploy a function from the built-in store.
- Create and deploy a custom function using Docker Hub.
Requirements:
- A domain or subdomain for OpenFaaS access.
- Installed Nginx Ingress addon.
- A Docker Hub account (for custom functions).
- Installed
faas-cliand Docker.
Deploying the Addon
Go to the control panel and install the OpenFaaS addon. In the Configuration section, enable ingress by setting enabled: true and specifying your domain in the host field. Then start the installation.
Creating a Load Balancer
Create a loadbalancer.yaml manifest:
apiVersion: v1
kind: Service
metadata:
name: ingress-nginx-lb
namespace: ingress-nginx
spec:
selector:
app.kubernetes.io/name: ingress-nginx
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 80
appProtocol: k8s.hostman.com/proto-http
- name: https
port: 443
targetPort: 443
appProtocol: k8s.hostman.com/proto-https
Apply it:
kubectl apply -f loadbalancer.yamlSet the balancer’s IP as the A record of your domain. If you're using Hostman NS servers, just select the newly created load balancer. Otherwise, get its IP manually:
kubectl get svc --all-namespaces --field-selector spec.type=LoadBalancerThe IP will be under the EXTERNAL-IP column.
Visit the domain you configured—a basic auth prompt will appear.
Use the login admin and retrieve the password using:
kubectl -n openfaas-fn get secret basic-auth -o jsonpath="{.data.basic-auth-password}" | base64 --decodeAfter logging in, the dashboard will open.

OpenFaaS Dashboard
Working with Functions
Let’s move on to using functions. We’ll install a function from the built-in OpenFaaS store.
First, log in via the CLI. This will allow you to run commands related to function management:
faas-cli login \
--gateway http://<domain> \
--username admin \
--password <password>
Where:
domain— the address specified during OpenFaaS installation;admin— the default username;password— the password can be retrieved with the following command:
kubectl -n openfaas-fn get secret basic-auth -o jsonpath="{.data.basic-auth-password}" | base64 --decodeNow install the figlet function, which converts text into ASCII art:
faas-cli store deploy figlet \
--gateway http://<domain>Make sure the function has been installed:
faas-cli list \
--gateway http://<domain>The list will now contain the figlet function with a status of Ready.
Invoke the function and pass a string as input:
echo "Hostman" | faas-cli invoke figlet \
--gateway http://<domain>You’ll receive ASCII art with the given text in response.
Now let’s go over deploying a custom function. Choose a template:
faas-cli template store listCreate a new function based on the desired template—for example, python3-http:
faas-cli new hello-k8s --lang python3-httpThe following will be created:
hello-k8s/handler.py— the function code;stack.yaml— the function manifest.
Before building, edit the stack.yaml file and specify the path to your Docker Hub image. For example:
functions:
hello-k8s:
lang: python3-http
handler: ./hello-k8s
image: dockerhubuser/hello-k8s:latest
In the image field, specify your Docker Hub username and the image name. Note that OpenFaaS Community Edition only supports public images.
Build the image:
faas-cli build -f stack.yamlAfter the image is built, push it to Docker Hub:
faas-cli push -f stack.yamlFinally, deploy the function to your cluster:
faas-cli deploy -f stack.yaml \
--gateway http://<domain>After running the command, you’ll get a link to access the function.

Open the link. You should see the message "Hello from OpenFaaS!".