Chapter 14. Serverless and Event-Driven Applications

Serverless represents a cloud native paradigm for development, empowering developers to create and deploy applications without the burden of server management. While servers are still part of the equation, the platform abstracts them away from the intricacies of application development.

In this chapter, you will find recipes that show you how to deploy serverless workloads on Kubernetes using the Knative stack.

14.1 Installing the Knative Operator

Problem

You want to deploy the Knative platform to your cluster.

Solution

Using the Knative Operator, you can easily deploy the Knative stack components to your cluster. The operator defines custom resources (CRs), enabling you to easily configure, install, upgrade, and manage the lifecycle of the Knative stack.

To install version 1.11.4 of the Knative Operator from the release page, do this:

$ kubectl apply -f https://github.com/knative/operator/releases/download/
knative-v1.11.4/operator.yaml

Verify that the operator is running:

$ kubectl get deployment knative-operator
NAME               READY   UP-TO-DATE   AVAILABLE   AGE
knative-operator   1/1     1            1           13s

Discussion

Knative is an open source project that develops components for deploying, running, and managing serverless, cloud native applications on Kubernetes. The platform consists of two main components, namely Serving and Eventing.

While the Knative Operator is the preferred method for deploying and configuring the Knative components, alternatively ...

Get Kubernetes Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.