Serverless X OpenKruise deployment efficiency optimization method

1.png

Source | Serverless
Official Account Author | Xu Chengming (Jing Xiao)

Serverless, as the best practice of cloud computing, the direction of cloud native development, and the future evolution trend, its core value lies in fast delivery, intelligent flexibility, and lower cost. SAE (Serverless Application Engine), as the first application-oriented Serverless PaaS platform, realizes the perfect combination of serverless architecture and microservice architecture, so that existing applications can also be modified with zero code to enjoy the technical bonus given by Serverless. It is currently enhancing its multilingual features. Evolve towards multiple load types and diversified scenarios. As a serverless platform, efficient application deployment efficiency is undoubtedly the core competitiveness of the product, and it is also the basis for elastic scaling and intelligent hosting. Faster deployment efficiency means better user experience, lower user costs, and greater flexibility. SAE's extreme flexibility project strives to improve the end-to-end startup speed of applications, and guarantees users' rapid expansion efficiency and system stability SLA in unexpected scenarios.

Serverless application engine:https://www.aliyun.com/product/aliware/product/sae

Background of the project

SAE uses the Kubernetes architecture at the bottom layer, using two resource pools, namely, Shenlong bare metal security containers and ECI. The applications that users run in SAE will be mapped to the corresponding resources in Kubernetes.

Through the collection of all online K8s events, the entire Pod creation life cycle is time-consuming statistical analysis by nodes and stages. Taking the Shenlong node as an example, the ratio of each stage is shown in the figure:

2.png

As can be seen from the figure, the entire pod creation life cycle includes scheduling, pulling and creating init containers, pulling user business images, and creating and starting containers. The time consuming is mainly focused on scheduling and pulling user images. The reason is that the overall time-consuming of the SAE Dragon node scheduling link is long, and the time-consuming mirroring mainly lies in the length of time to pull the mirror and decompress the mirror, especially in the case of large-capacity mirror deployment.

implementation plan

The SAE team conducts program research and analysis in terms of long-term architecture planning and usage scenario versatility, and considers using in-situ upgrade deployment strategies instead of reconstruction upgrade strategies to avoid re-scheduling during deployment and reduce overall time-consuming.

The so-called in-situ upgrade means that only one or more container versions in the Pod are updated without affecting the upgrade of the entire Pod object or other containers, and the ip and node are guaranteed not to change during the upgrade process. Within Alibaba, most e-commerce applications are released in a cloud-native environment using in-situ upgrades. This in-situ upgrade mode greatly improves the efficiency of application release, saving scheduling, network distribution, and hanging Time-consuming to load disks and pull images. By analyzing the historical deployment records of online SAE users, it is found that the majority of applications that only update the image/package deployment, mean that the in-situ upgrade capability is very suitable for landing in SAE products.

3.png

The advantages of in-situ upgrade to SAE are:

  • Avoid rescheduling and avoid sidecar container rebuilding. The entire deployment is time-consuming and only needs to pull and create business containers;
  • No scheduling is required, and new images can be cached on Node in advance to improve elastic efficiency;
  • The ip can be kept unchanged to avoid the delay of dependent components such as the registry perception caused by ip changes;
  • Reduce the pressure on the scheduler, registry, and upstream and downstream businesses of pod reconstruction.

At the same time, the OpenKruise project has contributed in-situ upgrade capabilities to open source through CloneSet / AdvanceStatefulSet. CloneSet is one of the core workloads provided in OpenKruise. It is mainly for stateless applications. It provides more efficient, deterministic and controllable application management and deployment capabilities. It supports elegant in-place upgrades, designated deletions, configurable release order, and parallel/grey Rich strategies such as degree release can meet more diverse application scenarios. The function comparison between CloneSet and native Kubernetes workload is shown in the figure:

4.png

OpenKruise project:https://openkruise.io/

SAE decided to adopt CloneSet as a new application load. On the one hand, it uses its ability to upgrade in-situ to improve the overall deployment efficiency of the application. On the other hand, it also combines the power of OpenKruise to create a common standard stateless application load on a large scale. For incremental applications, SAE will use CloneSet to deploy user applications by default, and combine the maximum number of unavailable instances and elegant upgrade duration to ensure that the published traffic is not lost. For existing applications, SAE will use a rolling upgrade based on a finite state machine Perform online migration operations.

After the solution went live, the effect was significant. Within one month, nearly a thousand applications have been deployed using CloneSet, and the number of in-situ upgrades is twice that of rebuilding upgrades. The deployment efficiency is 42% higher than that of native K8s. Combined with mirrored cache, users Deploying the application to the container startup is completed within seconds. SAE will later productize more of OpenKruise's advanced capabilities, and combine user scenarios to continuously polish stability and best practices to feed back to open source.

5.png

Figure: Native K8s deployment application reconstruction upgrade strategy VS SAE deployment application native upgrade strategy

Future outlook

In the pursuit of deployment efficiency, SAE is exploring more dimensional and fine-grained solutions. I believe that in the near future, SAE's extreme flexibility will shine in terms of flexibility efficiency, flexibility scale, or intelligence and precision.

Guess you like

Origin blog.51cto.com/14902238/2561755