Difficulty: Introduction
Estimated Time: 30 minutes

Kubeless on Kubernetes

Kubeless

Kubeless is a Kubernetes-native serverless framework that lets you deploy small bits of code without having to worry about the underlying infrastructure plumbing. It leverages Kubernetes resources to provide auto-scaling, API routing, monitoring, troubleshooting and more.

Exploring Kubeless is a great way to explore this as an architectural pattern on Kubernetes. The combination of a CLI tool, ConfigMaps, pre-baked containers, a controller and some Custom Resource Definition (CRDs) optionally along with Kafka achieves a clean solution for managing functions.

Kubeless relies on a command-line tool called 'kubeless' to submit functions and perform controlling operations with the Kubeless controller. There is also a user interface to parallel the CLI tool features. A dedicated Kafka system is also added to allow functions to be trigger via publish/subscribe.

You will learn how:

  • to install Kubeless on Kubernetes
  • functions are deployed and removed
  • functions are named, exposed, and invoked
  • functions are listed, inspected and monitored

More about the Kubeless architecture is described in the Kubeless documentation.

Kubeless is purely open-source and non-affiliated to any commercial organization. Help and feedback is welcomed.

Conclusion

Kubeless is a Kubernetes-native serverless framework. It runs on top of your Kubernetes cluster and allows you to deploy small unit of code without having to build container images. With Kubeless you can build advanced applications that tie together services using functions.

Lessons Learned

With these scenarios you have learned how:

  • to install Kubeless on Kubernetes
  • functions are deployed and removed
  • functions are named, exposed, and invoked
  • functions are listed, inspected and monitored

References

Additional topics may be added to this lesson:

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Kubeless

Step 1 of 11

Install Kubeless

As you see, your Kubernetes cluster based on Minikube is started now or will be available shortly. Verify it's ready for your use:

minikube version && minikube status

Install Kubeless Controller

Helm is a package manager for Kubernetes and is initialized and ready.

helm version

A common Helm chart is predefined for installing Kubeless. Normally, popular charts appear in the curated Helm chart repository and there are plans to move Kubeless there. For now, this repo add command will allow Helm to find the Kubeless chart:

helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/

To install Kubeless onto Kubernetes apply this command:

helm install --name my-kubeless --namespace kubeless incubator/kubeless --set ui.enabled=true

As part of the installation there will be two Pods started in the new kubeless namespace on your Kubernetes cluster.

  • The Kubeless controller deployment will watch for function objects to be created.
  • The Kubeless ui deployment serves up a browser based dashboard showing the functions

Observe the availability of each deployment as they progress from 0 to 1:

kubectl get deployments --namespace kubeless

Wait until at the least the controller deployment has its Available status change to 1.

New functions can now be deployed to Kubeless.

Terminal
Kubernetes Dashboard
Kubeless UI