Welcome to the last full chapter of the book! We’re going to finish on a high note, learning how to turn your Kubernetes cluster into a serverless platform. Lots of serverless platforms are in the cloud, but they’re mostly bespoke systems, and you can’t easily move your AWS Lambda components to Azure Functions. The extensibility of Kubernetes makes it easy to deploy a serverless runtime in the cluster, which is just as portable as all your other apps. We’ll cover some open source projects in this chapter that give you a very Lambda—like experience, where you focus on the code and the platform packages and it deploys it for you. Serverless functions run as containers in Pods, so you manage them in the usual way, but the platform adds some higher-level abstractions.
Several serverless platforms exist in the Kubernetes ecosystem, and all take slightly different approaches. One of the most popular is the Knative project from Google, but it has an unusual workflow: you need to package your functions in Docker images yourself, and then Knative deploys them for you. I much prefer the code-first approach, where you bring your code and the platform runs it in a container; that fits the goal of a simple workflow for serverless functions. In this chapter, we’ll use Kubeless, another popular platform, and we’ll also see how to abstract the serverless platform itself with the Serverless project.