A method for elastic resource scheduling, a control device, an apparatus and a readable storage medium
The application-centric elastic resource scheduling method addresses inefficiencies in cluster-oriented delivery by customizing resource allocation to specific applications, improving cost control and resource utilization through targeted resource generation and distribution.
Patent Information
- Application Number
- CN202210122007.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-09
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-02-09
AI Technical Summary
The existing cluster-oriented elastic resource delivery method fails to distinguish between different types of elastic resources, leading to inefficient and costly scheduling due to significant price variations, resulting in suboptimal cost control and resource utilization.
An application-centric elastic resource scheduling method that issues resource application requests based on customized policies, generating and scheduling elastic resources tailored to specific application needs, thereby avoiding brain splits and inconsistent states.
This approach enhances the accuracy and efficiency of resource supply, optimizes delivery costs, and improves the diversity of resource utilization by directly targeting application requirements without secondary scheduling processes.
Smart Images

Figure CN114610480B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to an elastic resource scheduling method, control equipment, device and readable storage medium. Background Art
[0002] The current delivery method of elastic resources is cluster-oriented. The delivery process is that some applications in the current cluster fail to schedule, which triggers the application of elastic resources, delivers them to the cluster, and then uses the elastic resources again through scheduling. This is the current traditional delivery method of elastic resources.
[0003] When applications use elastic resources, because the delivery of elastic resources is cluster-oriented, the current scheduling method does not distinguish between the types of elastic resources provided and schedules services in a homogeneous manner. In actual use, the delivery cost cannot be finely controlled due to the huge price differences between different types of elastic resources. Summary of the invention
[0004] The problem that this application solves is that the existing cluster-oriented elastic resource delivery method cannot finely control the delivery cost.
[0005] To solve the above problems, the first aspect of the present application provides a flexible resource scheduling method, including:
[0006] In response to a creation request of an application, issuing a resource application request according to a resource delivery policy customized by the application, wherein the resource delivery policy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups;
[0007] In response to the resource application request, elastic resources associated with the plurality of container groups of the application are generated and the container groups are scheduled to the corresponding elastic resources.
[0008] A second aspect of the present application provides a control device, which includes: a memory and a processor;
[0009] The memory is used to store programs;
[0010] The processor, coupled to the memory, is configured to execute the program to:
[0011] In response to a creation request of an application, issuing a resource application request according to a resource delivery policy customized by the application, wherein the resource delivery policy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups;
[0012] In response to the resource application request, elastic resources associated with the plurality of container groups of the application are generated and the container groups are scheduled to the corresponding elastic resources.
[0013] A third aspect of the present application provides a flexible resource scheduling device, which includes:
[0014] A resource scheduling module, which is used to respond to a creation request of an application and issue a resource application request according to a resource delivery strategy customized by the application, wherein the resource delivery strategy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups;
[0015] The resource adaptation module is used to generate elastic resources associated with the multiple container groups of the application in response to the resource application request and schedule the container groups to the corresponding elastic resources.
[0016] A fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement the elastic resource scheduling method described above.
[0017] In this application, the application is the center, and the elastic resources of the corresponding resource types are produced for the application according to the resource delivery strategy, so as to finely control the delivery cost. Compared with the cluster-centric elastic resource supply method, there are obvious improvements in the accuracy of elastic resource supply, the efficiency of application distribution, and the diversity of elastic resource supply.
[0018] This application uses the scheduler as the only global decision-making unit to avoid brain splits or inconsistent states. It is application-centric and perceives different elastic resources based on the configured resource delivery strategy to perform refined orchestration and scheduling. When the application is scaled down, refined scaling-down decisions are made based on the elastic resource consumption strategy.
[0019] This application is an application-centric elastic resource delivery method that produces elastic resources for applications through the decision results of the scheduler, and then directly completes application distribution based on the elastic resources produced in a targeted manner by skipping the secondary scheduling process. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of a flexible resource scheduling method according to an embodiment of the present application;
[0021] Figure 2 An example of a resource delivery strategy customized for this application;
[0022] Figure 3 Specific examples of resource delivery strategies for the prefer category;
[0023] Figure 4 A specific example of a resource delivery strategy for the required category;
[0024] Figure 5is a flow chart of a flexible resource scheduling method according to another embodiment of the present application;
[0025] Figure 6 is a flow chart of a flexible resource scheduling method according to another embodiment of the present application;
[0026] Figure 7 is a flow chart of a flexible resource scheduling method according to another embodiment of the present application;
[0027] Figure 8 An example of the architecture of a Kubernetes cluster according to the present application;
[0028] Fig. 9 is a structural block diagram of a flexible resource scheduling device according to an embodiment of the present application;
[0029] Fig.10 4 is a structural block diagram of a control device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0031] The current delivery method of elastic resources is cluster-oriented, which has the following problems:
[0032] When applications use elastic resources, because the delivery of elastic resources is cluster-oriented, the current scheduling method does not distinguish between the types of elastic resources provided, and schedules services in a homogeneous manner. At the same time, when reclaiming resources, the actual resource type is not perceived. However, in actual situations, the prices of different types of elastic resources vary greatly, and more refined scheduling and orchestration strategies are needed to achieve good optimization in terms of cost, delivery efficiency, and service availability.
[0033] The production process of elastic resources is cluster-oriented. Although there are simple logical calculations in the production process, in complex scheduling scenarios, due to the split between elastic resource simulation scheduling and central scheduling, the produced elastic resources cannot meet the actual needs of the application.
[0034] The production of elastic resources is not application-centric. Therefore, after the production of elastic resources, the application needs to be re-scheduled to use the elastic resources. In the case of a large number of scheduling requests such as offline computing, repeated scheduling will affect the startup efficiency and cause task accumulation.
[0035] During the elastic resource recycling process, a simulated scheduling process is used to determine whether the container group that is evicted after resource recycling can run in the existing cluster. However, there are splits between elastic resource simulation scheduling and central scheduling, and inconsistent cluster status delays. As a result, scheduling cannot be performed after recycling, and elastic resource production must be performed again.
[0036] In response to the above problems, this application provides a solution to perform elastic resource scheduling with application as the center, which not only avoids the split of elastic resource simulation scheduling and central scheduling, but also skips the secondary scheduling process, and can distinguish the supply types of elastic resources and perceive resource types.
[0037] For ease of understanding, the following terms that may be used are explained here:
[0038] Annual and monthly subscription: a billing method for flexible resources that requires you to pay first and then use them. With annual and monthly subscription, you can reserve resources in advance and enjoy greater price discounts, helping you save more money.
[0039] Pay-as-you-go: A billing method for elastic resources where you pay for the resources you use first. With pay-as-you-go, you can activate and release resources on demand.
[0040] Preemptible instance: An instance that uses elastic resources on demand, with a certain discount compared to the pay-as-you-go instance price. After successfully creating a preemptible instance, you can use it stably during the protection period. After that, when the market price is higher than your bid or the instance specification inventory is insufficient, the instance will be automatically released.
[0041] Kubernetes: An open source platform for managing containerized applications on multiple hosts in a cloud platform.
[0042] Containerization: The process of integrating applications into containers and running them is called "containerization"; once the application is containerized (for example, the application is packaged as a Docker image), it can be delivered in the form of an image and run as a container.
[0043] Pod: The smallest running unit of an application in a Kubernetes cluster.
[0044] ECS: Elastic Compute Service, an IaaS (Infrastructure as a Service)-level cloud computing service provided by Alibaba Cloud.
[0045] ECI: Elastic Container Instance is Alibaba Cloud's cloud computing infrastructure and a serverless cloud computing service of the same level as ECS.
[0046] Openstack: An open source project that aims to provide software for building and managing public and private clouds, a cloud platform management project.
[0047] Mesos: It is an open source distributed resource management framework under Apache, which is called the kernel of the distributed system.
[0048] Mesos container: It uses some features of the operating system itself, such as cgroup and namespace, to isolate containers. It is a containerization technology supported by Mesos.
[0049] The embodiment of the present application provides a flexible resource scheduling method, which can be performed by a flexible resource scheduling device, and the flexible resource scheduling device can be integrated in electronic devices such as computers, servers, computers, server clusters, and data centers. Figure 1 As shown, it is a flow chart of a flexible resource scheduling method according to an embodiment of the present application; wherein the flexible resource scheduling method includes:
[0050] S100, in response to a creation request of an application, issuing a resource application request according to a resource delivery policy customized by the application, wherein the resource delivery policy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups;
[0051] S200 , in response to the resource application request, generating elastic resources associated with a plurality of container groups of the application and scheduling the container groups to corresponding elastic resources.
[0052] In this embodiment, the application creation request can be triggered by the customer. For example, the customer clicks the create button on the operation screen, which is deemed that the customer has made a request to create the application. The application creation request can also be generated by the customer hosting system when the application needs to be created. The application creation request can also be triggered by other methods. The specific triggering method is not limited in this embodiment.
[0053] In this way, with the application as the center, elastic resources of corresponding resource types are produced for the application according to the resource delivery strategy, so as to finely control the delivery cost.
[0054] Compared with the cluster-centric elastic resource supply method, there are obvious improvements in the accuracy of elastic resource supply, the efficiency of application distribution, and the diversity of elastic resource supply.
[0055] In this application, the elastic resource scheduling method can be applied to the Kubernetes architecture, with Pod as the container group; it can also be applied to the Openstack architecture, with Openstack container as the container group; it can also be applied to the Mesos architecture, with Mesos container as the container group; it can also be applied to other architectures that meet the requirements. Since the specific process of the elastic resource scheduling method being applied to the Kubernetes architecture, the Openstack architecture, or the Mesos architecture is similar, in this application, for ease of understanding, the specific process of the elastic resource scheduling method is described based on the Kubernetes architecture.
[0056] It should be emphasized that although the explanation is based on the Kubernetes architecture, technical personnel in this field should understand that the process based on the Kubernetes architecture can be transplanted to the Kubernetes architecture, Openstack architecture, Mesos architecture or other similar architectures without affecting the final effect.
[0057] In this embodiment, the application creation request includes the total number of Pods associated with the application; the application-defined resource delivery policy includes the resource type and priority order of the Pods associated with the application.
[0058] For example, Figure 2As shown in the figure, it is an example of a resource delivery strategy customized by an application, where selector is used to identify the application Pod related to it, that is, the name of the application; strategy is used to identify the type of the resource delivery strategy, and there are two options: prefer and required. The category prefer means that when performing elastic resource scheduling, the elastic resources of the first subset type are satisfied as much as possible. If the elastic resources of the first subset type are not satisfied, the elastic resources of the second subset type are scheduled, and so on. That is, there are optimal options and selection ranges that include the optimal options. As long as they are within the selection range, the scheduling is successful, and the optimal option can be approached or reached through subsequent optimization; the category required means that the conditions of each type of scheduling resource must be met. The Pod can only be scheduled if the resource is specified in the order specified by the Pods. Otherwise, the scheduling fails. subsets is used to identify the ordered list of subsets and describe the corresponding resource supply (the order of each subset in subsets is the priority order. From front to back, the priority gradually decreases, and the Pods of the same subset have the same priority). name is used to identify the name of the subset. replica is used to schedule the corresponding required number under the corresponding resource requirements. It is only valid when strategy is set to required. type is used to identify the resource type (the resource type is the resource type of the associated Pod). The default is ECS resources, and ECI resources can be filled in. labelSelector is used to index the corresponding ECS node. It is not effective under ECI. In this example, to simplify the expression, only one subset in the subsets list is listed. In the specific example, due to the different restrictions of the categories prefer and required, the specific expressions will be different.
[0059] like Figure 3As shown, it is the specific part of the resource delivery strategy of the prefer category. It can be seen that three types of elastic resource rankings are given, namely, ESC elastic resources for annual and monthly packages, ESC elastic resources for pay-as-you-go packages, and ESC elastic resources for preemptible instances. When the number of Pods associated with the application is given in the creation request, the resource delivery strategy of the prefer category is to schedule all the Pods to the ESC elastic resources for annual and monthly packages as the optimal option. If the ESC elastic resources for annual and monthly packages are insufficient, the remaining Pods can be scheduled to the ESC elastic resources for pay-as-you-go packages. If the ESC elastic resources for pay-as-you-go packages are not enough to cover the remaining Pods, the remaining Pods after the ESC elastic resources for pay-as-you-go packages are scheduled are scheduled to the ESC elastic resources for preemptible instances, and the scheduling is successful. Among them, the priorities of the Pods associated with the ESC elastic resources for annual and monthly packages, the ESC elastic resources for pay-as-you-go packages, and the ESC elastic resources for preemptible instances are reduced in turn.
[0060] like Figure 4 As shown in the figure, it is the specific part of the resource delivery strategy of the required category. It can be seen that two types of elastic resource rankings and the number of elastic resources of each type are given, namely, 5 ESC elastic resources for common instances and 5 ESC elastic resources for preemptible instances. When the number of Pods associated with the application has been given in the creation request, the resource delivery strategy of the required category is to schedule 5 Pods to the ESC elastic resources of common instances, and to schedule 5 Pods to the ESC elastic resources of preemptible instances, which means the scheduling is successful. If the ESC elastic resources of common instances or the ESC elastic resources of preemptible instances do not reach the predetermined number, the scheduling fails. Among them, the priorities of the Pods associated with the ESC elastic resources of common instances and the ESC elastic resources of preemptible instances decrease in turn.
[0061] It should be noted that the elastic resources in the above resource delivery strategy can include both ESC elastic resources and ECI elastic resources for mixed scheduling, and the specific examples will not be repeated here.
[0062] In one implementation, issuing a resource application request according to an application-defined resource delivery strategy includes:
[0063] According to the resource delivery strategy customized by the application, a fixed node resource is selected and the container group is scheduled to the corresponding fixed node resource, and a resource application request is issued based on the remaining container groups in the resource delivery strategy.
[0064] Specifically, the elastic resources include fixed node resources and elastic node resources. A target customer can set up one or more Kubernetes clusters (container clusters). After a Kubernetes cluster is created, multiple nodes will be allocated based on the customer's settings or selections. Among these nodes, some nodes can only be used by the Kubernetes cluster when they are allocated to the Kubernetes cluster, and will not be recycled even if they are idle. The resources of these nodes are fixed node resources. Another part of the nodes will produce elastic resources for scheduling when needed, and will be recycled when not needed. The resources of these nodes are elastic node resources.
[0065] For the billing methods of annual and monthly subscriptions, pay-as-you-go, and preemptible instances, the description of this billing method is only an explanation based on the existing billing methods and is not a limitation.
[0066] The stability of the billing methods, such as subscription, pay-as-you-go, and preemptible instances, varies. Therefore, in general, most nodes associated with the subscription billing methods are fixed node resources, and a small number of nodes are elastic node resources. A small number of nodes associated with the pay-as-you-go and preemptible instance billing methods are fixed node resources, and most of the nodes are elastic node resources. The specific associated node types are subject to customer customization or Kubernetes cluster configuration.
[0067] The elastic resources described below, unless otherwise noted, all represent elastic node resources. The elastic resources in step S200 and its sub-steps all represent elastic node resources.
[0068] In this embodiment, the node can be a virtual machine or a physical machine, depending on the Kubernetes cluster configuration. In the case of multiple nodes, the multiple nodes can be centrally deployed on the same physical device or virtual machine, or can be dispersedly deployed on multiple physical devices or virtual machines. This embodiment does not limit the dispersed deployment of multiple nodes in the same cluster on multiple physical devices or virtual machines.
[0069] In this embodiment, nodes with the same configuration can form a node pool, which is a group of nodes with the same configuration in the cluster. The node pool can contain one or more nodes. The number of nodes and configuration specified when creating a Kubernetes cluster will become the default node pool, and other node pools of different sizes and types can be added to the cluster.
[0070] Specifically, under normal circumstances, the nodes in a node pool all have the following common properties: node operating system and version, container runtime type and version, billing method, node specifications, etc. Through the node pool, different types of nodes can be deployed and managed in the same cluster. In the same cluster, you can create node pools with different operating systems (CentOS, Windows, AliyunLinux); you can create node pools with different container runtimes (security sandbox, Docker); you can create node pools with different billing types (pay-as-you-go, annual and monthly subscriptions, preemptible instances); you can create multiple node pools with automatic elastic scaling turned on.
[0071] For example, in the ECS common resource pool of the fixed node of the above Kubernetes cluster, you can set up annual and monthly node pools, pay-as-you-go node pools, and preemptible instance node pools; in the ECS elastic resource pool of the elastic node, you can set up annual and monthly node pools, pay-as-you-go node pools, and preemptible instance node pools; in the ECI elastic resource pool of the elastic node, you can set up common instance node pools, preemptible instance node pools, etc.
[0072] Specifically, the scheduler monitors the fixed node resources and generated elastic node resources of the Kubernetes cluster. After receiving the application creation request, it synchronously receives the application's customized resource delivery policy. If the resource type corresponding to its container group in the resource delivery policy has idle fixed node resources, the fixed node resources are selected and the container group is scheduled to the corresponding fixed node resources; and resource application requests are generated based on the remaining container groups.
[0073] The embodiment of the present application provides another elastic resource scheduling method, which is similar to the elastic resource scheduling method described above, except that: Figure 5 As shown, the S200, in response to the resource application request, generates elastic resources associated with multiple container groups of the application and schedules the container groups to the corresponding elastic resources, including:
[0074] S201, producing the elastic resource and returning the association relationship between the produced elastic resource and the container group;
[0075] S202: In response to the returned association relationship, schedule each container group of the application to the associated elastic resource.
[0076] Specifically, the resource application request includes multiple container groups that the application needs to schedule and the resource type of the elastic resources that each container group needs to deliver; according to the resource application request, elastic resources associated with the container groups are produced one by one, and the association relationship is returned; the scheduler can directly schedule the container group to the associated elastic resource based on the association relationship.
[0077] The current elastic resource scheduling process requires two scheduling operations. The existing container cluster generally contains about 2,000 nodes. During scheduling, the number of Pods to be scheduled per unit time is generally about 10,000. Scheduling a single container cluster once requires a relatively long scheduling time (assuming the scheduling speed is determined).
[0078] Through resource application requests, elastic resources are produced for applications in a targeted manner, and then based on the targeted elastic resources, the application distribution is completed directly without the secondary scheduling process, which can double the efficiency of the entire scheduling process.
[0079] When the controller in the Kubernetes architecture parses the name of the created application, it adds a random code after each Pod of the application, so that the Pods of the application can be distinguished; based on the random code, each Pod is identified and a connection relationship between the production elastic node resources and the Pod is established.
[0080] In this application, the elastic resources (elastic node resources) include ECS elastic resources and ECI elastic resources.
[0081] In one implementation, the elastic resources (elastic node resources) may also include elastic resources in other forms besides ECS elastic resources and ECI elastic resources. The form and type of specific elastic resources are not limited here.
[0082] Specifically, in ECS elastic resources, each elastic node can produce elastic node resources associated with one or more Pods according to different specifications and types, that is, it can deploy or schedule one or more Pods.
[0083] For example, if the capacity of the first elastic node is 4C8G (ie, 4 central processing units (CPUs) and 8G memory), and the specification of the Pod is 2C4G, then the first elastic node can deploy two Pods.
[0084] In one implementation, the production and release of elastic resources are performed in units of nodes, wherein the specific process of the production and release of elastic resources is not described in detail here.
[0085] For example, based on the first elastic node mentioned above, if only one elastic node resource associated with a Pod needs to be produced, all elastic resources of the first elastic node need to be produced, but only one Pod needs to be deployed / associated.
[0086] Specifically, in the ECI elastic resource, the elastic node and ECI are integrated, that is, each elastic node manages only one Pod.
[0087] The embodiment of the present application provides another elastic resource scheduling method, which is similar to the elastic resource scheduling method described above, except that: Figure 1 As shown, the resource delivery strategy is an optimizable delivery strategy or a fixed delivery strategy.
[0088] The method further comprises:
[0089] S300: When it is determined that there is optimization space for the elastic resource orchestration strategy in the cluster including the application, the application for which the delivery strategy can be optimized in the cluster is rescheduled.
[0090] Based on the above example, the optimizable delivery strategy is the prefer category, which has the optimal option and a selection range that includes the optimal option. As long as it is within the selection range, the scheduling is successful; the fixed delivery strategy is the required category, and the conditions of various types of scheduling resources must be met for the scheduling to be successful, otherwise the scheduling fails.
[0091] When the application is running normally, it will be rescheduled based on the application's customized resource delivery strategy and dynamically adjust the node where the Pod is located to achieve better optimization in terms of cost, delivery efficiency, and service availability.
[0092] In one embodiment, Figure 6 As shown, the determining of the optimization space of the elastic resource orchestration strategy in the cluster containing the application includes:
[0093] S301, after completing at least one elastic resource scheduling that can optimize the delivery strategy, regularly monitoring the resource pool of fixed node resources in the cluster;
[0094] S302: When it is monitored that the resource pool of fixed node resources is idle, determine that there is optimization space for the elastic resource orchestration strategy in the cluster.
[0095] If the resource pool of the fixed node resources becomes idle, the Pod deployed on at least one elastic node resource can be redeployed to the fixed node resource, thereby achieving the purpose of optimizing the elastic resource orchestration strategy of the entire cluster.
[0096] Specifically, the regular monitoring can be monitoring the resource pool of fixed node resources at a set time interval, or monitoring at a preset time interval, or a combination of the above two limitations, monitoring at a preset interval at a set time interval. For example, monitoring is performed at 10:00-12:00 every night, or every half an hour, or every half an hour between 10:00-12:00 every night.
[0097] In one implementation, after the fixed node resources are released, monitoring of the resource pool of the fixed node resources in the cluster is started.
[0098] In one embodiment, Figure 7 As shown, the rescheduling of the application of the optimized delivery strategy in the cluster includes:
[0099] S303: According to the optimizable delivery strategy in the cluster, optimize and adjust the association relationship between the container group of the application and the elastic resource and issue an adjustment request for the container group to be adjusted;
[0100] S304: In response to the adjustment request, reserve resources for the container group to be adjusted;
[0101] S305: After the resource reservation is successful, dynamically adjust the container group to be adjusted.
[0102] When a better elastic resource orchestration strategy appears in the cluster, the node where the Pod is located is dynamically adjusted based on the rescheduling method. During the adjustment, the reserved resources of the central scheduling are required. Dynamic adjustment is performed only after the resource reservation is successful, and the corresponding Pod is expelled. This avoids the situation where the Pod cannot be scheduled after the elastic resources are expelled to reclaim them, and the elastic resources have to be re-produced.
[0103] The embodiment of the present application provides another elastic resource scheduling method, which is similar to the elastic resource scheduling method described above, except that: Figure 1 As shown, the method also includes:
[0104] S400: In response to a scaling-down request of an application, scaling down the application according to the resource delivery policy of the application.
[0105] In this embodiment, the request to scale down the application can be triggered by the customer. For example, the customer clicks the scale down button on the operation screen, which is regarded as the customer making a request to scale down the application. The customer hosting system can also generate the request to scale down the application when the application needs to be scaled down. The request to scale down the application can also be triggered by other methods. The specific triggering method is not limited in this embodiment.
[0106] For example: some of the fixed node resources and elastic node resources purchased by the customer expire and are not renewed; after the expiration date, the customer clicks the scale-down button, or the cluster triggers a scale-down request.
[0107] In one embodiment, the resource delivery policy includes a priority of a container group associated with the application;
[0108] The scaling down the application according to the resource delivery strategy of the application includes:
[0109] The shrinking quantity of the container group in the application is obtained, a container group that meets the shrinking quantity is selected from low to high priorities of the container groups, and elastic resources of the selected container group are released.
[0110] Specifically, the number of container groups to be shrunk in an application is pre-set by the customer or generated by the cluster. When a portion of container groups with the same priority level need to be shrunk, the container group that needs to be shrunk is determined based on other policies or is randomly determined.
[0111] For example, an application contains 20 Pods, of which 10 Pods are ESC elastic resources with annual or monthly subscriptions, 5 Pods are ESC elastic resources with pay-as-you-go subscriptions, and 5 Pods are ESC elastic resources with preemptible instances; their priorities are reduced in sequence. If 5 Pods need to be scaled down when scaling down the application, the 5 Pods with ESC elastic resources of type preemptible instances will be released; if 7 Pods need to be scaled down when scaling down the application, the 5 Pods with ESC elastic resources of type preemptible instances will be released, and two Pods with ESC elastic resources of type pay-as-you-go subscriptions will be selected for release.
[0112] When scaling down an application, the controller strictly controls the scaling-down order by applying a customized resource delivery policy, thereby enabling more refined elastic resource scheduling for the application, with good optimization in terms of cost, delivery efficiency, and service availability.
[0113] In one implementation, when the cluster is idle, the Pod to be evicted is selected through the elastic resource consumption strategy, and resources are reserved in the decentralized scheduling through resource reservation. The Pod can be evicted only after success, so as to avoid the situation that after the Pod is evicted and elastic resources are recovered, the Pod cannot be scheduled and elastic resources have to be re-produced.
[0114] Specifically, cluster idleness occurs in the cluster, that is, in the fixed node resources or elastic node resources of the cluster, a single node can deploy multiple Pods, but not all Pods are deployed. For example, when reclaiming an elastic node, only some Pods in the elastic node are deleted, and cluster idleness occurs at this time. The recycling of elastic nodes must be based on nodes. Deleting only some Pods in an elastic node cannot release the node, and other Pods must be expelled before it can be released; cluster idleness may also occur in the cluster when rescheduling is performed. The rescheduling strategy adjusts some Pods in the node, but does not involve the remaining Pods of the node, resulting in cluster idleness.
[0115] Specifically, the elastic resource consumption policy is used to select the Pod to be evicted, that is, to determine which nodes the other Pods of the node will be adjusted to. The Pod to be evicted can also be selected based on other policies, such as determining whether there is a node in the cluster that does not deploy all the Pods required. If so, the Pod will be scheduled to the required node.
[0116] like Figure 8 As shown, this is an example of the architecture of a Kubernetes cluster:
[0117] The architecture of a Kubernetes cluster includes a control layer consisting of the Kubernetes API server and controller, a scheduling layer consisting of the scheduler, a shim layer consisting of ESS, Cloud Autoscaler, Virtual Kubelet, and XX-shim (identifying possible shim tools), a resource supply layer consisting of the ESC common resource pool, ESC elastic resource pool, ECI elastic resource pool, and XX resource pool, and a rescheduling layer.
[0118] During execution, the scheduler listens to the Pods to be scheduled, selects different types of fixed node resources for Pod scheduling based on the resource delivery strategy, and applies for elastic resources for the Pod-directed shim layer based on the resource delivery strategy. After the shim layer produces elastic resources, it returns the association between the Pod and the produced elastic resources to the scheduler, and the scheduler directly schedules the Pod to the corresponding produced elastic resources; the rescheduling layer is responsible for optimizing and adjusting according to the resource delivery strategy after the scheduler completes a scheduling. After the optimization adjustment is sent to the scheduler, the scheduler will make dynamic adjustments after successfully reserving resources; when the business is scaled down, it is scaled down based on the resource delivery strategy; when the shim layer allocates elastic nodes, it must reserve resources through the scheduler according to the situation and then evict other Pods on the node before the elastic node can be released.
[0119] This application uses the scheduler as the only global decision-making unit to avoid brain splits or inconsistent states. It is application-centric and perceives different elastic resources based on the configured resource delivery strategy to perform refined orchestration and scheduling. When the application is scaled down, refined scaling-down decisions are made based on the elastic resource consumption strategy.
[0120] This application is an application-centric elastic resource delivery method that produces elastic resources for applications through the decision results of the scheduler, and then directly completes application distribution based on the elastic resources produced in a targeted manner by skipping the secondary scheduling process.
[0121] When the application is expanded, this application perceives different types of elastic resources during the scheduling process, and completes elastic resource requests and scheduling decisions based on the application's customized resource delivery strategy. When the application is scaled down, the controller strictly controls the scaling order through the application's customized resource delivery strategy. When the application is running normally, rescheduling is performed based on the application's customized resource delivery strategy. In the above way, the application can have a more refined elastic resource usage strategy.
[0122] This application is based on the central scheduling resource reservation method. First, the central scheduling reserves resources, and then dynamically adjusts and consumes resources in a targeted manner to reduce the impact on the cluster during capacity reduction or dynamic adjustment.
[0123] When a better elastic resource orchestration strategy appears in the cluster, the node where the Pod is located is dynamically adjusted based on rescheduling. During the adjustment, the reserved resources of the central scheduler are required. Eviction can only be performed after the resource reservation is successful.
[0124] An embodiment of the present application provides an elastic resource scheduling device, which is used to execute the elastic resource scheduling method described in the above content of the present application. The elastic resource scheduling device is described in detail below.
[0125] like Fig. 9 As shown, the elastic resource scheduling device includes:
[0126] A resource scheduling module 101, which is used to respond to a creation request of an application and issue a resource application request according to a resource delivery strategy customized by the application, wherein the resource delivery strategy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups;
[0127] The resource adaptation module 102 is configured to generate elastic resources associated with the plurality of container groups of the application in response to the resource application request and schedule the container groups to the corresponding elastic resources.
[0128] In one embodiment, the elastic resources also include fixed node resources;
[0129] The resource scheduling module 101 is also used for:
[0130] According to the resource delivery strategy customized by the application, a fixed node resource is selected and the container group is scheduled to the corresponding fixed node resource, and a resource application request is issued based on the remaining container groups in the resource delivery strategy.
[0131] The resource adaptation module 102 is also used for:
[0132] Produce the elastic resource and return the association relationship between the produced elastic resource and the container group;
[0133] In response to the returned association relationship, each container group of the application is scheduled to the associated elastic resource.
[0134] In one embodiment, the resource delivery strategy is an optimizable delivery strategy or a fixed delivery strategy, and the device further includes:
[0135] The rescheduling module 103 is configured to reschedule applications in the cluster whose delivery strategies can be optimized when determining that optimization space for the elastic resource orchestration strategy appears in the cluster containing the application.
[0136] The rescheduling module 103 is also used for:
[0137] After completing at least one elastic resource scheduling that can optimize the delivery strategy, regularly monitor the resource pool of fixed node resources in the cluster; when it is monitored that the resource pool of fixed node resources is idle, determine the optimization space of the elastic resource orchestration strategy in the cluster.
[0138] The elastic resources include ECS elastic resources and ECI elastic resources.
[0139] The rescheduling module 103 is also used for:
[0140] According to the optimizable delivery strategy in the cluster, optimizing and adjusting the association relationship between the container group of the application and the elastic resource, and issuing an adjustment request for the container group to be adjusted;
[0141] In response to the adjustment request, reserving resources for the container group to be adjusted;
[0142] After the resource reservation is successful, the container group to be adjusted is dynamically adjusted.
[0143] In one embodiment, it further includes:
[0144] The application scaling-down module 104 is configured to scale down the application in response to a scaling-down request of the application according to the resource delivery policy of the application.
[0145] In one embodiment, the resource delivery policy includes a priority of a container group associated with the application;
[0146] The application scaling module 104 is further used for:
[0147] The shrinking quantity of the container group in the application is obtained, a container group that meets the shrinking quantity is selected from low to high priorities of the container groups, and elastic resources of the selected container group are released.
[0148] The elastic resource scheduling device provided in the above-mentioned embodiment of the present application and the elastic resource scheduling method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0149] The above describes the internal functions and structure of the elastic resource scheduling device. Fig.10 As shown, in practice, the elastic resource scheduling device can be implemented as a control device, including: a memory 301 and a processor 303.
[0150] The memory 301 may be configured to store programs.
[0151] In addition, the memory 301 may also be configured to store various other data to support operations on the control device. Examples of such data include instructions for any application or method operating on the control device, contact data, phone book data, messages, pictures, videos, etc.
[0152] The memory 301 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0153] The processor 303 is coupled to the memory 301 and is configured to execute a program in the memory 301 to:
[0154] In response to a creation request of an application, issuing a resource application request according to a resource delivery policy customized by the application, wherein the resource delivery policy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups;
[0155] In response to the resource application request, elastic resources associated with the plurality of container groups of the application are generated and the container groups are scheduled to the corresponding elastic resources.
[0156] In one implementation, the elastic resources further include fixed node resources; the processor 303 is specifically configured to:
[0157] According to the resource delivery strategy customized by the application, a fixed node resource is selected and the container group is scheduled to the corresponding fixed node resource, and a resource application request is issued based on the remaining container groups in the resource delivery strategy.
[0158] In one implementation, the processor 303 is specifically configured to:
[0159] Produce the elastic resource and return the association relationship between the produced elastic resource and the container group;
[0160] In response to the returned association relationship, each container group of the application is scheduled to the associated elastic resource.
[0161] In one implementation, the resource delivery strategy is an optimizable delivery strategy or a fixed delivery strategy, and the processor 303 is specifically configured to:
[0162] When it is determined that there is optimization space for the elastic resource orchestration strategy in the cluster containing the application, the application of the optimizable delivery strategy in the cluster is rescheduled.
[0163] In one implementation, the processor 303 is specifically configured to:
[0164] After completing at least one elastic resource scheduling that can optimize the delivery strategy, regularly monitor the resource pool of fixed node resources in the cluster; when it is monitored that the resource pool of fixed node resources is idle, determine the optimization space of the elastic resource orchestration strategy in the cluster.
[0165] In one implementation, the elastic resources include ECS elastic resources and ECI elastic resources.
[0166] In one implementation, the processor 303 is specifically configured to:
[0167] According to the optimizable delivery strategy in the cluster, optimizing and adjusting the association relationship between the container group of the application and the elastic resource, and issuing an adjustment request for the container group to be adjusted;
[0168] In response to the adjustment request, reserving resources for the container group to be adjusted;
[0169] After the resource reservation is successful, the container group to be adjusted is dynamically adjusted.
[0170] In one implementation, the processor 303 is specifically configured to:
[0171] In response to a scaling-down request of an application, scaling down the application according to the resource delivery policy of the application.
[0172] In one implementation, the resource delivery strategy includes the priority of the container group associated with the application; the processor 303 is specifically configured to:
[0173] The shrinking quantity of the container group in the application is obtained, a container group that meets the shrinking quantity is selected from low to high priorities of the container groups, and elastic resources of the selected container group are released.
[0174] In this application, Fig.10 Only some components are shown schematically, which does not mean that the control device only includes Fig.10 Components shown.
[0175] The control device provided in this embodiment is based on the same inventive concept as the elastic resource scheduling method provided in the embodiment of the present application, and has the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0176] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0177] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0178] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0179] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0180] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0181] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0182] The present application also provides a computer-readable storage medium corresponding to the elastic resource scheduling method provided in the aforementioned implementation, on which a computer program (ie, a program product) is stored. When the computer program is executed by a processor, it will execute the elastic resource scheduling method provided in any of the aforementioned implementations.
[0183] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0184] The computer-readable storage medium provided in the above-mentioned embodiment of the present application and the elastic resource scheduling method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0185] It should be noted that in the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known structures and technologies are not shown in detail so as not to obscure the understanding of this description.
[0186] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0187] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0188] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A flexible resource scheduling method, characterized in that: include: In response to a creation request of an application, issuing a resource application request according to a resource delivery policy customized by the application, wherein the resource delivery policy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups; In response to the resource application request, generate elastic resources associated with a plurality of container groups of the application and schedule the container groups to the corresponding elastic resources; The elastic resources also include fixed node resources, and the fixed node resources include resources of nodes that are in an idle state and will not be recycled; The issuing of a resource application request according to the application-defined resource delivery strategy includes: According to the resource delivery strategy customized by the application, a fixed node resource is selected and the container group is scheduled to the corresponding fixed node resource, and a resource application request is issued based on the remaining container groups in the resource delivery strategy.
2. The method according to claim 1, characterized in that The step of generating elastic resources associated with a plurality of container groups of the application in response to the resource application request and scheduling the container groups to the corresponding elastic resources includes: Produce the elastic resource and return the association relationship between the produced elastic resource and the container group; In response to the returned association relationship, each container group of the application is scheduled to the associated elastic resource.
3. The method according to claim 1, characterized in that The resource delivery strategy is an optimizable delivery strategy or a fixed delivery strategy. The method further comprises: When it is determined that there is optimization space for the elastic resource orchestration strategy in the cluster containing the application, the application of the optimizable delivery strategy in the cluster is rescheduled.
4. The method according to claim 3, characterized in that The determining that an optimization space for the elastic resource orchestration strategy appears in the cluster containing the application includes: After completing at least one elastic resource scheduling that can optimize the delivery strategy, regularly monitor the resource pool of fixed node resources in the cluster; when it is monitored that the resource pool of fixed node resources is idle, determine the optimization space of the elastic resource orchestration strategy in the cluster.
5. The method according to claim 4, characterized in that The elastic resources include ECS elastic resources and ECI elastic resources.
6. The method according to claim 3, 4 or 5, characterized in that: The rescheduling of the application of the optimized delivery strategy in the cluster includes: According to the optimizable delivery strategy in the cluster, optimizing and adjusting the association relationship between the container group of the application and the elastic resource, and issuing an adjustment request for the container group to be adjusted; In response to the adjustment request, reserving resources for the container group to be adjusted; After the resource reservation is successful, the container group to be adjusted is dynamically adjusted.
7. The method according to claim 1, characterized in that The method further comprises: In response to a scaling-down request of an application, scaling down the application according to the resource delivery policy of the application.
8. The method according to claim 7, characterized in that The resource delivery strategy includes the priority of the container group associated with the application; The scaling down the application according to the resource delivery strategy of the application includes: The shrinking quantity of the container group in the application is obtained, a container group that meets the shrinking quantity is selected from low to high priorities of the container groups, and elastic resources of the selected container group are released.
9. A control device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program to: In response to a creation request of an application, issuing a resource application request according to a resource delivery policy customized by the application, wherein the resource delivery policy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups; In response to the resource application request, generate elastic resources associated with a plurality of container groups of the application and schedule the container groups to the corresponding elastic resources; The elastic resources also include fixed node resources, and the fixed node resources include resources of nodes that are in an idle state and will not be recycled; The issuing of a resource application request according to the application-defined resource delivery strategy includes: According to the resource delivery strategy customized by the application, a fixed node resource is selected and the container group is scheduled to the corresponding fixed node resource, and a resource application request is issued based on the remaining container groups in the resource delivery strategy.
10. A flexible resource scheduling device, characterized in that: include: A resource scheduling module, which is used to respond to a creation request of an application and issue a resource application request according to a resource delivery strategy customized by the application, wherein the resource delivery strategy customized by the application includes a plurality of container groups associated with the application and resource types corresponding to the container groups; A resource adaptation module, configured to generate elastic resources associated with a plurality of container groups of the application in response to the resource application request and schedule the container groups to the corresponding elastic resources; The elastic resources also include fixed node resources, which are resources of nodes that are idle and will not be recycled; The issuing of a resource application request according to the application-defined resource delivery strategy includes: According to the resource delivery strategy customized by the application, a fixed node resource is selected and the container group is scheduled to the corresponding fixed node resource, and a resource application request is issued based on the remaining container groups in the resource delivery strategy.
11. The device according to claim 10, characterized in that The resource delivery strategy is an optimizable delivery strategy or a fixed delivery strategy, and the device further includes: The rescheduling module is used to reschedule the application of the optimizable delivery strategy in the cluster when determining that there is an optimization space for the elastic resource orchestration strategy in the cluster containing the application.
12. The device according to claim 10, characterized in that Also includes: The application scaling-down module is used to respond to a scaling-down request of an application and scale down the application according to the resource delivery policy of the application.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 8.