Container or Serverless? This question becomes irelevant with the use of Knative. The open source project Knative was developed by Google together with Pivotal, IBM, Red Hat and SAP and offers middleware components for serverless container applications based on Kubernetes and Istio. Based on the story “Deploy a Kubernetes Cluster on OpenStack using Kubespray” we install Knative and show how to use it.

Knative Introduction

Knative is an open source framework that provides a collection of components that extend Kubernetes. Currently, Knative offers three components: Serving, Build, and Eventing.

The three components could be described as follows:

Serving is base on Kubernetes and Istio, provides the possibility to deploy and serving of functions and serverless applications. It includes a automatic scale-to-zero function.

Build provides building block for creating container images from source code. The source code could be provided from different soruces (git, gce, custom).

Eventing provides blocks for consuming and producing events to bind event sources to services.

Knative is developed for different target groups the following diagram gives an overview:

Diagram by Knative

Developers

Knative components offer developers Kubernetes-native APIs for deploying serverless-style functions, applications, and containers to an auto-scaling runtime.¹

Operators

Knative components are intended to be integrated into more polished products that cloud service providers or in-house teams in large enterprises can then operate. Any enterprise or cloud provider can adopt Knative components into their own systems and pass the benefits along to their customers.¹

Contributors

With a clear project scope, lightweight governance model, and clean lines of separation between pluggable components, the Knative project establishes an efficient contributor workflow.¹

Istio

The use of cloud platforms is diverse and offers companies far-reaching opportunities. But it can lead to a situation in which the operation of the cloud burdens the developers as well as the operation. This leads to complex microservice architectures, with the operation having to administer extensive hybrid and multi-cloud implementation. In this situation Istio helps to control, secure, connect and monitor services.

Install Istio

After a short introduction we can start to install Knative on our Kubernetes Cluster, that we deployed in my last Kubernetes story. The installation is based on the Knative documentation.

First, we need to install Istio. This will be done by the following commands. It will take some seconds to get all services in the running state.