In a nutshell, serverless architecture eliminates the need for developers to manage servers. Servers continue to run in the background, but the burden of maintaining and scaling infrastructure is shifted to the cloud provider. Developers can streamline their code significantly down to a specific function, typically with an “on-demand” cost model where resources are charged only when the function is executed.
A function executes when an API endpoint triggers an event. This allows applications with unpredictable or rapidly changing state to scale horizontally using functions abstracted from the primary application. In fact, when a shopper selects an item on her e-commerce site, it triggers a function designed to check the database to see if the item is in stock and pull the latest price information. may occur.
native is a powerful functional toolset built on top of Kubernetes for managing serverless applications. Knative allows you to scale your pods to zero in your Kubernetes cluster while keeping resources available so that your pods can scale up as needed.
Knative supports events and triggers that you can customize to control how your application responds. It’s a portable, vendor-agnostic tool that you can use with your preferred managed Kubernetes service (such as our own Linode Kubernetes Engine) or install it in your local cluster. Combining Kubernetes with this installable functional platform optimizes the state management and self-healing benefits of running applications on Kubernetes.
Knative offers:
- auto scaling: Knative provides automatic scaling of pods based on traffic and demand, including scaling to zero. This improves resource utilization and reduces costs.
- Event-driven computing: Knative allows serverless workloads to respond to events and triggers.
- portability: Knative is designed to work across a variety of cloud providers and environments. This allows developers to deploy serverless applications to different environments without changing their code.
- Scalability: Knative provides a set of building blocks that can be customized to meet specific application requirements.
- Enterprise scalability: Knative is trusted by companies like Puppet and Outfit7.
Usage
Knative functionality is split between Knative Eventing and Knative Serving.
- event: A collection of APIs that enable sinks or route events from event producers to event consumers via HTTP POST requests.
- Serving: Define a set of objects as a Kubernetes Custom Resource Definition (CRD) or create an extension to the Kubernetes API. This determines how your serverless workloads interact with your Kubernetes cluster using the following resources:
- root: Network endpoint mapping to revision endpoints and traffic management.
- composition: Maintain the desired state as a separate layer from your code.
- Revision: A snapshot of the code and configuration of all changes and changes made.
- service: Workload management to control object creation and ensure that the app continuously has routes, configurations, and revisions to the latest revision or to a specific revision. Knative is Istio Gateway service by default.
![A diagram showing the layers of a Kubernetes cluster. Istio is a service mesh that handles query routing and load balancing. Knative is in between, with its Eventing and Serving capabilities, and a Kubernetes cluster at its base.](https://www.linode.com/wp-content/uploads/2023/02/KnativeBlog-Diagram-1064x559.jpg)
Knative can be installed on your cluster Using YAMLor Knative operator for KubernetesThere is also Knative Helm chart Submitted by a Kubernetes community member. Knative has Quickstart environmentbut this is only recommended for testing purposes.
Getting Started with Akamai Cloud
Knative is a great complement to LKE’s built-in autoscaler that allows you to easily control the minimum and maximum nodes in your cluster’s node pool. Using Knative and the autoscaler together provides fine-tuned management at both the pod and infrastructure level.
And to help you get started, we have a new on-demand course for just that! We collaborated with Justin Mitchel of Coding for Entrepreneurs to bring you the new Try Knative On-Demand course February 28, 2023 started at This video series includes his using Terraform to create a Kubernetes cluster, configure a Knative service, and deploy a containerized application.