background Alibaba Cloud Serverless Kubernetes (ASK) is a serverless Kubernetes container service launched by Alibaba Cloud. It is based on ECI (Elastic Container Instance) and allows you to directly create secure and isolated container applications without purchasing ECS nodes. ASK has passed the Kubernetes consistency test and provides you with a fully compatible experience with community Kubernetes. Knative is an open source Serverless application orchestration framework based on Kubernetes. Its goal is to develop cloud-native, cross-platform Serverless application orchestration standards. Alibaba Cloud Knative is based on ASK. While being fully compatible with the community Knaitve, it provides unified application orchestration for FC and ECI workloads, supports event-driven, automatic elasticity, and provides you with a unified Serverless application programming model. Architecture Next, we will introduce it through a bullet screen service demo. The demo mainly includes three parts: HomePage, event drive, and message processing. HomePage is mainly used to send and receive bullet comments. Event driving is used to receive events and filter and transfer them. Message processing is used to process bullet comment messages. HomePage and message processing are deployed to FC and ECI respectively through Knative Serving, and event driving is deployed to ECI through Knative Eventing. The main process of the barrage service demo is shown in the figure. The user sends a barrage message to the HomePage through the front end. The HomePage then sends the barrage to Kafka. The event-driven system receives the barrage message and routes it to the message processing for processing. After the barrage is processed, the barrage result is sent to the table storage. Finally, the front end obtains the barrage result and displays it on the page. Next, we start to deploy the barrage service demo. The operations include the following: First deploy message processing, then deploy event-driven, then deploy HomePage, and after deployment is complete, access the bullet screen service Step 1: Deploy message processing This service is used to receive event-driven bullet message requests, automatically scale up and down based on the number of requests, and send the results to Table Storage after the bullet message processing is completed. Before deployment, we first confirm that there is no workload so that we can observe the results after deployment. Select ask Cluster In the left navigation bar of the cluster management page, select Workload > Stateless . Select the default namespace and confirm that there is currently no workload. Next, we deploy the bullet message processing to the ECI workload through Knative. Here we deploy it through YAML. The YAML content is as follows:
Main parameter description: minScale and maxScale: Indicates the minimum and maximum number of Pods configured for the service In the left navigation bar of the cluster management page, select Applications > Knative . Step 2: Deploy event-driven Event-driven is used to receive events and filter and transfer event streams. Here we use Kafka event source as event-driven to receive bullet message from Kafka and then route the bullet message to message processing. We deploy it in yaml mode. The yaml content is as follows: Step 3: Deploy HomePage This service is used to receive front-end bullet message, send bullet message to Kafka, and receive bullet results from table storage. After deployment through Knative function mode, services, functions, and custom domain names will be automatically created in FC. Before operation, we first confirm that there is no bullet service, function, or custom domain name in FC. Log in to the FC console and select Region (Shanghai) from the top menu bar. Open the service and function page and confirm that there is no bullet message service and function In the left navigation bar, click Custom Domain Name and confirm that there is no domain name information. Open the custom domain name page and confirm that there is no custom domain name Next, we deploy HomePage to the FC workload through Knative. Here we deploy it through yaml. The yaml content is as follows:
Main parameter description: The fc-related parameter configuration includes: deploying fc-type workloads, deploying through images, and specifying the access domain name as barrage.demo.knative.top Log in to the Container Service management console. Log in to the Function Compute console. Step 4: Service Access The above services have been deployed. Next, we will access the services through a custom domain name. http://barrage.demo.knative.top Next, we send the bullet message. Here you can customize the bullet message to be sent, the number of concurrent messages, and the duration. Here we use the default configuration to send. Set the message, concurrency and duration, and click [Send] We can see that barrage messages are constantly displayed. summary Alibaba Cloud Knative provides a unified programming model for containers and functions on top of Serverless Kubernetes, bringing you a unified Serverless application programming model. Interested students are welcome to communicate with us. |
<<: The basic concepts of Kafka producers, consumers, and brokers
Highways will be congested, and the Internet, the...
All packages in BuyVM's Las Vegas data center...
[51CTO.com original article] On May 18-19, 2018, ...
OneTechCloud has launched a Spring Festival promo...
Nowadays, few people send text messages except fo...
If you ask what is the biggest feature of Interne...
Everyone wants to be the first to experience the ...
What is NAT? NAT is the abbreviation of Net Addre...
[[417538]] 2021 is the third year of 5G commercia...
Recently, the three major operators have successi...
Regardless of whether people are pessimistic or o...
[51CTO.com original article] The boss said that d...
[51CTO.com Quick Translation] It’s a new year aga...
SmartHost recently offered special discount codes...