OpenFaaS Kubernetes
OpenFaaS Kubernetes
by OpenFaaS

VERSION 0.16.0

Description

OpenFaaS ® is an award-winning open source project that makes it easy for developers to deploy applications to Kubernetes in a Serverless-style. Any microservice, API, binary, or function can be packaged and deployed in a very short period of time. Once a workload is deployed via the OpenFaaS CLI, API or UI metrics will be tracked and used to auto-scale your code in response to demand.

OpenFaaS comes with built-in auto-scaling, detailed metrics and queue-processing. You can take advantage of pre-made functions from the Function, or a series of templates for Functions or Microservices covering a wide range of languages such as C#, Java, Go, Ruby, PHP, and more.

Your workloads can be accessed through the OpenFaaS gateway or triggered by a number of event sources such as Kafka, RabbitMQ, Redis and Cron.

The project is built around open interfaces that can be extended easily. Tutorials and guides can help you enable TLS, setup custom domains, CI/CD, OAuth2, multi-user support, and many other features.

You can find out more about OpenFaaS at https://www.openfaas.com/ or take the free workshop online.

Software Included

PackageVersionLicense
Prometheus2.7.1Apache 2.0
Alertmanager0.16.1Apache 2.0
NATS Streaming0.11.2Apache 2.0
faas-netes0.8.4MIT
faas0.16.0MIT
nats-queue-worker0.7.2MIT

Getting started after deploying OpenFaaS Kubernetes

OpenFaaS has been deployed and is now fully-functioning. During the installation a password was created for your OpenFaaS Gateway along with a LoadBalancer to provide access to your gateway.

OpenFaas does not require doctl, however the below instructions make use of doctl. If you haven't setup doctl get the doctl binary and run doctl auth.
https://github.com/digitalocean/doctl

Configure kubectl locally

  • Point kubectl to your cluster

In order to start using OpenFaaS, you will need to find your password and LoadBalancer IP. To do this, you will need to use kubectl and point it at your new cluster.

doctl k8s cluster list

f8d01a21-ef2a-4b93-b05f-6774e77a86e5    openfaas-cluster          lon1      1.14.5-do.0    running    openfaas-cluster-default-pool

doctl k8s cluster kubeconfig save openfaas-cluster

Now switch into the context of the cluster:

kubectl config get-contexts
*         do-lon1-openfaas-cluster         do-lon1-openfaas-cluster         do-lon1-openfaas-cluster-admin         

kubectl config set-context do-lon1-openfaas-cluster

Log into OpenFaaS

  • Install the OpenFaaS CLI:
curl -sLSf https://cli.openfaas.com | sudo sh

Note: the CLI is also available via brew install faas-cli

  • Find your LoadBalancer IP:

You can use the LoadBalancer's IP to log into OpenFaaS, operate the CLI, and to view the UI.

export OPENFAAS_URL=$(kubectl get svc -n openfaas gateway-external -o jsonpath='{.status.loadBalancer.ingress[*].ip}'):8080
echo Your gateway URL is: $OPENFAAS_URL

Note: your DigitalOcean LoadBalancer may take a few minutes to come up, so if you're not seeing an IP, try again.

  • Get your password
echo $(kubectl get secret -n openfaas basic-auth -o jsonpath="{.data.basic-auth-password}" | base64 --decode) > password.txt 

echo Your admin password is: $(cat password.txt)
  • Now use the password to authenticate the CLI:
cat password.txt | faas-cli login --username admin --password-stdin

Note: you can use this command at any time to retrieve your password

Check that everything worked

  • Deploy a function
faas-cli store list

# Find one you like

faas-cli store deploy nodeinfo

# List your functions

faas-cli list --verbose

# Check when the function is ready

faas-cli describe nodeinfo

Name:                nodeinfo
Status:              Ready

# Invoke the function using the URL given above, or via `faas-cli invoke`

echo | faas-cli invoke nodeinfo
echo -n "verbose" | faas-cli invoke nodeinfo
  • Try the UI

You can access the UI at the same URL of the gateway, so try this URL:

echo http://$OPENFAAS_URL

Demo of the inception function

Take the wheel

  • Learn OpenFaaS

Now it's over to you to start learning about Serverless with OpenFaaS and Kubernetes using the hands-on workshop.

https://github.com/openfaas/workshop

  • Add TLS for your OpenFaaS Gateway

You can add TLS to your OpenFaaS Gateway URL with the following documentation: 1.0 SSL for the Gateway

  • Join OpenFaaS Insiders

OpenFaaS Insiders get regular email updates on project news and developments including videos, blogs, and early-access to the latest features. Join by becoming a sponsor on GitHub at any tier.

GitHub Sponsors

  • Need help?

Visit OpenFaaS Slack

Support Details

Supported By:OpenFaaS
Support URL:https://github.com/openfaas/faas/issues

Learn More

Product Docs

Technical overviews, how-tos, release notes, and support material

Tutorials

DevOps and development guidelines

API Docs

Run your resources programmatically

Ask a question

Connect, share and learn