Technical Insight Explanation

Understanding Knative: Bringing Serverless to Kubernetes

Explore Knative Serving and Eventing, application revisions, request routing, traffic splitting and scale-to-zero on Kubernetes.

Understanding Knative: Bringing Serverless to Kubernetes
On this page

Deploying a container on Kubernetes is not particularly difficult. Operating an application that should disappear when nobody uses it is another matter.

A Deployment maintains replicas. A Service provides a stable network endpoint. An autoscaler adjusts capacity. An ingress controller exposes the application. A progressive delivery system might manage traffic between releases. Each component solves a problem. Someone still needs to assemble them into an application platform.

In a previous article , we explored how Virtual Kubelet separates workload execution from conventional worker infrastructure. But delegating execution does not tell Kubernetes when an application should exist, how requests should activate it or how traffic should move between versions.

Knative addresses that missing layer.

Serverless is an application operating model

Serverless does not mean that servers disappear. It means that the application consumer no longer needs to manage certain infrastructure and lifecycle decisions directly.

Kubernetes provides the primitives for building such an operating model, but a conventional Deployment does not automatically become a request-driven service. If its replica count reaches zero, a Kubernetes Service has no ready application endpoints. Something outside those replicas must receive incoming requests and initiate activation.

Knative adds that coordination through Kubernetes custom resources, controllers, networking integrations and runtime components. It does not replace the scheduler, container runtime or underlying compute infrastructure.

The project has two principal subsystems: Serving, for request-driven application deployment and lifecycle management, and Eventing, for connecting event producers and consumers. They can be used independently.

Knative Serving: four resources, one application

The primary developer-facing abstraction is a Knative Service (serving.knative.dev/v1), not to be confused with the core Kubernetes Service (v1).

A Knative Service coordinates three other resources:

  • Configuration: defines the desired application template and tracks its revisions.
  • Revision: an immutable snapshot of the application configuration, including its container image and runtime settings. Its runtime state and replica count can change independently.
  • Route: defines how incoming traffic is distributed across revisions and exposes an address for the application.

Knative Serving resource relationships

When a developer changes the revision template, for example by deploying a new container image, the Configuration controller creates a new Revision. Serving reconciles the underlying Kubernetes workloads and networking resources. Once the new revision is ready, traffic can be directed to it according to the Route configuration. A routing-only change does not require a new application revision. This separation is important: deployment and release are related operations, but they do not have to happen simultaneously.

Deploying a request-driven service

Consider the following minimal example. It assumes Knative Serving and a supported networking implementation are already installed in the cluster.

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: hello
spec:
  template:
    metadata:
      name: hello-v1
    spec:
      containers:
        - image: ghcr.io/knative/helloworld-go:latest
          ports:
            - containerPort: 8080
          env:
            - name: TARGET
              value: "Ape Factory"

Save the manifest as hello.yaml and inspect the resulting resources:

kubectl apply -f hello.yaml
kubectl get ksvc,configuration,revision,route
kubectl get ksvc hello -o jsonpath='{.status.url}'

The image is an illustrative upstream sample; verify its availability and pin a tested digest for reproducible deployments. Accessing the reported URL requires the cluster’s ingress and DNS configuration to be functional. Notice what is missing: a replica count, an HPA manifest and a manually maintained ingress definition. Those responsibilities have not disappeared. They have moved behind the Serving API and its controllers.

What happens when a request arrives?

A Knative Revision typically runs as a Kubernetes Deployment whose Pods contain the application container and a Serving-managed sidecar called the queue-proxy. The queue-proxy participates in request handling, concurrency measurement and readiness reporting. The networking layer routes requests to the selected revision. Depending on the revision’s capacity and configuration, traffic can pass through the Activator, or reach ready revision Pods without traversing it.

Request path and activation in Knative Serving

