By Xining Wang
Use ASM to Manage Knative Services (1): An Overview of Knative on ASM
Use ASM to Manage Knative Services (2): Use Knative on ASM to Deploy Serverless Applications
Use ASM to Manage Knative Services (3): Use Custom Domain in Knative on ASM
Use ASM to Manage Knative Services (4): Use ASM Gateway to Access Knative Services over HTTPS
Use ASM to Manage Knative Services (6): Auto Scaling Based on the Number of Traffic Requests
Knative on ASM has the traffic-based canary release capability. When you create a Knative service, Knative will automatically create the first revision for the service. When the configuration of the Knative service changes, a new revision of the Knative service will be created. You can modify the distribution ratio of traffic sent to different revisions to implement the canary release feature. This article describes how to release services based on traffic canary in Knative on ASM.
1. Log on to the ACK console
2. On the left-side navigation pane of the ACK console, click Clusters
3. On the Clusters page, find the cluster you want to manage and click its name or click Details in the Action Bar
4. On the left-side navigation pane, choose Applications > Knative
5. Create a revision. On the Services tab, select the Service name you want to manage and click Details in the Action Bar
6. On this page, click Create Revision in the upper-right corner
7. On the Basic Information configuration wizard step, click Advanced Settings to set the environment variables of the latest revision. The name is TARGET, and the variable value is Knative on ASM.
8. Click Next. In the Traffic Settings configuration wizard step, set the traffic ratio of the latest revision to 0 and click Create.
Note: The sum of traffic ratios of all revisions must be 100.
curl http://helloworld-go.default.example.com
Expected output:
Hello World!
As you can see, the traffic ratio is set to 0 for the latest version. This indicates that all requests to access the helloworld-go service are sent to the earlier version.
for i in `seq 20`; do curl http://helloworld-go.default.example.com; done;
Expected output:
Hello Knative on ASM!
Hello Knative on ASM!
Hello World!
Hello Knative on ASM!
Hello World!
Hello World!
Hello World!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello World!
Hello Knative on ASM!
Hello World!
Hello Knative on ASM!
Hello Knative on ASM!
Hello World!
Hello World!
The traffic ratios are set to 50% for both the earlier and new versions. This means requests to access the helloworld Service are evenly distributed to the earlier and new versions.
for i in `seq 20`; do curl http://helloworld-go.default.example.com; done;
Expected output:
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Hello Knative on ASM!
Use ASM to Manage Knative Services (4): Use the ASM Gateway to Access Knative Services over HTTPS
Use ASM to Manage Knative Services (6): Auto Scaling Based on the Number of Traffic Requests
56 posts | 8 followers
FollowXi Ning Wang(王夕宁) - August 7, 2023
Xi Ning Wang(王夕宁) - August 7, 2023
Xi Ning Wang(王夕宁) - August 7, 2023
Xi Ning Wang(王夕宁) - August 7, 2023
Xi Ning Wang(王夕宁) - August 7, 2023
Alibaba Cloud Native Community - April 9, 2024
56 posts | 8 followers
FollowAlibaba Cloud Service Mesh (ASM) is a fully managed service mesh platform that is compatible with Istio.
Learn MoreAlibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.
Learn MoreAlibaba Cloud Container Service for Kubernetes is a fully managed cloud container management service that supports native Kubernetes and integrates with other Alibaba Cloud products.
Learn MoreA convenient and secure cloud-based Desktop-as-a-Service (DaaS) solution
Learn MoreMore Posts by Xi Ning Wang(王夕宁)