Container instance scheduling method and device, storage medium and electronic equipment
By obtaining resource data of container instances and host nodes through the monitoring agent, dynamically schedule container instances to target host nodes, solving the problem of resource waste and insufficient resources caused by static resource configuration, and improving the operating performance of container instances.
Patent Information
- Application Number
- CN202411628146.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
AI Technical Summary
The container instance scheduling method of static resource configuration in the prior art often leads to waste of resources or insufficient resources, affecting the operating performance of container instances.
By using the monitoring agent to obtain the resource requirements of the container instance and the resource utilization data of the host node, the target host node of the container instance is dynamically determined and scheduled.
It realizes dynamic adjustment and allocation of cluster resources, improves resource utilization rate of target host nodes, and improves the operating performance of container instances.
Smart Images

Figure CN119576544A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a container instance scheduling method, device, storage medium and electronic device. Background Art
[0002] Container instance scheduling refers to the process of allocating containerized applications to suitable computing nodes to run in a containerized environment.
[0003] At present, the container instance scheduling method in related technologies is usually based on static resource configuration, allocating a fixed amount of resources to the container instance.
[0004] However, the container instance scheduling method of static resource configuration in related technologies usually leads to resource waste or insufficient resources, thereby affecting the operating performance of the container instance. Summary of the invention
[0005] In view of this, the present application provides a container instance scheduling method, device, storage medium and electronic device, the main purpose of which is to improve the container instance scheduling method of static resource configuration in the current related technology, which usually leads to resource waste or insufficient resources, thereby affecting the technical problem of the operating performance of the container instance.
[0006] In a first aspect, the present application provides a container instance scheduling method, including:
[0007] Using a monitoring agent to obtain monitoring data, the monitoring data includes container resource requirements corresponding to the container instance and resource utilization rates of different host nodes;
[0008] Determining a target host node corresponding to the container instance according to the container resource demand and the resource utilization;
[0009] The container instance is scheduled to the target host node.
[0010] In a second aspect, the present application provides a container instance scheduling device, including:
[0011] An acquisition module is configured to acquire monitoring data using a monitoring agent, wherein the monitoring data includes a container resource demand corresponding to the container instance and resource utilization rates of different host nodes;
[0012] A determination module is configured to determine a target host node corresponding to the container instance according to the container resource demand and the resource utilization;
[0013] The scheduling module is configured to schedule the container instance to the target host node.
[0014] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the container instance scheduling method described in the first aspect is implemented.
[0015] In a fourth aspect, the present application provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein when the processor executes the computer program, the container instance scheduling method described in the first aspect is implemented.
[0016] In a fifth aspect, the present application provides a computer program product having a computer program stored thereon, and when the computer program is executed by a processor, the container instance scheduling method described in the first aspect is implemented.
[0017] By means of the above technical scheme, the present application provides a method, device, storage medium and electronic device for scheduling container instances. First, a monitoring agent is used to obtain monitoring data, wherein the monitoring data includes the container resource requirements corresponding to the container instance and the resource utilization of different host nodes; then, according to the container resource requirements and the resource utilization, the target host node corresponding to the container instance is determined; finally, the container instance is scheduled to the target host node. Compared with the current prior art, the present application can use a monitoring agent to obtain monitoring data, wherein the monitoring data includes the container resource requirements corresponding to the container instance and the resource utilization of different host nodes, and according to the monitored container resource requirements and resource utilization, the target host node corresponding to the container instance is determined, and the container instance is scheduled to the target host node, so that the monitoring agent is used to collect the resource utilization of each host node in the cluster in real time, and the container resource requirements of each container instance, so as to understand the operation status of the cluster in real time, and the dynamic requirements of the container instance, so as to dynamically select the best target host node for scheduling the container instance, realize the dynamic adjustment and allocation of cluster resources, improve the resource utilization of the target host node, and thus improve the operation performance of the container instance.
[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] Figure 1 A schematic diagram of a process of a container instance scheduling method provided in an embodiment of the present application is shown;
[0022] Figure 2 A schematic diagram of a process of a container instance scheduling method provided in an embodiment of the present application is shown;
[0023] Figure 3 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0024] Figure 4 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0025] Figure 5 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0026] Figure 6 A schematic diagram of the structure of a container instance scheduling device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0028] In order to improve the current container instance scheduling method of static resource configuration in related technologies, which usually leads to resource waste or insufficient resources, thereby affecting the technical problem of the running performance of the container instance. This embodiment provides a container instance scheduling method, such as Figure 1 As shown, the method includes:
[0029] Step 101: Use a monitoring agent to obtain monitoring data, where the monitoring data includes container resource requirements corresponding to the container instance and resource utilization rates of different host nodes.
[0030] In some embodiments, a monitoring agent (such as Node Exporter, cAdvisor) can be deployed to collect container resource requirements of container instances and resource utilization of each host node in the cluster (including the host machine), and integrate monitoring data into the central system, so as to monitor the resource usage of containers and clusters in real time. Through the data obtained by the monitoring system, the status of the container cluster can be more accurately understood and adjustments can be made according to actual conditions. Exemplarily, the monitoring data may include but is not limited to: node load, container operation status, network latency, response time, and throughput, etc. The indicator data in the monitoring data can be associated with the node resource data.
[0031] Step 102: Determine the target host node corresponding to the container instance according to the container resource demand and resource utilization.
[0032] In some embodiments, a monitoring agent is used to monitor the container resource requirements of each container instance in real time, and the best target host node is matched for the container instance based on the container resource requirements and resource utilization obtained in real time, so as to dynamically allocate resources according to the dynamic resource requirements of the container, realize reasonable allocation and scheduling of containers by the cluster, improve resource utilization, optimize performance, ensure service availability, and adapt to dynamically changing load and environmental requirements.
[0033] Step 103: Schedule the container instance to the target host node.
[0034] In some embodiments, after determining the target host node, the container instance can be scheduled to the target host node and monitored using a monitoring agent. If it is detected that the target host node does not match the container resource requirements of the container instance, the host node corresponding to the container instance can be re-determined according to the elastic scheduling mechanism, and the number and distribution of container instances can be dynamically adjusted to improve the system's adaptability and resource utilization, thereby improving the overall system performance.
[0035] Compared with the current existing technology, this embodiment can use a monitoring agent to obtain monitoring data, and the monitoring data includes the container resource requirements corresponding to the container instance and the resource utilization of different host nodes. According to the monitored container resource requirements and resource utilization, the target host node corresponding to the container instance is determined, and the container instance is scheduled to the target host node. The monitoring agent is used to collect the resource utilization of each host node in the cluster and the container resource requirements of each container instance in real time, so as to understand the operating status of the cluster and the dynamic requirements of the container instance in real time, so as to dynamically select the best target host node for scheduling the container instance, realize the dynamic adjustment and allocation of cluster resources, improve the resource utilization of the target host node, and then improve the operating performance of the container instance.
[0036] In order to further illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 2 The specific method shown includes:
[0037] Step 201: Use a monitoring agent to obtain monitoring data, where the monitoring data includes container resource requirements corresponding to the container instance and resource utilization rates of different host nodes.
[0038] For example, monitoring data can be generated by integrating resource utilization and container resource requirements, and the monitoring data can be integrated into the central system so that the central system can monitor the operating status of each container and each host (such as fault status, insufficient resource status, etc.), and promptly match the best node for each container instance, improve the operating performance of the container instance, improve the utilization of each host node, reduce abnormal situations caused by poor resource allocation, promptly detect abnormal situations and make corresponding adjustments, and ensure system stability and performance.
[0039] Optionally, this example method may also include: using a monitoring agent to obtain resource usage corresponding to different resource types in the host node; and determining the resource utilization rate of the host node based on the resource usage.
[0040] In this embodiment, a monitoring agent can be used to monitor the operating status of each host node and container instance in real time. Specifically, first, the utilization corresponding to each resource type on the host node can be obtained based on the monitoring data, such as CPU utilization, memory utilization, disk IO utilization, network utilization, etc., and then the resource utilization (average resource utilization) of different host nodes (nodes) can be obtained through a preset utilization formula.
[0041] Specifically, for a node Node, its single resource utilization can be the resource allocation of all container Pods on the node divided by the resource value of the node; for example, CPU utilization L (CPU i ) is calculated as follows:
[0042]
[0043] In the formula, CPUPod ij It can represent the CPU usage of Pod numbered j on Node numbered i. It can represent the total CPU usage on the Node numbered i, PodNum i Can represent Node i Total number of Pods.
[0044] Accordingly, the preset utilization formula is as follows:
[0045]
[0046] In the formula, L(N i) can represent the average resource utilization rate corresponding to the i-th Node, L(Cpu i ) can represent the CPU utilization rate corresponding to the i-th Node, L(Mem i ) can represent the memory utilization corresponding to the i-th Node, L(Disk i ) can represent the disk utilization rate corresponding to the i-th Node, L(Net i ) can represent the network utilization corresponding to the i-th Node.
[0047] Optionally, a node type weight may be determined according to the node type of the node; and the resource utilization of the node may be calculated based on the node type weight.
[0048] In actual application deployment, different nodes have different preferences for resources. For example, computing nodes prefer to use CPU, and nodes with SSD disks prefer to use disk IO. Different types of nodes have different emphasis on evaluation indicators. We can introduce weights to determine the impact of each evaluation indicator on the node load, which helps improve the operating performance of each node. Furthermore, based on the node type weight of each node, the formula for calculating the resource utilization of the node is as follows:
[0049] L(N i )=(Weight(Cpu i )×L(Cpu i )+Weight(Mem i )×L(Mem i )+Weight(Disk i )
[0050] ×L(Disk i )+Weight(Net i )×L(Net)) / Count(Weight)
[0051] In the formula, L(N i ) can represent the resource utilization of the i-th Node calculated according to the node type weight, Weight(Cpu i )、Weight(Mem i )、Weight(Disk i )、Weight(Net i ) can represent the weight values assigned to CPU, memory, disk, and network respectively. Use Count(Weight) to determine the value of the denominator based on Weight. If Weight is 0, this indicator is not considered.
[0052] Step 202: Obtain a preset scheduling rule set in the container orchestration engine, where the preset scheduling rule is used to determine the corresponding container instances on different host nodes and the number of container instances.
[0053] In some embodiments, preset scheduling rules can be set in the container orchestration engine by defining a scheduling strategy. Exemplarily, the container orchestration engine can be used to set preset scheduling rules, determine the corresponding container instances on different host nodes, and the number of container instances; it can also be used to set resource limits and resource requests for each container to set resource quotas for different teams or users; it can also be used to configure a fault recovery mechanism, monitor whether the container has faults based on monitoring data, set alarms for faults, and restart the faulty container using a recovery mechanism to ensure continuous access to the container and service availability.
[0054] Optionally, the preset scheduling rules may include preset scaling rules, which are used to obtain the operating status of the container instances on each node based on the monitoring data collected in real time, and dynamically adjust the number of container instances deployed on each node to maximize the node utilization while ensuring the operating stability of the container instances.
[0055] Step 203: Based on the container resource requirements and resource utilization, determine the target host node corresponding to the container instance through a preset scheduling rule.
[0056] Optionally, step 203 may specifically include: based on the container resource demand, obtaining the application resource demand of the application in the container instance; and determining the target host node that matches the application resource demand according to the resource utilization and preset scheduling rules.
[0057] Optionally, based on the container resource requirements, the application resource requirements of the application in the container instance are obtained, which may specifically include: predicting the load data of the application based on the container resource requirements; and determining the application resource requirements of the application according to the load data and the application characteristics and business priorities of the application.
[0058] Exemplarily, a monitoring agent may be used to obtain current application load data, and based on the current load data, application characteristics, and business priorities, the application resource requirements of the application may be determined.
[0059] For example, the current container resource demand can be obtained, and a load prediction model can be generated based on historical container resource demand and historical resource data. The load prediction model can be used to predict application load data in the future. Based on the predicted load data, application characteristics, and business priorities of the application, the application resource demand of the application can be comprehensively determined. Then, based on the application resource demand, the target host node can be determined to reduce the load pressure of the system and improve the stability and performance of the system.
[0060] Specifically, when the load of an application increases, more resources can be automatically allocated to the application to ensure that its performance is not restricted; when the load of an application decreases, excess resources can be released to avoid resource waste.
[0061] Optionally, the method of this embodiment may also include: configuring a resource quota corresponding to the application through a container orchestration engine according to the application resource requirements of the application; or, creating a resource pool according to the application resource requirements of the application, and determining the resource quota corresponding to the application in the resource pool.
[0062] Step 204: Schedule the container instance to the target host node.
[0063] Exemplarily, according to the preset scheduling rules, the target host node corresponding to each container instance is determined, and then the container instance is scheduled to different target host nodes to reduce the load pressure of the system. Figure 3 As shown, the container Pod is deployed to different nodes. The distribution model of Pod between nodes is as follows:
[0064] N={Node 1 ,Node 2 ,Node 3 …,Node n}, N can represent the node set in the system, n is the total number of nodes, and a single node can be represented as Node i , i can represent the node number; i∈[1,n], P can represent the set of all Pods in the system, that is, P={Pod 1 ,Pod 2 ,Pod 3 …,Pod m}, m represents the total number of Pods, and a single Pod can be represented as Pod j ,j can represent the Pod number, j∈[1,m], assuming that at a certain node Node i There is a group of Pods on the node. C is used to represent the distribution of Pods in the node. i = {Pod 1 ,Pod 2 ,Pod 3 …,Pod k}, k represents Node i The number of Pods on the network can be expressed as: 1 = {Pod 1 ,Pod 4}, C 2 = {Pod 3 ,Pod 5}, C 3 = {Pod 2 ,Pod 6}.
[0065] In order to illustrate the specific implementation process of the above embodiments, the following application scenarios are given, such as Figure 4 As shown, but not limited to:
[0066] S1: Application resource demand planning: Analyze the application resource requirements of containerized applications and determine the amount of resources required for each container instance based on the application's performance indicators and load characteristics. Application resource demand planning includes collecting resource data such as the node's CPU usage, memory consumption, disk space, and network traffic.
[0067] S2: Resource limits and quota settings: Set resource limits and requests for containers in the container orchestration engine (such as Kubernetes), and set resource quotas for different teams or users to avoid resource competition and abuse;
[0068] S3: Real-time monitoring and indicator collection: Deploy monitoring agents (such as Node Exporter and cAdvisor) to collect resource utilization data of container instances and hosts, integrate monitoring data into the central system, and monitor the resource usage of containers and clusters in real time. The data obtained by the monitoring system can more accurately understand the status of the container cluster and make adjustments based on actual conditions. Real-time monitoring and indicator collection in S3 includes collecting indicator data of node load, container operating status, network latency, response time, and throughput, and associating it with node resource data.
[0069] S4: Automated scaling mechanism implementation: Based on monitoring data and preset rules, dynamically adjust the number of container instances according to the container load and resource utilization;
[0070] S5: Scheduling strategy and resource awareness: By defining the scheduling strategy, set the preset scheduling rules in the container orchestration engine; the preset scheduling rules are as follows: Figure 5 As shown, the following steps may be specifically included:
[0071] Step 1: Based on the monitoring data provided by the monitoring system in real time, develop an automated adjustment mechanism so that the container scheduling strategy can dynamically adjust resource allocation according to the actual needs of the application, more accurately understand the status of the container cluster, and promptly discover the node load situation to avoid insufficient or wasted resources. This can improve the system's ability to perceive and respond to the health status of the cluster, automatically adjust resource allocation based on real-time data, improve the system's adaptability and resource utilization, improve application performance and stability, avoid performance degradation due to insufficient resources, reduce administrator manual intervention, and reduce management costs and manpower investment;
[0072] Step 2: Introduce intelligent scheduling algorithms that not only consider static resource configuration, but also combine real-time load, application characteristics, and business priority factors to dynamically select the best host node for container deployment. These algorithms can be based on machine learning or deep learning technology, and predict future loads by analyzing historical data and pattern recognition, and make corresponding scheduling decisions. Dynamically select the best host node for container deployment, improve deployment efficiency and resource utilization, and combine real-time load, application characteristics, business priority and other factors to provide a more intelligent resource allocation strategy, which can reduce system load pressure and improve system stability and performance;
[0073] Step 3: Strengthen the multi-tenant resource isolation mechanism to ensure that resources between different tenants are isolated from each other, avoid resource competition and interference between different tenants, improve the stability and security of the system, provide more flexible resource allocation and management, meet the needs of different tenants, and strengthen the management and supervision of resources in a multi-tenant environment; Step 3 uses the mechanisms of namespace, resource quota, and network policy to achieve multi-tenant resource isolation and security protection;
[0074] Step 4: Provide flexible multi-resource pool management functions, allowing users to create and manage multiple resource pools according to needs. Each resource pool can have different resource quotas and scheduling policies, which can better meet different application scenarios and business needs, improve resource utilization and management efficiency, and optimize the overall performance and expansion of the system;
[0075] Step 5: Implement an elastic scheduling mechanism to dynamically adjust the number and distribution of container instances according to load conditions. Combined with automatic scaling policies, the container cluster can be automatically expanded or shrunk according to load changes. As a possible implementation, the automatic scaling mechanism can be used to implement dynamic scheduling of container instances. Specifically, the number of container instances can be dynamically adjusted according to the container load and resource utilization based on monitoring data and preset scaling rules;
[0076] Step 6: When node resources are insufficient or failures occur, migrate and reschedule containers to ensure continuous operation of containers. Consider the impact of container migration on service performance and minimize service interruption time caused by migration. Use automated monitoring systems and tuning tools to continuously optimize container resource utilization and performance.
[0077] S6: Container resource reservation and sharing: Reserve certain resources for key applications or sensitive tasks to ensure their performance and stability. Consider the sharing of container resources in resource management to avoid resource waste and redundancy.
[0078] S7: Fault recovery and fault tolerance mechanisms: Configure fault recovery mechanisms in the container orchestration engine, such as automatically restarting failed container instances, designing a high-availability architecture for containers, and ensuring continuous access to and service availability of containers through container orchestration tools and service discovery mechanisms.
[0079] The real-time monitoring system can collect the resource utilization, load conditions, and performance indicators of applications of each node in the container cluster, which helps to more accurately understand the operating status of the cluster, detect abnormal situations in time and make corresponding adjustments to ensure system stability and performance.
[0080] Compared with the current existing technology, this embodiment can set preset scheduling rules in the container orchestration engine. The preset scheduling rules are used to determine the corresponding container instances on different host nodes, as well as the number of container instances. According to resource utilization and preset scheduling rules, the target host node that matches the application resource requirements of the application in the container is determined, so as to dynamically adjust the node according to the application requirements of the application and improve the running performance of the application.
[0081] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in the embodiment provides a container instance scheduling device, such as Figure 6 As shown, the device includes: an acquisition module 31, a determination module 32, and a scheduling module 33.
[0082] An acquisition module 31 is configured to acquire monitoring data using a monitoring agent, the monitoring data including container resource requirements corresponding to the container instance and resource utilization rates of different host nodes;
[0083] A determination module 32 is configured to determine a target host node corresponding to the container instance according to the container resource requirements and resource utilization;
[0084] The scheduling module 33 is configured to schedule the container instance to the target host node.
[0085] In some examples of this embodiment, the determination module 32 is specifically configured to obtain a preset scheduling rule set in the container orchestration engine, where the preset scheduling rule is used to determine the corresponding container instances on different host nodes, as well as the number of container instances; based on the container resource requirements and resource utilization, the target host node corresponding to the container instance is determined through the preset scheduling rule.
[0086] In some examples of this embodiment, the determination module 32 is specifically configured to obtain the application resource requirements of the application in the container instance based on the container resource requirements; and determine the target host node that matches the application resource requirements based on the resource utilization and preset scheduling rules.
[0087] In some examples of this embodiment, the determination module 32 is specifically configured to predict the load data of the application based on the container resource requirements; and determine the application resource requirements of the application according to the load data and the application characteristics and business priorities of the application.
[0088] In some examples of this embodiment, the acquisition module 31 is specifically configured to use a monitoring agent to acquire resource usage corresponding to different resource types in a host node; and determine the resource utilization rate of the host node based on the resource usage.
[0089] In some examples of this embodiment, the acquisition module 31 is specifically configured to configure the resource quota corresponding to the application through the container orchestration engine according to the application resource requirements of the application; or, to create a resource pool according to the application resource requirements of the application and determine the resource quota corresponding to the application in the resource pool.
[0090] It should be noted that for other corresponding descriptions of the functional units involved in the container instance scheduling device provided in this embodiment, please refer to Figure 1 and Figure 2 The corresponding description in will not be repeated here.
[0091] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0092] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0093] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the method of the implementation scenario of the present application.
[0094] Based on the above Figure 1 and Figure 2 The method shown, and Figure 6In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The method shown.
[0095] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0096] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0097] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of this embodiment, a preset scheduling rule can be set in the container orchestration engine, and the preset scheduling rule is used to determine the corresponding container instances on the different host nodes, as well as the number of container instances. According to the resource utilization and the preset scheduling rule, the target host node that matches the application resource requirements of the application in the container is determined, so as to dynamically adjust the corresponding node according to the application requirements of the application and improve the operation performance of the application.
[0099] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0100] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims
1. A container instance scheduling method, characterized in that: include: Using a monitoring agent to obtain monitoring data, the monitoring data includes container resource requirements corresponding to the container instance and resource utilization rates of different host nodes; Determining a target host node corresponding to the container instance according to the container resource demand and the resource utilization; The container instance is scheduled to the target host node.
2. The method according to claim 1, characterized in that The determining, according to the container resource requirement and the resource utilization, a target host node corresponding to the container instance includes: Obtaining a preset scheduling rule set in the container orchestration engine, wherein the preset scheduling rule is used to determine the corresponding container instances on the different host nodes and the number of container instances; Based on the container resource demand and the resource utilization, a target host node corresponding to the container instance is determined through a preset scheduling rule.
3. The method according to claim 2, characterized in that The determining, based on the container resource demand and the resource utilization, a target host node corresponding to the container instance by a preset scheduling rule includes: Based on the container resource requirement, obtaining the application resource requirement of the application in the container instance; The target host node matching the application resource requirement is determined according to the resource utilization and the preset scheduling rule.
4. The method according to claim 3, characterized in that The obtaining, based on the container resource requirement, the application resource requirement of the application in the container instance includes: Predicting the load data of the application based on the container resource demand; Determine application resource requirements of the application according to the load data and application characteristics and business priorities of the application.
5. The method according to claim 1, characterized in that The method further comprises: Using the monitoring agent, obtaining resource usage corresponding to different resource types in the host node; Based on the resource usage, a resource utilization rate of the host node is determined.
6. The method according to claim 4, characterized in that The method further comprises: According to the application resource requirements of the application, the resource quota corresponding to the application is configured by the container orchestration engine; or, A resource pool is created according to the application resource demand of the application, and a resource quota corresponding to the application in the resource pool is determined.
7. A container instance scheduling device, characterized in that: include: An acquisition module is configured to acquire monitoring data using a monitoring agent, wherein the monitoring data includes a container resource demand corresponding to the container instance and resource utilization rates of different host nodes; A determination module is configured to determine a target host node corresponding to the container instance according to the container resource demand and the resource utilization; The scheduling module is configured to schedule the container instance to the target host node.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product having a computer program stored thereon, characterized in that: When the computer program product is executed by a processor, the method according to any one of claims 1 to 6 is implemented.