Operation
What is Knative?
About Knative
Knative is a platform built on Kubernetes that allows you to create, deploy, and manage modern serverless workloads. Kubernetes is the infrastructure that manages containerised applications, whilst Knative is a platform that runs on Kubernetes to enhance the developer deployment experience.
In addition to assisting with scaling and managing the deployment lifecycle, the use of Kubernetes and containerised applications significantly simplifies the challenges associated with managing virtual server environments. Thanks to these benefits, a new trend called serverless computing has gained momentum. In a serverless computing cloud execution model, the cloud provider operates the server environment and manages the allocation of the server's machine resources.
Different applications require different deployment environments, which can pose problems for scalability and efficiency. There was a need to standardise this process and bridge the gap between application code and packaging containers for deployment. Hence the development of Knative.
Knative was originally developed and open-sourced by Google; the project has benefited from additional support and contributions from Pivotal, IBM, Red Hat, and SAP. It enables developers to write code without having to worry about where the code is executed. When using it, you as a developer do not need to know the underlying infrastructure of Kubernetes, such as pods, deployments, etc.
Knative can be used to deploy and manage applications across multiple platforms. To achieve this, Knative ships with a suite of middleware components that enable building, deploying, and scaling container-based applications.
Components of Knative
Build
The Build component manages the creation of source code in containers. It follows sequential steps that define the process of building source into a container image. It provides faster builds through cached artefacts. It allows you to use Dockerfiles or build templates.
Serving
The Serving component ensures that your application is accessible to the world via HTTP requests. It handles hosting, seamless automatic scaling, and the management of an application's lifecycle. The Knative Serving component can scale down to zero when no traffic is received for a specified period. When a new request arrives, it automatically starts a new pod to serve the request.
Eventing
The Eventing component manages the subscription, delivery, and control of events. It connects event publishers and event consumers via a Knative broker that acts as a channel. Event publishers and event consumers are independent of one another. A producer publishes event messages to the broker. A consumer is bound to the broker via a trigger. This independent eventing model enables a highly scalable event infrastructure. As a developer, you can write code in containers to respond to specific event triggers. You are free to create your own event pipelines to connect with your existing systems.
How does Knative fit into Google Cloud?
In line with Knative and serverless computing, Google Cloud provides the public with a suite of tools so that developers can focus on writing great code. Knative focuses on tasks that arise when building and running applications on cloud native platforms. These tasks include managing source-to-container builds, routing and managing traffic during deployment, binding services to event ecosystems, and handling auto-scaling workloads.
Cloud Run – Google offers a serverless execution environment for running stateless HTTP-driven containers called Cloud Run. Cloud Run is based on Knative Serving APIs. Cloud Run provides developers with an entry point for deploying serverless applications.
Cloud Run for Anthos – Developers can deploy their application code with Knative in Google Cloud Anthos. Anthos is an application management platform that provides a consistent development and operational experience across different environments, whether in the cloud (Anthos on Google Cloud), on-premise (Anthos on-prem), or with other cloud providers.
Google Cloud supports the Knative open-source project through continuous improvements and the development of platforms that can leverage its features to ensure highly scalable applications.
Knative Benefits
This platform enables you to write code in any language or framework and deploy it across different platforms whilst minimising switching costs.
It manages the server for you, thereby eliminating the administrative overhead for servers.
You only pay for execution time; when functions are not running, no costs are incurred.
The stateless nature of Knative services enables scalability – they can scale up as traffic increases and scale down to zero at no additional cost.
Knative supports popular tools and frameworks such as Django, Laravel, Ruby on Rails, Spring, GitOps, DockerOps, ManualOps, and more.
If you already have a deployment infrastructure for your project, Knative is designed to integrate easily into an existing build and CI/CD workflow.
The experience is the same, whether in the cloud, on-premises, or in a third-party data centre.



