Knative is an open source serverless framework built on Kubernetes. Container Compute Service (ACS) Knative is fully compatible with open source Knative and Kubernetes APIs, and adds managed hosting, predictive scaling, and deeper integration with Alibaba Cloud services.
Knative addresses three common pain points in Kubernetes-based development:
-
Deployment complexity: Knative abstracts away pods, Services, Deployments, and Ingress configuration. A single Knative Service definition handles all of it.
-
Idle resource cost: Knative scales pod counts to zero when no traffic is received and scales back out automatically when requests arrive.
-
Vendor lock-in: Because Knative runs on any Kubernetes cluster, workloads are portable across cloud providers and on-premises environments.
Key concepts
Knative consists of three components. Each can be used independently or together, so you can adopt Knative incrementally based on your needs.
-
Knative Serving handles serverless workload management: deployment, version management, canary releases, and request-based auto scaling. When no traffic is received, Knative Serving scales pods to zero.
-
Knative Eventing provides event management: connect to external event sources, register and subscribe to events, and filter events before routing them to Services or functions. It decouples event producers from event consumers.
-
Knative Functions lets you create, build, and deploy Knative Services without deep knowledge of Kubernetes, containers, or Knative internals. Deploy stateless, event-driven functions as Knative Services directly to a cluster.
How request-based auto scaling works
Knative Serving injects a queue-proxy sidecar container into each pod to collect concurrency and requests per second (RPS) metrics. The autoscaler uses these metrics—rather than CPU or memory—to adjust pod count, which more directly reflects actual service load.
When traffic drops to zero, the autoscaler switches from Serve mode (direct routing) to Proxy mode. Incoming requests are held at the Proxy while new pods start. Once the pods are Ready, the Proxy forwards the queued requests and switches back to Serve mode.
To achieve the same request-based auto scaling without Knative, you would need to create a Deployment and a Service, configure an Ingress, and configure Horizontal Pod Autoscaler (HPA) separately. A Knative Service handles all of this in a single YAML file.
How version management and canary releases work
Every Knative Service has two underlying objects:
-
Configuration: represents the current desired state of the Service. Each update to the Service creates a new, uniquely identified revision.
-
Route: maps traffic to one or more revisions with configurable proportions.
This model supports rolling back to a previous revision and splitting traffic across revisions for canary releases or A/B tests. For example, you can route 70% of traffic to Revision V1 and 30% to Revision V2.
Why ACS Knative
ACS Knative is fully compatible with open source Knative and Kubernetes APIs, and extends it in several areas.
Capability as a Service
ACS Knative lets you deploy applications with a few clicks, without purchasing resources to build a system. A console with visual operations simplifies the use of Kubernetes clusters and Knative.
Managed components and Ingress
In ACS clusters, Knative Serving and Knative Eventing are hosted and managed by ACS with high availability at no extra charge. ACS also provides four Ingress options:
| Ingress | Description |
|---|---|
| Application Load Balancer (ALB) | Fully managed, O&M-free; backed by the Alibaba Cloud ALB service with built-in auto scaling |
| Microservices Engine (MSE) | Next-generation Ingress complying with Kubernetes Ingress standards; supports all features of traditional traffic gateways |
| Service Mesh (ASM) | Istio-compatible; centralized traffic management for microservices with mesh observability and secure inter-service communication |
| Kourier | Open source, lightweight Ingress based on the Envoy architecture; compatible with the open source Knative version |
ALB, MSE, and ASM Ingress controllers are created and hosted by ACS. Kourier is compatible with the open source version.
Reduced cold start time
Open source Knative scales pods to zero during off-peak hours to save costs, but the next request incurs a cold start. ACS Knative offers two ways to reduce this latency:
-
Reserved instances: Reserve a low-specification burstable instance to keep a pod warm. This balances cost savings with startup time.
-
Predictive scaling with Advanced Horizontal Pod Autoscaler (AHPA): AHPA analyzes historical metrics to predict demand and pre-provisions resources before traffic peaks. Use this when your application workload fluctuates on a regular schedule.
For a full comparison, see Comparison between Alibaba Cloud Knative and open source Knative.
Ecosystem integration
ACS Knative integrates with Alibaba Cloud observability and application services without requiring you to provision or manage additional servers:
-
Logging and monitoring: Simple Log Service (SLS) and Managed Service for Prometheus
-
Event integration: EventBridge
Use cases
| Use case | Description |
|---|---|
| Web service hosting | Deploy web services with simplified configuration. The revision mechanism gives each version a unique identifier for rollback and traffic splitting. Use Route-based traffic proportions to run canary releases and A/B tests. |
| Serverless applications | Let developers focus on business logic rather than IaaS resources. ACS Knative scales out based on request concurrency and scales pods to zero when traffic stops, reducing idle costs. |
| AI inference services | In GPU-accelerated scenarios, teams can focus on AI model development and deployment rather than infrastructure maintenance. ACS Knative scales inference services based on actual workloads and can run on cloud nodes, in data centers, or on edge devices. |
| Event-driven workloads | Connect to external event sources using Knative Eventing. For example, configure an event source to receive IoT sensor data and trigger downstream processing logic such as data storage, real-time analysis, and alerting. Supported sources include Apache Kafka, GitHub, MNS, and Apache RocketMQ. |
Get started
Prerequisites: Deploy Knative in your ACS cluster before proceeding.
Set up components and Ingress
-
Install Knative Serving — deploy ACS Knative in the console and install the Knative Serving component.
-
Choose and deploy an Ingress — ACS Knative supports ALB, MSE, ASM, and Kourier. See the linked guide for selection recommendations.
Configure auto scaling
-
Set up KPA based on request count — implement Knative Pod Autoscaler (KPA) scaling based on QPS.
-
Configure predictive and scheduled scaling with AHPA — use AHPA to pre-provision resources based on historical metrics and cron-based schedules.
-
Use HPA in Knative — configure CPU-based scaling thresholds using HPA.
Manage versions and traffic
-
Create a revision — manage application versions and roll back to earlier revisions.
-
Perform a canary release — split traffic across revisions by configuring Route proportions.
Access Knative Services
The default domain for a Knative Service follows the format {route}.{namespace}.{default-example.com}.
-
Configure a custom domain — specify a custom domain name suffix for your Services.
-
Enable HTTPS with a certificate — configure a certificate to secure traffic for custom domains.
-
Configure liveness and readiness probes — monitor and manage Service health.
Advanced features
-
Knative Eventing overview — set up event-driven architectures with sources including Apache Kafka, GitHub, MNS, and Apache RocketMQ.
-
Deploy Knative Functions — create and deploy stateless functions without managing Kubernetes configuration directly.
-
Deploy KServe and run an inference service — use the Kubernetes-based KServe machine learning model serving framework to deploy trained models (TFServing, TorchServe, Triton) on Kubernetes.
-
Integrate with ASM for advanced traffic management — use Service Mesh (ASM) for complex traffic routing, mesh observability, and secure inter-service communication in Knative Services.
Observe and monitor
-
View the Knative dashboard — connect to Managed Service for Prometheus to view response latency and request concurrency metrics.
Billing
ACS Knative itself is free. You are charged only for the cloud resources created when you use it, such as SLB instances and NAT gateways. For details, see Billing rules.
FAQ
See Knative FAQ for common issues. Frequently asked questions include:
Contact us
For questions or feedback about Knative, join DingTalk group 23302777.
What's next
-
Keep Knative Serving up to date to get the latest features and fixes. Update during off-peak hours. See Knative release notes and Update the Knative Serving component.
-
Walk through the official Knative Bookstore Tutorial to see how to build, deploy, and monitor an application end-to-end with Knative.