Containerized resource scheduling estimation method and device, medium and equipment
By obtaining the remaining resources of the target container cluster and resource configuration requests for the application, and determining the deployment strategy, the deployment failure caused by insufficient resources of the container cluster is solved, and efficient and secure application deployment is achieved.
Patent Information
- Application Number
- CN202411502866.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-03-11
AI Technical Summary
In containerization technology, insufficient resources of the target container cluster lead to failure of application deployment. It is difficult for the existing technology to clarify whether the target cluster has sufficient resources before deployment, making it difficult to take operation and maintenance measures in advance.
By obtaining the remaining resources of the target container cluster, analyzing the application's resource configuration request, determining the resource share required by the application, and determining the deployment strategy based on the remaining resources and the required resource share, implementing the containerized resource scheduling estimate of the application.
Determine deployment strategies through simulated allocation calculations, avoid deployment failures, improve deployment efficiency, reduce risks and costs, and take operation and maintenance measures in advance to avoid deployment failures.
Smart Images

Figure CN119597447A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a containerized resource scheduling estimation method, device, medium and equipment. Background Art
[0002] With the development of containerization technology, the resource status of the target container cluster is a factor that cannot be ignored when scheduling applications to the target container cluster. When the target cluster resources are insufficient to run a given application Pod, the application will fail to deploy. Therefore, there is an urgent need for a new containerized resource scheduling estimation method to clearly know whether the target cluster has sufficient resources to schedule the application Pod before application deployment, so as to take operation and maintenance measures in advance to avoid deployment failures. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide a containerized resource scheduling estimation method, device, medium and equipment that overcome the above problems or at least partially solve the above problems.
[0004] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.
[0005] According to a first aspect of an embodiment of the present invention, a containerized resource scheduling estimation method is provided, and the containerized resource scheduling estimation method includes:
[0006] Obtain remaining resources of a target container cluster for application deployment, where the target container cluster is a collection of multiple node servers, and the remaining resources include the number of allocatable pods, allocatable CPU resources, and allocatable memory resources of each of the node servers in the target container cluster;
[0007] Parse the resource configuration request of the obtained application, determine the resource share required by the application, and obtain a list of resources to be deployed, wherein the list of resources to be deployed includes the number of pods to be deployed, the CPU share to be deployed, and the memory share to be deployed of one or more applications;
[0008] Determine a deployment strategy for the application program according to the resource share required by the application program and the remaining resources of the target container cluster, and deploy the application program to the target container cluster according to the deployment strategy.
[0009] In some embodiments of the present invention, determining the deployment strategy of the application according to the resource share required by the application and the remaining resources of the target container cluster includes:
[0010] Traversing the remaining resources of the target container cluster, sorting the node servers in the target container cluster according to a predetermined allocation rule, and obtaining a remaining resource list;
[0011] Based on the remaining resource list and the to-be-deployed resource list, it is determined in turn whether each of the node servers in the remaining resource list meets the resource share required to be occupied by the application program, so as to determine the deployment strategy of the application program.
[0012] In some embodiments of the present invention, the step of sequentially judging whether each of the node servers in the sequence results satisfies the resource share required by the application program and determining the deployment strategy of the application program includes:
[0013] Determine the recursion depth according to the number of pods to be deployed in the list of resources to be deployed;
[0014] Determine the preset value of the recursive depth based on the unit time of the recursive operation and the response time of the program;
[0015] It is determined whether the recursion depth meets a preset value, and based on the determination result, an exact solution operation or an approximate solution operation is performed on the deployment of the application on the target container cluster.
[0016] In some embodiments of the invention, the method comprises:
[0017] The recursion depth is determined by the following formula:
[0018] k=n n ;
[0019] Wherein, k is the recursion depth, and k is a positive integer; n is the number of pods to be deployed in the list of pod resources to be deployed;
[0020] The response time of the program is T=K*t, K is a preset value of the recursive depth, t is a unit time of the recursive operation, and K≥k.
[0021] In some embodiments of the present invention, the determining whether the recursion depth meets a preset value, and performing an exact solution operation or an approximate solution operation on the deployment of the application on the target container cluster according to the determination result, respectively, includes:
[0022] When the recursion depth meets a preset value, performing an accurate solution operation on the deployment of the application on the target container cluster;
[0023] When the recursion depth does not meet the preset value, an approximate solution operation is performed on the deployment of the application on the target container cluster.
[0024] In some embodiments of the present invention, performing an accurate solution operation on the deployment of the application on the target container cluster includes:
[0025] Sorting the node servers in the target container cluster using the default order in the resource configuration request of the application as a predetermined allocation rule to obtain a list of remaining resources;
[0026] According to the list order of the pods to be deployed in the list of resources to be deployed, simulate the allocation of the first pod to be deployed, confirm whether the first node server in the list of remaining resources meets the deployment requirements of the first pod to be deployed, and if so, deploy the first pod to be deployed to the first node server, deduct the resource share required to be occupied by the first pod to be deployed in the list of remaining resources, and simulate the allocation of subsequent pods to be deployed;
[0027] According to the list order of the pods to be deployed in the list of resources to be deployed, all the pods to be deployed are simulated and allocated in turn, and are deployed to each node server in the list of remaining resources respectively.
[0028] In some embodiments of the present invention, performing an approximate solution operation on the deployment of the application on the target container cluster includes:
[0029] Traverse the remaining resources of the target container cluster and confirm the remaining resource size of each node server;
[0030] Sort the node servers in the target container cluster by the size of the remaining resources as a predetermined allocation rule to obtain a remaining resource list;
[0031] Traversing the resource shares required to be occupied by the pods to be deployed in the list of resources to be deployed, and sorting the pods to be deployed according to the size of the resource shares required to be occupied, to obtain a new list of resources to be deployed;
[0032] According to the list order of the pods to be deployed in the new list of resources to be deployed, simulate the allocation of the first pod to be deployed, confirm whether the first node server in the remaining resource list meets the deployment requirements of the first pod to be deployed, and if so, deploy the first pod to be deployed to the first node server, deduct the resource share required to be occupied by the first pod to be deployed in the remaining resource list, and simulate the allocation of subsequent pods to be deployed;
[0033] According to the list order of the pods to be deployed in the new list of resources to be deployed, all the pods to be deployed are simulated and allocated in turn, and are deployed to each node server in the remaining resource list respectively.
[0034] According to a second aspect of an embodiment of the present invention, a containerized resource scheduling estimation device is provided, and the containerized resource scheduling estimation device includes:
[0035] A remaining resource acquisition module is used to acquire the remaining resources of a target container cluster for application deployment, wherein the target container cluster is a collection of multiple node servers, and the remaining resources include the number of allocatable pods, allocatable CPU resources, and allocatable memory resources of each of the node servers in the target container cluster;
[0036] A resource occupancy parsing module is used to parse the resource configuration request of the obtained application, determine the resource share required by the application, and obtain a list of resources to be deployed, wherein the list of resources to be deployed includes the number of pods to be deployed, the CPU share to be deployed, and the memory share to be deployed of one or more applications;
[0037] The resource scheduling module is used to determine the deployment strategy of the application according to the resource share required by the application and the remaining resources of the target container cluster, and deploy the application to the target container cluster according to the deployment strategy.
[0038] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which computer program instructions are stored. The computer program instructions are loaded and executed by a processor to implement the operations performed by any of the methods described above.
[0039] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device, comprising a processor and a memory, wherein the memory stores computer program instructions that can be executed by the processor, and when the processor executes the computer program instructions, it implements instructions of any of the methods described above.
[0040] The technical solution provided in the embodiments of the present invention has at least the following technical effects or advantages:
[0041] An embodiment of the present invention provides a containerized resource scheduling estimation method, device, medium and equipment. The containerized resource scheduling estimation method described in the embodiment of the present invention determines the deployment strategy of the application by simulating the allocation calculation of the resource share required by the application and the remaining resources of the target container cluster. The application does not need to wait until the deployment fails to be informed of the insufficient resources of the container cluster, so that operation and maintenance measures can be taken in advance to avoid the deployment failure problem, thereby improving deployment efficiency and reducing risks and costs.
[0042] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A schematic diagram of a process flow of a containerized resource scheduling estimation method provided by an embodiment of the present invention;
[0045] Figure 2 A flowchart for performing an exact solution operation or an approximate solution operation on the deployment of the application on the target container cluster;
[0046] Figure 3 A schematic diagram of the principle structure of a containerized resource scheduling estimation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings.
[0048] Various structural schematic diagrams according to embodiments of the present disclosure are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may further design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0049] In the context of the present disclosure, when a layer / element is referred to as being "on" another layer / element, the layer / element may be directly on the other layer / element, or there may be an intervening layer / element therebetween. Additionally, if a layer / element is "on" another layer / element in one orientation, the layer / element may be "below" the other layer / element when the orientation is reversed. In the context of the present disclosure, similar or identical components may be denoted by the same or similar reference numerals.
[0050] In order to better understand the above-mentioned technical scheme, the above-mentioned technical scheme will be described in detail below in combination with specific implementation methods. It should be understood that the embodiments of the present disclosure and the specific features in the embodiments are detailed descriptions of the technical scheme of the present invention, rather than limitations on the technical scheme of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0051] Figure 1 is a flow chart of a containerized resource scheduling estimation method provided by an embodiment of the present invention, such as Figure 1 As shown, the containerized resource scheduling estimation method includes the following steps:
[0052] S1. Obtain the remaining resources of a target container cluster for application deployment, where the target container cluster is a collection of multiple node servers, and the remaining resources include the number of allocatable pods, allocatable CPU resources, and allocatable memory resources of each of the node servers in the target container cluster;
[0053] When an application needs to be deployed, each application may require different pod (or number of replicas) resources and request specification resources (CPU resources, memory resources), that is, resources of different sizes; since the target container cluster is a collection of multiple node servers, the embodiment of the present invention obtains the remaining resources of the target container cluster for application deployment for subsequent further calculation and confirmation to deploy the application to each node server of the target container cluster.
[0054] In the embodiment of the present invention, the pod is a basic unit in the target container cluster, and the pod can be a collection of multiple containers that implement an application or a group of related services by coordinating work. The same pod runs on the same node server and can share some network and storage resources so that the containers can communicate with each other.
[0055] In an embodiment of the present invention, the node server may be a physical machine or a virtual machine, which is used to run containerized applications, wherein each node server includes computing, storage, and network resources, which can be used to run one or more Pods. In other implementations, the node server may also be a local machine, a cloud server, or a virtual machine, etc.
[0056] In an embodiment of the present invention, the target container cluster is a set of multiple node servers that manage and run containerized applications through coordinated work. The node servers in the target container cluster can be distributed on different physical machines or virtual machines. At the same time, the resources in the cluster can be managed by a management application (such as Kubernetes), which is responsible for scheduling containers to ensure that the application can run efficiently on all node servers in the cluster.
[0057] Specifically, among the remaining resources, the allocatable number of pods of each of the node servers in the target container cluster is (the total allocatable number of Pods of the node server - the allocated number of Pods) * the number of node servers; among the remaining resources, the allocatable CPU resources of each of the node servers in the target container cluster is (the total allocatable CPU resources of the node server - the allocated CPU resources) * the number of node servers; among the remaining resources, the allocatable memory resources of each of the node servers in the target container cluster is (the total allocatable memory resources of the node server - the allocated memory resources) * the number of node servers.
[0058] S2. Parse the resource configuration request of the obtained application, determine the resource share required by the application, and obtain a list of resources to be deployed, where the list of resources to be deployed includes the number of pods to be deployed, the CPU share to be deployed, and the memory share to be deployed of one or more applications;
[0059] In an embodiment of the present invention, the resource allocation request of the application is parsed to determine the resource share required by the current application. Of course, it should be noted that when multiple applications have deployment requirements, the resource allocation requests of the multiple applications need to be parsed separately to determine the resource share required for each of the applications, and determine the deployment strategy of the application in sequence from front to back based on the sending time of the resource allocation request.
[0060] S3. Determine a deployment strategy for the application based on the resource share required by the application and the remaining resources of the target container cluster, and deploy the application to the target container cluster based on the deployment strategy.
[0061] According to an embodiment of the present invention, after obtaining the resource share required to be occupied by the application and the remaining resources of the target container cluster, the deployment strategy of the application is determined by simulating the allocation of the application to the target container cluster. Specifically, according to the resource share required to be occupied by the application and the remaining resources of the target container cluster, the deployment strategy of the application is determined in the embodiment of the present invention, including: traversing the remaining resources of the target container cluster, sorting the node servers in the target container cluster according to a predetermined allocation rule, and obtaining a remaining resource list; based on the remaining resource list and the list of resources to be deployed, judging in turn whether each of the node servers in the remaining resource list meets the resource share required to be occupied by the application, so as to determine the deployment strategy of the application.
[0062] The embodiment of the present invention sequentially determines whether each of the node servers in the sequence results meets the resource share required by the application, and determines the deployment strategy of the application, including: determining the recursive depth according to the number of pods to be deployed in the list of resources to be deployed; determining a preset value of the recursive depth according to the unit time of the recursive operation and the response time of the program; determining whether the recursive depth meets the preset value, and according to the result of the judgment, performing an exact solution operation or an approximate solution operation on the deployment of the application on the target container cluster.
[0063] When the number of pods to be deployed (i.e., the recursive depth) is too large, a large amount of computing resources are required for function calculation, and the program response time will also be longer. The program response time T = K*t, where K is the preset value of the recursive depth and t is the unit time of the recursive operation (the time of one recursive operation).
[0064] In an embodiment of the present invention, the recursion depth is determined by the following formula:
[0065] k=n n ;
[0066] Wherein, k is the recursion depth, k is a positive integer; n is the number of pods to be deployed in the list of pod resources to be deployed, and K ≥ k.
[0067] For example, assuming that the number of pods to be deployed n in the list of pod resources to be deployed is 4, then in the worst case (no solution can be found after all calculations), the program needs to calculate about 4 to the fourth power (256) times. If each recursive operation takes 5 milliseconds, the overall operation time in the worst case is about 1 second. Estimate the maximum recursive depth that the program can accept based on the response time requirements of the program and the computing resources (unit time of recursive operation) owned by the current program, determine the preset value of the recursive depth, and use this value as the standard for whether to adopt precise solution operations. For example, when the response time of the program is required to be within 2 seconds, and the program takes 1 millisecond to perform a recursive operation, the preset value of the recursive depth can be set to 2000. When the recursive depth is less than or equal to 2000, you can consider performing a precise solution operation.
[0068] Combination Figure 2 As shown, it is a flow chart of respectively performing an exact solution operation or an approximate solution operation on the deployment of the application on the target container cluster. The embodiment of the present invention determines whether the recursion depth meets the preset value, and according to the result of the determination, respectively performs an exact solution operation or an approximate solution operation on the deployment of the application on the target container cluster, including: when the recursion depth meets the preset value, performing an exact solution operation on the deployment of the application on the target container cluster; when the recursion depth does not meet the preset value, performing an approximate solution operation on the deployment of the application on the target container cluster.
[0069] Specifically, the precise solution operation for the deployment of the application on the target container cluster includes: sorting the node servers in the target container cluster according to the default order in the resource configuration request of the application as a predetermined allocation rule to obtain a list of remaining resources; simulating the allocation of the first pod to be deployed according to the list order of the pods to be deployed in the list of resources to be deployed, and confirming whether the first node server in the list of remaining resources meets the deployment requirements of the first pod to be deployed. If the deployment requirements are met, the first pod to be deployed is deployed to the first node server, and the resource share required to be occupied by the first pod to be deployed is deducted from the list of remaining resources, and subsequent simulated allocation of pods to be deployed is performed; according to the list order of the pods to be deployed in the list of resources to be deployed, all pods to be deployed are simulated and allocated in turn, and deployed to each node server in the list of remaining resources respectively.
[0070] For example, if there are n pods to be deployed in the list of resources to be deployed, then according to the list order of the pods to be deployed in the list of resources to be deployed, the n pods to be deployed are defined as n(1), n(2), n(3)...n(n), respectively, and n(n) represents the resource share required to be occupied by the nth pod to be deployed; if there are m node servers in the list of remaining resources, then according to the sorted results, the remaining resources corresponding to the m node servers are defined as m(1), m(2), m(3)...m(m), respectively, and m(m) represents the remaining resources corresponding to the mth node server.
[0071] When performing an accurate solution operation on the deployment of the application on the target container cluster, the embodiment of the present invention first simulates the allocation of n(1) pods to be deployed to confirm whether the remaining resources of the node server m(1) meet the deployment requirements of the first n(1). If the deployment requirements are met, the n(1) pods to be deployed are deployed to the node server m(1), and the resource share required for the n(1) pods to be deployed is deducted from the remaining resource list. At this time, the remaining resources of the node server m(1) need to be subtracted from n(1), that is, m(1)=m(1)-n(1), and the node server m(1) is removed from the remaining resource list.
[0072] Continue to simulate the allocation of the next Pod to be deployed, numbered n(2). If a node server (for example, m(2)) can still be found to allocate the Pod to be deployed, then subtract n(2) from the remaining resources of the node server and continue to simulate the allocation of n(3). If no node server can be found to meet the allocation requirements of n(2), then reallocate the previously allocated Pod to be deployed, that is, n(1), and reset the remaining resources of the node server to which the resources have been simulated and allocated, restart the simulation calculation of n(1), find servers other than m(1) for simulation allocation, and then continue with subsequent allocations; and so on, until an allocation method is found that can allocate n(n) to one of the node servers, then the calculation ends and the application can be deployed successfully. Otherwise, if no solution can meet the requirements, it cannot be deployed and the result of deployment failure is returned.
[0073] The approximate solution operation for the deployment of the application on the target container cluster includes: traversing the remaining resources of the target container cluster to confirm the remaining resource size of each node server; sorting the node servers in the target container cluster according to the size of the remaining resources as a predetermined allocation rule to obtain a remaining resource list; traversing the resource share required to be occupied by the pod to be deployed in the list of resources to be deployed, and sorting the pod to be deployed according to the size of the required resource share to obtain a new list of resources to be deployed; according to the list order of the pod to be deployed in the new list of resources to be deployed, simulating the allocation of the first pod to be deployed, confirming whether the first node server in the list of remaining resources meets the deployment requirements of the first pod to be deployed, and if the deployment requirements are met, deploying the first pod to be deployed to the first node server, deducting the resource share required to be occupied by the first pod to be deployed from the list of remaining resources, and performing simulated allocation of subsequent pods to be deployed; according to the list order of the pod to be deployed in the new list of resources to be deployed, simulating the allocation of all pods to be deployed in turn, and deploying them to each node server in the list of remaining resources respectively.
[0074] Specifically, confirm the remaining resource size of each node server in the target container cluster. For example, sort the node servers from large to small according to the remaining resources, and use the node server with the largest remaining resources as the first node server in the remaining resource list. If there are m node servers in the remaining resource list, then define the remaining resources corresponding to the m node servers as m(1), m(2), m(3)...m(m) according to the sorted results, and use m(m) to represent the remaining resources corresponding to the mth node server.
[0075] Similarly, the embodiment of the present invention sorts the pods to be deployed according to the size of the resource shares required to be occupied. For example, the pod to be deployed with the largest resource share required to be occupied is used as the first pod to be deployed in the list of resources to be deployed. If there are n pods to be deployed in the list of resources to be deployed, then according to the list order of the pods to be deployed in the list of resources to be deployed, the n pods to be deployed are defined as n(1), n(2), n(3)...n(n), respectively, and n(n) represents the resource share required to be occupied by the nth pod to be deployed.
[0076] When performing an approximate solution operation on the deployment of the application on the target container cluster, an embodiment of the present invention deploys all the pods to be deployed in the list of resources to be deployed to the node server with the largest remaining resources in turn. For example, an embodiment of the present invention first simulates the allocation of n(1) pods to be deployed to confirm whether the remaining resources of the node server m(1) meet the deployment requirements of the first n(1). If the deployment requirements are met, the n(1) pods to be deployed are deployed to the node server m(1), and the resource share required for the n(1) pods to be deployed is deducted from the remaining resource list. At this time, the remaining resources of the node server m(1) need to be subtracted from n(1), that is, m(1)=m(1)-n(1), and the node server m(1) is removed from the remaining resource list.
[0077] Continue to simulate the allocation of the next Pod to be deployed, numbered n(2). If a node server (for example, m(2)) can still be found to allocate the Pod to be deployed, subtract n(2) from the remaining resources of the node server and continue to simulate the allocation of n(3). This continues in this way until a method is found to allocate n(n) to one of the node servers. The calculation ends and the application is successfully deployed. Otherwise, if no node server can be found to meet the allocation requirements of n(n), deployment fails and a deployment failure result is returned.
[0078] The containerized resource scheduling estimation method described in the embodiment of the present invention determines the deployment strategy of the application by simulating the allocation calculation of the resource share required by the application and the remaining resources of the target container cluster. The application does not need to wait until the deployment fails to be informed of the insufficient resources of the container cluster, so that operation and maintenance measures can be taken in advance to avoid the deployment failure problem, thereby improving deployment efficiency and reducing risks and costs. At the same time, when multiple different applications need to be deployed, the method described in the present invention can also be applied to achieve it, meeting the resource scheduling requirements in a variety of different scenarios.
[0079] Based on the above embodiment, as the above Figure 1 The present invention provides an embodiment of a containerized resource scheduling estimation device, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices, see Figure 3 As shown, the containerized resource scheduling estimation device includes:
[0080] The remaining resource acquisition module 100 is used to acquire the remaining resources of the target container cluster for application deployment, wherein the target container cluster is a collection of multiple node servers, and the remaining resources include the number of allocatable pods, allocatable CPU resources, and allocatable memory resources of each of the node servers in the target container cluster;
[0081] The resource occupancy parsing module 200 is used to parse the resource configuration request of the obtained application, determine the resource share required by the application, and obtain a list of resources to be deployed, wherein the list of resources to be deployed includes the number of pods to be deployed, the CPU share to be deployed, and the memory share to be deployed of one or more applications;
[0082] The resource scheduling module 300 is used to determine the deployment strategy of the application according to the resource share required by the application and the remaining resources of the target container cluster, and deploy the application to the target container cluster according to the deployment strategy.
[0083] The containerized resource scheduling estimation device described in the embodiment of the present invention can execute the containerized resource scheduling estimation method provided in the above embodiment. The containerized resource scheduling estimation device has the corresponding functional steps and beneficial effects of the containerized resource scheduling estimation method described in the above embodiment. Please refer to the embodiment of the above containerized resource scheduling estimation method for details. The embodiment of the present invention will not be repeated here.
[0084] The embodiment of the present invention also provides an electronic device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or other means. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned various types of chips. The memory, as a non-transient computer-readable storage medium, may be allocated to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the containerized resource scheduling estimation method in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the containerized resource scheduling estimation method in the above method embodiment is implemented.
[0085] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. The one or more modules are stored in the memory, and when executed by the processor, the containerized resource scheduling estimation method in the above method embodiment is executed. The specific details of the above electronic device can be understood by corresponding to the corresponding descriptions and effects in the above method embodiment, and will not be repeated here. Those skilled in the art can understand that all or part of the processes in the above embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program, when executed, may include the processes of the embodiments of the above methods. Among them, the storage medium can be a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0086] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0087] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0088] It should be noted that the above-mentioned embodiments illustrate rather than limit the invention and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims.
Claims
1. A containerized resource scheduling estimation method, characterized in that: The containerized resource scheduling estimation method includes: Obtain remaining resources of a target container cluster for application deployment, where the target container cluster is a collection of multiple node servers, and the remaining resources include the number of allocatable pods, allocatable CPU resources, and allocatable memory resources of each of the node servers in the target container cluster; Parse the resource configuration request of the obtained application, determine the resource share required by the application, and obtain a list of resources to be deployed, wherein the list of resources to be deployed includes the number of pods to be deployed, the CPU share to be deployed, and the memory share to be deployed of one or more applications; Determine a deployment strategy for the application program according to the resource share required by the application program and the remaining resources of the target container cluster, and deploy the application program to the target container cluster according to the deployment strategy.
2. The containerized resource scheduling estimation method according to claim 1, characterized in that: Determining the deployment strategy of the application according to the resource share required by the application and the remaining resources of the target container cluster includes: Traversing the remaining resources of the target container cluster, sorting the node servers in the target container cluster according to a predetermined allocation rule, and obtaining a remaining resource list; Based on the remaining resource list and the to-be-deployed resource list, it is determined in turn whether each of the node servers in the remaining resource list meets the resource share required to be occupied by the application program, so as to determine the deployment strategy of the application program.
3. The containerized resource scheduling estimation method according to claim 2, characterized in that: The step of sequentially judging whether each of the node servers in the sequence results meets the resource share required by the application program and determining the deployment strategy of the application program comprises: Determine the recursion depth according to the number of pods to be deployed in the list of resources to be deployed; Determine the preset value of the recursive depth based on the unit time of the recursive operation and the response time of the program; It is determined whether the recursion depth meets a preset value, and based on the determination result, an exact solution operation or an approximate solution operation is performed on the deployment of the application on the target container cluster.
4. The containerized resource scheduling estimation method according to claim 3, characterized in that: The method comprises: The recursion depth is determined by the following formula: k=n n ; Wherein, k is the recursion depth, and k is a positive integer; n is the number of pods to be deployed in the list of pod resources to be deployed; The response time of the program is T=K*t, K is a preset value of the recursive depth, t is a unit time of the recursive operation, and K≥k.
5. The containerized resource scheduling estimation method according to claim 3, characterized in that: The determining whether the recursion depth meets a preset value and, based on the determination result, performing an exact solution operation or an approximate solution operation on the deployment of the application on the target container cluster respectively includes: When the recursion depth meets a preset value, performing an accurate solution operation on the deployment of the application on the target container cluster; When the recursion depth does not meet the preset value, an approximate solution operation is performed on the deployment of the application on the target container cluster.
6. The containerized resource scheduling estimation method according to claim 5, characterized in that: The performing of an accurate solution operation on the deployment of the application on the target container cluster includes: Sorting the node servers in the target container cluster using the default order in the resource configuration request of the application as a predetermined allocation rule to obtain a list of remaining resources; According to the list order of the pods to be deployed in the list of resources to be deployed, simulate the allocation of the first pod to be deployed, confirm whether the first node server in the list of remaining resources meets the deployment requirements of the first pod to be deployed, and if so, deploy the first pod to be deployed to the first node server, deduct the resource share required to be occupied by the first pod to be deployed in the list of remaining resources, and simulate the allocation of subsequent pods to be deployed; According to the list order of the pods to be deployed in the list of resources to be deployed, all the pods to be deployed are simulated and allocated in turn, and are deployed to each node server in the list of remaining resources respectively.
7. The containerized resource scheduling estimation method according to claim 1, characterized in that: The performing an approximate solution operation on the deployment of the application on the target container cluster includes: Traverse the remaining resources of the target container cluster and confirm the remaining resource size of each node server; Sort the node servers in the target container cluster by the size of the remaining resources as a predetermined allocation rule to obtain a remaining resource list; Traversing the resource shares required to be occupied by the pods to be deployed in the list of resources to be deployed, and sorting the pods to be deployed according to the size of the resource shares required to be occupied, to obtain a new list of resources to be deployed; According to the list order of the pods to be deployed in the new list of resources to be deployed, simulate the allocation of the first pod to be deployed, confirm whether the first node server in the remaining resource list meets the deployment requirements of the first pod to be deployed, and if so, deploy the first pod to be deployed to the first node server, deduct the resource share required to be occupied by the first pod to be deployed in the remaining resource list, and simulate the allocation of subsequent pods to be deployed; According to the list order of the pods to be deployed in the new list of resources to be deployed, all the pods to be deployed are simulated and allocated in turn, and are deployed to each node server in the remaining resource list respectively.
8. A containerized resource scheduling estimation device, applied to the method according to any one of claims 1 to 7, characterized in that: The containerized resource scheduling estimation device comprises: A remaining resource acquisition module is used to acquire the remaining resources of a target container cluster for application deployment, wherein the target container cluster is a collection of multiple node servers, and the remaining resources include the number of allocatable pods, allocatable CPU resources, and allocatable memory resources of each of the node servers in the target container cluster; A resource occupancy parsing module is used to parse the resource configuration request of the obtained application, determine the resource share required by the application, and obtain a list of resources to be deployed, wherein the list of resources to be deployed includes the number of pods to be deployed, the CPU share to be deployed, and the memory share to be deployed of one or more applications; The resource scheduling module is used to determine the deployment strategy of the application according to the resource share required by the application and the remaining resources of the target container cluster, and deploy the application to the target container cluster according to the deployment strategy.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which are loaded and executed by a processor to implement the operations performed by the method according to any one of claims 1 to 7.
10. An electronic device comprising a processor and a memory, characterized in that: The memory stores computer program instructions that can be executed by the processor, and when the processor executes the computer program instructions, the processor implements instructions of any one of the methods described in claims 1-7.