When a revision has scaled to zero, the Activator provides a request path while capacity is being established. The autoscaling system observes demand and adjusts the desired replica count. Kubernetes then schedules the resulting Pods using its normal mechanisms. Once an application instance becomes ready, requests can proceed. Activation is subject to timeouts and available infrastructure capacity; the Activator is not a durable message queue.

This explains why cold starts cannot be attributed to Knative alone. Scheduling, node provisioning, image pulls, application initialization and readiness checks can all contribute to the observed latency.

Scale-to-zero is not node autoscaling

The default Knative Pod Autoscaler (KPA) uses request-oriented signals such as concurrency or requests per second, depending on configuration. With scale-to-zero enabled and no minimum replica count preventing it, an idle revision can eventually reach zero replicas.

The distinction from infrastructure autoscaling is fundamental. Knative decides how many application instances are needed. Kubernetes decides where their Pods should run. A node autoscaler may then provision or remove worker capacity when its own conditions are met. These are separate control loops. Scaling an application to zero does not necessarily remove a worker node or eliminate infrastructure charges. Conversely, provisioning additional worker capacity does not automatically activate a dormant application.

Latency-sensitive services can maintain a minimum number of replicas. That trades idle resource consumption for reduced activation latency. The detailed scaling windows, concurrency targets and cold-start mechanics deserve their own article.

Deploying is not the same as releasing

Knative’s revision model also provides a useful foundation for progressive delivery. Suppose we change the application template to create hello-v2. We can retain the original revision and explicitly distribute traffic between the two versions by updating the Knative Service’s traffic specification:

spec:
  traffic:
    - revisionName: hello-v1
      percent: 90
    - revisionName: hello-v2
      percent: 10

This is a fragment to merge into the existing Knative Service, after both revisions have been created and verified ready. It is not a standalone manifest. The networking implementation distributes requests according to the configured weights. A rollback can redirect traffic to the earlier revision without rebuilding its image, provided that revision remains available. Traffic splitting is not, by itself, an automated canary analysis system. Knative does not infer that a release is healthy simply because ten percent of traffic reaches it. Error rates, latency thresholds and promotion decisions still need observability and release policy.

Knative Eventing: a different abstraction

Not every application starts with an HTTP request from a user. An object upload, an order submission or a message from another system may initiate processing. Knative Eventing provides abstractions for connecting event producers and consumers, using CloudEvents as a common event representation. An event Source can deliver events to a Broker; Triggers select events and forward them to subscribers. Channels and Subscriptions offer another messaging abstraction.

A subscriber can be a Knative Service, but it does not have to be. Serving and Eventing remain independent subsystems.

Delivery guarantees, persistence, retry behavior and ordering depend on the selected implementation and configuration. Consumers should be designed for duplicate delivery where applicable. A Broker resource alone is not a guarantee of exactly-once processing.

Where the abstraction stops

Knative is not a managed cloud service merely because it exposes a serverless API. Someone still operates its controllers, ingress, certificates, upgrades, security policies and observability. Stateful applications, long-running background processes and workloads requiring predictable startup latency may need a different operating model.

For platform teams, the decision is therefore about which responsibilities to expose to developers and which to absorb into the platform. Knative offers a higher-level contract, not an exemption from infrastructure engineering.

The interesting question is no longer whether Kubernetes can run a container. It is whether the platform can make that container available exactly when demand requires it.

Fun fact: You already know Google Cloud Run.

Google originally co-created Knative to establish a portable, open standard behind Google Cloud Run. While managed Cloud Run runs on Google’s proprietary infrastructure rather than a Kubernetes cluster you operate, its v1 API implements the Knative Serving specification. In practice, the serving.knative.dev/v1 manifest above can be deployed directly to Cloud Run with minimal changes—giving teams a clear path between self-hosted Kubernetes and a fully managed serverless runtime.

In the next article, Knative Internals: How Scale-to-Zero Actually Works, we will examine the control loops and request paths that make this possible.

Further reading

Related Articles

Stay ahead

Get the latest insights.

Insights on cloud, AI and open source — delivered to your inbox.

Email subscriptions are coming soon.