Knative is an open source project based on the Kubernetes platform for building, deploying and managing serverless workloads that can run in the cloud, on premises or in a third-party data center. It was originally started by Google with contributions from more than 50 companies, including such industry giants as IBM, Pivotal, Red Hat and SAP.
Knative relies on Istio, an open source service mesh developed by Google, to manage traffic routing, revisions and metrics. Knative's integration with Istio makes it easier for containerized and serverless workloads to be exposed on the Internet, monitored and controlled. This integration also ensures that developers' data is encrypted during transit.Content Continues Below
Knative aggregates all the best practices of other Kubernetes-based frameworks into a single framework. Knative, which works like a Kubernetes extension, covers any type of modern serverless workload. It combines all these workloads under a common topology and terminology set.
Developers on Knative can use any language, idioms and frameworks they choose to deploy functions, applications and container workloads. Knative supports common development patterns, including DockerOps, ManualOps and GitOps, as well as such tools and frameworks as Ruby on Rails, Django, Spring and others.
What is Knative used for?
Knative provides several open source tools that integrate natively with Kubernetes. Using the open source framework, developers can build and deploy container-based serverless applications and then move those apps between cloud providers. Knative enables companies to deploy serverless functions on internal Kubernetes clusters.
Knative can be used by developers on the server side who are focused on cloud-native development and are using Kubernetes as their base container platform. Knative can help developers who are having issues configuring Kubernetes to manage container-based environments as well as those adopting a microservices-based approach using containers.
Knative assists developers by automating the process of building containers. It allows developers to focus on writing code without having to worry about building, deploying and managing their apps. Knative can be used as part of a pipeline automation project to enable DevOps teams to get up and running.
Knative also enables easier customer rollouts. Knative lets developers expose new container revisions to a small group of users first, gradually increasing the number of users. If there are any problems, developers can quickly roll back to older versions.
Knative offers such features as autoscaling, in-cluster builds, scale-to-zero and eventing framework for cloud-native apps on Kubernetes.
Knative includes two main components, also known as "primitives," that let developers deploy and manage their serverless apps in their Kubernetes clusters.
Serving: The Serving primitive helps developers deploy serverless apps as Knative services and scale them automatically, even down to zero instances. Knative uses Istio to expose developers' serverless and containerized workloads. When developers install the managed Knative add-on, the managed Istio add-on is also automatically installed. Developers can use Istio's intelligent routing and traffic management functionality to control what traffic is routed to specific versions of their services. Developers can then more easily test and roll out new app versions or perform A/B testing.
Eventing: The Eventing primitive helps developers build event-driven applications. For example, maybe a developer wants to launch a new build of an app every time code is pushed to the GitHub master repository. Or maybe a developer only wants to run a serverless application if the temperature drops to 32 degrees Fahrenheit or lower. Developers can integrate the Eventing primitive into their continuous integration/continuous delivery (CI/CD) pipelines to automate the build and deployment of their apps in case a specific event occurs.
The Knative open source project deprecated the Build primitive and replaced it with the Tekton open source project. The Build primitive provided a developer with the tools to automate the build process for an app from source code to a container image.
The Tekton project, which stems from the Knative project, offers advanced CI/CD features on top of the deprecated Knative Build primitive. Tekton is a flexible Kubernetes-native open source framework used to create CI/CD systems. Tekton offers open source components to enable developers to standardize their CI/CD tooling and processes across languages, vendors and deployment environments.
Knative vs. Kubeless
Kubeless is a Kubernetes-native serverless framework that allows a developer to deploy small pieces of code without having to be concerned about the underlying infrastructure. It's deployed on top of a Kubernetes cluster and uses Kubernetes resources to provide API routing, auto-scaling, monitoring and troubleshooting.
Kubeless supports HTTP and event-based functions triggers. It has a serverless plugin, a graphical user interface and multiple runtimes, including Python and Node.js.
Kubeless accepts commands to register, delete and list functions that a developer would like to run. Kubeless makes it easier for developers to set up containers and pods.
Kubeless creates functions such as custom Kubernetes resources using a Custom Resource Definition. Kubeless then runs an in-cluster controller that watches these custom resources. The controller launches runtimes on demand and dynamically injects the codes of the functions into the runtimes so that they're available over HTTP or via the publish/subscribe messaging mechanism. Any message published to a topic in a publish/subscribe model is immediately received by every subscriber to the topic.
Knative is adopted faster than Kubeless and has a greater chance of being accepted among developers than Kubeless. Not just because of the timing of its release (it was released during a time of increased serverless adoption), but also because it uses Kubernetes and Istio, popular open source components already widely deployed in containerized environments.
Both Kubeless and Knative offer sets of building blocks that make it easier for developers to use Kubernetes and Istio to manage and operate lambda functions, i.e., small anonymous functions.
Kubeless builds an image out of some code and starts it on Kubernetes. Knative does the same but using a more modular approach, enabling different components to plug into and adapt to different deployment scenarios. Knative and Kubeless are both categorized as serverless/task processing tools.
Knative vs. Lambda
AWS Lambda is a compute service that runs developers' code in response to events and automatically manages the underlying compute resources. Developers can use AWS Lambda to extend other AWS services with custom logic. Alternatively, developers can create their own backend services that operate at AWS scale, performance and security.
While Lambda is a hosted and packaged tool, Knative is a set of software building blocks. As such, Knative differs from Lambda in several ways. For example, developers can run it locally or install it onto a Kubernetes cluster anywhere, including on AWS or Google.
In addition, Knative also offers portability, meaning developers aren't locked into one cloud provider. Although there are plugins to allow for features that are specific to certain vendors, the main experience and runtime behavior are the same for each cloud.