In we deployed a Kubernetes cluster using RKE (Rancher Kubernetes Engine). Now that we have a working Kubernetes cluster, let’s deploy (an open source serverless platform) on top of it! Part 1 OpenFaaS This post is not going into details about OpenFaaS. For introductions related to OpenFaaS on Kubernetes, you should read written by (the creator of OpenFaaS). “Getting started with OpenFaaS on minikube” Alex Ellis Prerequisites I’m assuming: You have read Part 1 and have a running Kubernetes cluster Your is set to target the Kubernetes cluster you built on kubectl Part 1 You have Helm installed on your client machine Deploy OpenFaaS via Helm First, let’s setup Helm by first creating a service account for tiller: kubectl -n kube-system create sa tiller \&& kubectl create clusterrolebinding tiller \--clusterrole cluster-admin \--serviceaccount=kube-system:tiller # serviceaccount “tiller” created# clusterrolebinding “tiller” created Then, install tiller: helm init —-skip-refresh --upgrade --service-account tiller # $HELM_HOME has been configured at /Users/fukuyamaken/.helm. # Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.# Happy Helming! After that, let’s clone the kubernetes extension repository for OpenFaaS called and to that directory. The resources required for Helm are included in this repository. faas-netes cd git clone https://github.com/openfaas/faas-netes && \cd faas-netes Finally, deploy OpenFaaS to the cluster. Note that we’re disabling rbac because this cluster’s rbac isn’t configured properly. helm upgrade --install --debug --reset-values --set rbac=false --set async=false openfaas openfaas/ Confirm that Kubernetes Services and Deployments are running with : kubectl get svc,deployments NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEsvc/alertmanager ClusterIP 10.233.18.46 <none> 9093/TCP 4msvc/alertmanager-external NodePort 10.233.1.242 <none> 9093:31113/TCP 4msvc/faas-netesd ClusterIP 10.233.37.207 <none> 8080/TCP 4msvc/faas-netesd-external NodePort 10.233.26.167 <none> 8080:31111/TCP 4msvc/gateway ClusterIP 10.233.55.73 <none> 8080/TCP 4msvc/gateway-external NodePort 10.233.57.162 <none> 8080:31112/TCP 4msvc/kubernetes ClusterIP 10.233.0.1 <none> 443/TCP 2hsvc/prometheus ClusterIP 10.233.46.236 <none> 9090/TCP 4msvc/prometheus-external NodePort 10.233.15.159 <none> 9090:31119/TCP 4m NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGEdeploy/alertmanager 1 1 1 1 4mdeploy/faas-netesd 1 1 1 1 4mdeploy/gateway 1 1 1 1 4mdeploy/prometheus 1 1 1 1 4m Test It! Now that OpenFaaS is running on Kubernetes let’s test it! Go to your worker node’s port (in my case it’s ). You should see the gateway UI like the following capture: 31112 203.104.227.60:31112 OpenFaaS Gateway UI Let’s deploy a new function via the Function Store. I love the function made by . Let’s select it and hit . Figlet Johnny Mkhael Deploy OpenFaaS Function Store After deploying and refreshing the UI, you should see on the function list. Let’s type some cool words and the function. figlet INVOKE Invoking the Figlet Function Awesome! OpenFaaS running on Kubernetes deployed by RKE (Rancher Kubernetes Engine). With 2 nodes that only have 1 core and 1GB RAM! Note that memory intensive and cpu intensive functions may not work because of lack of resources. In those cases, you should add some more hosts with resources. Wrap Up This 2 part blog post showed how easily you can create a Kubernetes cluster via RKE and how easily you can deploy OpenFaaS on it. From here you can integrate other components with OpenFaaS as well, and this should be a good start point!