Knative is an open source and Kubernetes-based platform for serverless applications. Knative helps you deploy and manage serverless workloads and build enterprise-class platforms for serverless workloads. Serverless Kubernetes (ASK) is integrated with Knative. To use cloud resources by calling the Knative API, you need only to create an ASK cluster and enable Knative for the cluster. In this case, you do not need to pay for the Knative controller.
Benefits of ASK Knative
|Open source Knative||ASK Knative|
|By default, Istio gateways are used. Therefore, you must pay for the infrastructure resources that are used to install Istio controllers.||You do not need to pay for the Knative controller.|
|You are charged for the infrastructure resources that are used to install the Knative controller.|
|A cold start occurs when you create a pod in an ASK cluster. Open source Knative uses the scale-to-zero mechanism to reduce costs. However, during the cold start, the cluster may fail to process requests due to session timeout.||ASK Knative does not scale the number of instances to zero during off-peak hours. Instead, ASK uses reserved instances. Reserved instances can be used to avoid cold starts at low costs. For more information about reserved instances, see Reserved instances.|
Resource management in Knative
- You can use Knative to manage applications in ASK clusters.
- Knative automatically requests pod resources from ASK clusters.
The Knative Serving controller is integrated with ASK. To use cloud resources by calling Knative API operations, you need only to create an ASK cluster and enable Knative for the cluster. You are not charged for the Knative controller.
By default, open source Knative provides multiple Ingress gateway solutions, such as Istio, Gloo, Contour, Kourier, and Ambassador. Among these solutions, Istio is most frequently used. This is because Istio also functions as a service mesh. Each ASK cluster must contain at least two resident gateway instances. The two instances provide backup for each other to ensure high availability. The gateway controllers must be resident. You must pay infrastructure and O&M fees for these resident resources.
To improve user experience, Alibaba Cloud allows you to use Application Load Balancer (ALB) instances as Knative Ingress gateways. Knative Gateway provides gateway capabilities required by ASK clusters and is as stable and reliable as cloud services. Resident resources are not required. This reduces infrastructure costs and O&M workloads.
By default, open source Knative scales the number of instances to zero during off-peak hours. This leads to a cold start the next time when the system starts the application. During a cold start, the system must allocate infrastructure resources, schedule pods, and pull the application image. A cold start also involves the startup time of the application. The size of the application image and the application startup time are based on the developer or service.
- ASK Knative uses burstable instances to replace compute optimized instances during off-peak hours. When requests are received, ASK switches back to compute optimized instances. This mechanism reduces costs during off-peak hours.
- CPU credits that are accumulated during off-peak hours can be used during peak hours to reduce costs.
For more information about reserved instances, see Reserved instances.
Deploy Knative components in a Kubernetes cluster
- If the version of your ASK cluster is 1.16 or later, you can deploy Knative in the Container Service for Kubernetes (ACK) console. For more information, see Enable Knative.
- Make sure that the version of the cluster is 1.16 or later.
If you use ASK Knative, you are charged only for cloud resources that are used to manage your ASK cluster. The cloud resources include elastic container instances, SLB instances, and NAT gateways. These resources are charged based on corresponding billing rules. For more information, see Billing.