Extending Kubernetes with Knative

Rajesh Shah
codeburst
Published in
3 min readAug 24, 2020

--

Introduction

Today, Kubernetes is the most widely used platform for running containerized workloads. Extensive open source tooling available around Kubernetes makes the decision of using Kubernetes more lucrative for enterprises. So having a solution that allows running Serverless workloads on top of the Kubernetes platform is the step in the right direction. Knative brings this vision to life. In this story, I will try to explain Knative architecture and how it can help enterprise move towards “Function as Service(FaaS)” architecture. I highly recommend reading my story on the state of serverless computing and the direction of cloud computing here.

Enterprise Software Workloads

All enterprise software workloads can be divided into two categories:

Serving — In this category, we have API, micro-services, websites, and other applications that are synchronously supporting user interaction. This category of workload has https endpoint which consumer can access.

Eventing- In this category, we have an application that is triggered by an event and does asynchronous computing. Enterprise batch processing applications will fall in this category. Also in this category are application which are event producers.

Knative Architecture

Knative is an Open Source Platform built on top of Kubernetes by Google, IBM, Pivotal, and other cloud providers. It tries to address the enterprise need for a serverless platform for “ Serving” and “Eventing” workloads.

Serving — This module provides capability to build serverless containers for microservices, websites, etc.

Eventing — This module provides the capability to build serverless applications which are event producers and consumers.

Knative also has an Observability plugin that provides standard tooling that can be used to get visibility into the health of the software running on Knative.

There was a “Build” and “CI/CD” module in Knative which has been deprecated and spun as a separate project Tekton.

Knative Serving

Knative Serving allows to build Serverless application which can easily scale up and down to zero. Knative integrates with “istio” and other Service Mesh technologies to provide intelligent routing, traffic management, and blue-green deployment and other service mesh capabilities out of the box. Serving is easy to get started with and scales to support advanced scenarios.

The Knative Serving project provides the following benefits

  • Rapid deployment of serverless containers
  • Automatic scaling up and down to zero
  • Service Mesh Integration with Routing and Traffic Management
  • Blue-Green and Canary Deployment capabilities
  • Build release Snapshots and rollback capabilities

Knative -Eventing

Knative provides an advanced serverless eventing framework for enterprises to leverage. It has a broker implementation which is channel-based and multi-tenant. Channel can be in-memory or backed by Apache Kafka or other messaging platforms..

Knative Eventing can be used in the following scenarios:

  1. Publish event by Sending events to a Broker as an HTTP POST.
  2. Consume events by using a Trigger to consume events from a Broker based on CloudEvents attributes.
  3. Transform events through a series of steps using Channels and Subscriptions.

Final Thoughts

Knative is an extension of the Kubernetes Open Source platform to build “Function as Service(FaaS)” serverless architecture. Its provides higher level of abstraction over Kubernetes and adds capabilities like Service Mesh and rich event processing framework. It puts enterprises ahead in the journey to serverless architecture using containers. Knative is open source and supported by multiple cloud providers. Knative is a new framework but with a large installation base of Kubernetes it is going to see rapid adoption.

Disclaimer: This is a personal blog. The opinions expressed here represent my own and not those of my current or any previous employers.

--

--

Software Engineer with 15+ years experience (Interested in Cloud Computing, Kubernetes, Docker, Serverless Computing, BlockChain Technologies)