Kubernetes cluster resource scheduling method and device, electronic equipment and storage medium
By configuring the blocking factor and setting the scheduling time and frequency, the resource usage of the Kubernetes cluster node server is dynamically adjusted, which solves the problem of low resource utilization in the existing technology, achieves efficient resource utilization and cost reduction, and ensures high application performance. performance and reliability.
Patent Information
- Application Number
- CN202410820658.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-17
AI Technical Summary
The existing Kubernetes cluster resource scheduling strategy cannot effectively improve resource utilization and reduce resource usage costs, resulting in resource waste and business impact.
By configuring the blocking factor, setting the scheduling frequency and scheduling period, dynamically adjust the resource usage of the node server to achieve resource blocking and unblocking, and release important applications to the emergency node server to optimize resource allocation.
It improves the resource utilization of Kubernetes clusters, guarantees the resource requirements of key applications, realizes dynamic resource adjustment, optimizes resource allocation, ensures the high performance and reliability of applications, and reduces resource usage costs.
Smart Images

Figure CN118656173A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a Kubernetes cluster resource scheduling method, device, electronic device and storage medium. Background Art
[0002] The emergence of cloud platforms means that users do not need to master cloud computing technology. They only need to rent resources provided by cloud platforms according to their own needs, reducing their software and hardware investment costs. However, existing cloud platforms usually provide fixed-size resources for each user's business system based on user needs. When the business needs of the user's business system change, such as when business needs increase, the existing resources may not be sufficient to meet the business needs, which will affect the normal operation of the business system. When business needs decrease, part of the existing resources are idle, which makes the cloud platform's resource rate low and also wastes users' usage costs to a certain extent.
[0003] However, the effects of Kubernetes resource scheduling strategies and algorithms, such as binary packaging algorithms, resource requirements and restrictions, affinity and anti-affinity, and node selectors, are not good enough to improve the utilization of Kubernetes resources and reduce the cost of Kubernetes resource usage.
[0004] Therefore, there is an urgent need for a Kubernetes cluster resource scheduling method that can automatically manage the scheduling status of server nodes in the Kubernetes cluster, optimize resource usage and cluster performance, and improve the utilization rate of Kubernetes cluster resources. Summary of the invention
[0005] The embodiments of the present invention provide a Kubernetes cluster resource scheduling method to solve the problem that the prior art cannot improve the utilization rate of Kubernetes resources and reduce the cost of using Kubernetes resources. The technical solution is as follows:
[0006] According to one aspect of the present invention, a Kubernetes cluster resource scheduling method includes: configuring a blocking factor for the Kubernetes cluster, and configuring an unblocking value and a blocking value according to the blocking factor; setting a scheduling frequency for the Kubernetes cluster, and blocking and unblocking node servers in the Kubernetes cluster according to the scheduling frequency; setting a scheduling period for the Kubernetes cluster, and adjusting the application of the node server in the Kubernetes cluster according to the resource utilization rate of the node server in the Kubernetes cluster during the scheduling period; setting an emergency node server, and publishing applications that meet the set importance and complexity to the emergency node server.
[0007] In one of the embodiments, blocking and unblocking the node server in the Kubernetes cluster are achieved by the following steps: when the resource usage of the node server in the Kubernetes cluster is higher than the blocking value, the node server is blocked; when the resource usage of the node server in the Kubernetes cluster is lower than the unblocking value, the node server is unblocked.
[0008] In one of the embodiments, adjusting the application of the node server according to the resource utilization of the node server in the Kubernetes cluster is achieved by the following steps: switching the application on the node server whose resource utilization in the Kubernetes cluster is higher than a set threshold to the node server whose resource utilization is lower than the set threshold.
[0009] According to one aspect of the present invention, a Kubernetes cluster resource scheduling device includes: a parameter configuration module, which is used to configure a blocking factor for the Kubernetes cluster, and configure an unblocking value and a blocking value according to the blocking factor; a server state switching module, which is used to set a scheduling frequency for the Kubernetes cluster, and block and unblock node servers in the Kubernetes cluster according to the scheduling frequency; a server application adjustment module, which is used to set a scheduling period for the Kubernetes cluster, and adjust the application of the node server according to the resource utilization rate of the node server in the Kubernetes cluster during the scheduling period; a flexible emergency module, which is used to set an emergency node server and publish applications that meet the set importance and complexity to the emergency node server.
[0010] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the Kubernetes cluster resource scheduling method as described above.
[0011] According to one aspect of the present invention, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement the Kubernetes cluster resource scheduling method as described above.
[0012] The beneficial effects brought by the technical solution provided by the present invention are:
[0013] In the above technical scheme, the present invention first configures a blocking factor for the Kubernetes cluster, configures an unblocking value and an adding blocking value according to the blocking factor, then sets a scheduling frequency for the Kubernetes cluster, blocks and unblocks the node servers in the Kubernetes cluster according to the scheduling frequency, and then sets a scheduling period for the Kubernetes cluster. During the scheduling period, the applications of the node servers are adjusted according to the resource utilization rate of the node servers in the Kubernetes cluster. Finally, an emergency node server is set, and applications that meet the set importance and complexity are published to the emergency node server. By introducing resource management and scheduling strategies and controlling resource allocation on the node server, the resource utilization rate of the Kubernetes cluster can be improved, the resource requirements of key applications can be guaranteed, dynamic resource adjustment can be achieved, the flexibility of cluster management can be improved, resource allocation can be optimized, the high performance and reliability of applications can be ensured, and the overall efficiency of the cluster can be improved, thereby effectively solving the problem that the prior art cannot improve the utilization rate of Kubernetes resources and reduce the cost of using Kubernetes resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0015] Figure 1 This is a flow chart of a Kubernetes cluster resource scheduling method according to an exemplary embodiment;
[0016] Figure 2 This is a schematic diagram of a Kubernetes cluster resource scheduling method in an application scenario;
[0017] Figure 3 This is a schematic diagram of the results of a Kubernetes cluster resource scheduling method in another application scenario;
[0018] Figure 4 is a block diagram of a Kubernetes cluster resource scheduling device according to an exemplary embodiment;
[0019] Figure 5 is a hardware structure diagram of an electronic device according to an exemplary embodiment;
[0020] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0021] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0022] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0023] Kubernetes cluster resource scheduling: Resource scheduling is a core function in Kubernetes, responsible for intelligently placing containerized applications in the form of Pods on appropriate nodes in the cluster for operation. This process involves the collaborative work of multiple components, mainly including the Kubernetes scheduler kube-schedu l er and the node Node.
[0024] The present invention provides a Kubernetes cluster resource scheduling method, which controls resource allocation on a node server by introducing resource management and scheduling strategies, thereby solving the problem that the prior art cannot improve the utilization rate of Kubernetes resources and reduce the cost of using Kubernetes resources. The Kubernetes cluster resource scheduling method is applicable to a Kubernetes cluster resource scheduling device, which may be an electronic device. The Kubernetes cluster resource scheduling method in the embodiment of the present invention can be applied to a variety of scenarios, such as Kubernetes cluster resource scheduling, etc.
[0025] See also Figure 1 An embodiment of the present invention provides a Kubernetes cluster resource scheduling method, which is applicable to electronic devices.
[0026] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.
[0027] like Figure 1 As shown, the method may include the following steps:
[0028] Step 110, configure a blocking factor for the Kubernetes cluster, and configure an unblocking value and a blocking value according to the blocking factor.
[0029] In one possible implementation, the blocking factor is configured by calculating the upper and lower thresholds of the Kubernetes cluster resources. The unblocking value is equal to the average cluster resource usage minus the blocking factor, and the blocking value is equal to the average cluster resource usage plus the blocking factor.
[0030] In one possible implementation, if the blocking value is greater than 95%, it is corrected to 95%.
[0031] Step 130, setting a scheduling frequency for the Kubernetes cluster, and blocking and unblocking the node servers in the Kubernetes cluster according to the scheduling frequency.
[0032] The scheduling frequency refers to the interval for scheduling resources in the Kubernetes cluster, which can be three minutes, five minutes, half an hour, etc. It is set according to the application scenario and is not limited here.
[0033] Among them, node blocking Node (Cordon): mark a node as unschedulable (unschedu l ab le), which means that the scheduler will no longer schedule new Pods to the node, but does not affect the Pods already running on the node; node uncordon: cancel the unschedulable state of the node and restore it to a schedulable state, and the scheduler can schedule new Pods to the node again.
[0034] In one possible implementation, when the resource usage of a node server in a Kubernetes cluster is higher than a blocking value, the node server is blocked; when the resource usage of a node server in a Kubernetes cluster is lower than an unblocking value, the node server is unblocked.
[0035] Step 150, setting a scheduling period for the Kubernetes cluster, and adjusting the application of the node server according to the resource utilization rate of the node server in the Kubernetes cluster during the scheduling period.
[0036] The scheduling period refers to the time period when the Kubernetes cluster has no business processing or the time period with the least business processing.
[0037] In one possible implementation, an application on a node server whose resource usage in a Kubernetes cluster is higher than a set threshold is switched to a node server whose resource usage is lower than the set threshold.
[0038] Step 170: Set up an emergency node server, and publish applications that meet the set importance and complexity to the emergency node server.
[0039] Through the above process, the present invention first configures a blocking factor for the Kubernetes cluster, configures an unblocking value and an adding blocking value according to the blocking factor, then sets a scheduling frequency for the Kubernetes cluster, blocks and unblocks the node servers in the Kubernetes cluster according to the scheduling frequency, then sets a scheduling period for the Kubernetes cluster, adjusts the applications of the node servers according to the resource utilization rate of the node servers in the Kubernetes cluster during the scheduling period, and finally sets an emergency node server, publishes applications that meet the set importance and complexity to the emergency node server, and controls the resource allocation on the node server by introducing resource management and scheduling strategies, thereby improving the resource utilization rate of the Kubernetes cluster, ensuring the resource requirements of key applications, realizing dynamic resource adjustment and improving the flexibility of cluster management, optimizing resource allocation, ensuring the high performance and reliability of applications, and improving the overall efficiency of the cluster, thereby effectively solving the problem that the prior art cannot improve the resource utilization rate of Kubernetes and reduce the cost of using Kubernetes resources.
[0040] In one application scenario, Figure 2 A flowchart of a Kubernetes cluster resource scheduling method is shown.
[0041] like Figure 2As shown, first, according to the data obtained by monitoring the Kubernetes cluster at ordinary times, the blocking factor is configured, the average value of cluster resource utilization is subtracted from the blocking factor to obtain the unblocking value, the average value of cluster resource utilization is added to the blocking factor to obtain the added blocking value, and the blocking and unblocking strategies are formulated according to the unblocking value and the added blocking value. If the calculated added blocking value is greater than 95%, it is corrected to 95%. When the resource utilization rate of the node server is higher than the added blocking value, the node node is blocked. When the resource utilization rate of the node server is lower than the unblocking value, the node node is unblocked. The resource utilization rates of the node servers of the k8s cluster are sorted, and the four nodes with the lowest utilization rate are unblocked to ensure that at least four servers are available in the entire cluster. The above process is executed every 3 minutes using a scheduled task. Resource adjustment is performed in the early morning of each day, when there is no business processing, and the applications on the NODE nodes with resource utilization rates higher than the specified threshold are driven to the nodes with low resource utilization rates. Finally, the stain and tolerance are configured to ensure that important applications and applications with specific requirements can be published to the specified node server. The scheduling topology is configured through the above process to improve the performance of the application.
[0042] The above process automatically manages the scheduling status of server nodes in the Kubernetes cluster based on the resource utilization of the cluster, optimizes resource utilization and cluster performance through blocking and unblocking operations, and controls resource allocation on node servers by configuring blocking factors, unblocking values, and blocking values. The blocking mechanism prevents excessive resource utilization, while the unblocking mechanism releases underutilized resources, maximizes resource utilization, and reduces idle resources. By dynamically adjusting resource allocation, the cluster can make better use of available resources, thereby improving overall efficiency.
[0043] Through the above process, the embodiment of the present invention can ensure that key applications can obtain the required resources. By setting the scheduling frequency and scheduling period, the resource utilization rate can be regularly evaluated and adjusted accordingly. The introduced scheduling period mechanism allows the application to be adjusted in real time according to the resource utilization rate in the node server. This dynamic adjustment capability can ensure that the application always has the best resource allocation. By publishing these applications to dedicated node servers with additional resources and processing capabilities, this can improve the reliability and responsiveness of key applications, especially for applications that require a large amount of resources and real-time processing.
[0044] In another application scenario, Figure 3 A schematic diagram of the results of a Kubernetes cluster resource scheduling method is provided.
[0045] like Figure 3As shown, the present invention can make the average resource utilization rate of the Kubernetes cluster about 90%, can increase the robustness of cluster deployment applications, can ensure the operation of advanced applications, and obtain a more reliable and robust operating state. The technical solution can improve the resource utilization rate of the Kubernetes cluster, guarantee the resource requirements of key applications, realize dynamic resource adjustment, and improve cluster management flexibility by introducing blocking factors, unlocking values, adding blocking values, scheduling frequency, scheduling time period, and emergency node servers. This method can optimize resource allocation, ensure the high performance and reliability of applications, and improve the overall efficiency of the cluster.
[0046] Through the above process, the embodiment of the present invention first configures a blocking factor for the Kubernetes cluster, configures an unblocking value and an adding blocking value according to the blocking factor, then sets a scheduling frequency for the Kubernetes cluster, blocks and unblocks the node servers in the Kubernetes cluster according to the scheduling frequency, and then sets a scheduling period for the Kubernetes cluster. During the scheduling period, the applications of the node servers are adjusted according to the resource utilization rate of the node servers in the Kubernetes cluster. Finally, an emergency node server is set, and applications that meet the set importance and complexity are published to the emergency node server. By introducing resource management and scheduling strategies and controlling resource allocation on the node server, the resource utilization rate of the Kubernetes cluster can be improved, the resource requirements of key applications can be guaranteed, dynamic resource adjustment can be achieved, and the flexibility of cluster management can be improved. Resource allocation is optimized, high performance and reliability of applications can be ensured, and the overall efficiency of the cluster can be improved, thereby effectively solving the problem that the prior art cannot improve the utilization rate of Kubernetes resources and reduce the cost of using Kubernetes resources.
[0047] The following is an embodiment of the device of the present invention, which can be used to execute the Kubernetes cluster resource scheduling method involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of the Kubernetes cluster resource scheduling method involved in the present invention.
[0048] See also Figure 4 , an embodiment of the present invention provides a Kubernetes cluster resource scheduling device 800.
[0049] The device 800 includes but is not limited to: a parameter configuration module 810 , a server state switching module 830 , a server application adjustment module 850 and a flexible emergency module 870 .
[0050] Among them, the parameter configuration module 810 is used to configure the blocking factor for the Kubernetes cluster, and configure the unblocking value and the blocking value according to the blocking factor.
[0051] The server state switching module 830 is used to set a scheduling frequency for the Kubernetes cluster, and block and unblock the node servers in the Kubernetes cluster according to the scheduling frequency.
[0052] The server application adjustment module 850 is used to set a scheduling period for the Kubernetes cluster and adjust the application of the node server according to the resource utilization rate of the node server in the Kubernetes cluster during the scheduling period.
[0053] The flexible emergency module 870 is used to set up an emergency node server and publish applications that meet the set importance and complexity to the emergency node server.
[0054] It should be noted that the Kubernetes cluster resource scheduling provided in the above embodiment only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the Kubernetes cluster resource scheduling device will be divided into different functional modules to complete all or part of the functions described above.
[0055] In addition, the Kubernetes cluster resource scheduling device provided in the above embodiment and the embodiment of the Kubernetes cluster resource scheduling method belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0056] Figure 5 The present invention schematically illustrates the structure of an electronic device according to an exemplary embodiment.
[0057] It should be noted that the electronic device is only an example adapted to the present invention and cannot be considered to provide any limitation on the scope of use of the present invention. The electronic device cannot be interpreted as requiring dependence on or having Figure 5 One or more components of exemplary electronic device 2000 are shown.
[0058] The hardware structure of the electronic device 2000 may vary greatly due to differences in configuration or performance, such as Figure 5 As shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.
[0059] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000 .
[0060] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted by the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Figure 5 As shown, this is not intended to be a specific limitation.
[0061] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.
[0062] Among them, the operating system 251 is used to manage and control various hardware devices and application programs 253 on the electronic device 2000 to enable the central processing unit 270 to calculate and process the massive data 255 in the memory 250. It can be Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0063] The application program 253 is a computer-readable instruction that performs at least one specific task based on the operating system 251, and may include at least one module ( Figure 5 (not shown), each module may respectively include computer-readable instructions for the electronic device 2000. For example, the Kubernetes cluster resource scheduling device may be regarded as an application 253 deployed on the electronic device 2000.
[0064] The data 255 may be signal information, etc., stored in the memory 250 .
[0065] The central processor 270 may include one or more processors, and is configured to communicate with the memory 250 through at least one communication bus to read the computer-readable instructions stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, the Kubernetes cluster resource scheduling method is completed by the central processor 270 reading a series of computer-readable instructions stored in the memory 250.
[0066] In addition, the present invention can also be implemented by hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present invention is not limited to any specific hardware circuits, software, or a combination of the two.
[0067] See also Figure 6In an embodiment of the present invention, an electronic device 4000 is provided. The electronic device 4000 may include: a desktop computer, a laptop computer, a server, etc. with sensor recognition capability.
[0068] exist Figure 6 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.
[0069] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industrial Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0070] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception, etc. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0071] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0072] The memory 4003 can be a ROM (Read On Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electric Erasable Programmable Read On Memory), a CD-ROM (Compact Disk Read On Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 4000, but is not limited to this.
[0073] The memory 4003 stores computer-readable instructions, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .
[0074] The computer-readable instructions are executed by one or more processors 4001 to implement the Kubernetes cluster resource scheduling method in the above-mentioned embodiments.
[0075] In addition, an embodiment of the present invention provides a storage medium on which computer-readable instructions are stored. The computer-readable instructions are executed by one or more processors to implement the Kubernetes cluster resource scheduling method as described above.
[0076] A computer program product is provided in an embodiment of the present invention. The computer program product includes computer-readable instructions. The computer-readable instructions are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the Kubernetes cluster resource scheduling method as described above.
[0077] Compared with the related art, the present invention has the following beneficial effects:
[0078] 1. The present invention first configures a blocking factor for a Kubernetes cluster, configures an unblocking value and a blocking value according to the blocking factor, then sets a scheduling frequency for the Kubernetes cluster, blocks and unblocks node servers in the Kubernetes cluster according to the scheduling frequency, then sets a scheduling period for the Kubernetes cluster, adjusts the applications of the node servers according to the resource utilization rate of the node servers in the Kubernetes cluster during the scheduling period, and finally sets an emergency node server, publishes applications that meet the set importance and complexity to the emergency node server, and controls resource allocation on the node server by introducing resource management and scheduling strategies, thereby improving resource utilization of the Kubernetes cluster, ensuring resource requirements of key applications, realizing dynamic resource adjustment and improving cluster management flexibility, optimizing resource allocation, ensuring high performance and reliability of applications, and improving the overall efficiency of the cluster, thereby effectively solving the problem that the prior art cannot improve the utilization rate of Kubernetes resources and reduce the cost of using Kubernetes resources.
[0079] 2. The present invention improves resource utilization: By configuring the blocking factor, unblocking value and blocking value, the resource allocation on the node server can be controlled. The blocking mechanism can prevent excessive resource utilization, while the unblocking mechanism can release underutilized resources. This can maximize resource utilization and reduce resources.
[0080] 3. The present invention can provide resource guarantee for key applications: ensure that key applications can obtain the required resources. By setting the scheduling frequency and scheduling period, the resource utilization rate can be regularly evaluated and adjusted accordingly. If the resource utilization rate of a node server is too high, some applications can be transferred to other node servers to ensure that key applications obtain sufficient resources. This can improve the stability and performance of key applications.
[0081] 4. The scheduling period mechanism introduced in the present invention allows real-time adjustment of applications according to resource utilization in the node servers. If a node server is short of resources, some applications can be transferred to other node servers to balance the load. Similarly, if a node server has extra resources, applications on other node servers can be transferred to this node server to better utilize resources. This dynamic adjustment capability can ensure that applications always have the best resource allocation.
[0082] 5. The present invention sets up emergency node servers to handle important and complex applications. By publishing these applications to dedicated node servers with additional resources and processing power, they can be guaranteed to receive the highest priority and best performance. This can improve the reliability and responsiveness of critical applications, especially for applications that require a lot of resources and real-time processing.
[0083] 6. By implementing these resource management and scheduling strategies, cluster administrators can manage Kubernetes clusters more flexibly. They can dynamically adjust resource allocation to adapt to changing needs, ensure high availability of key applications, and optimize resource utilization. This fine-grained control can improve the efficiency and effectiveness of cluster management.
[0084] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0085] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A Kubernetes cluster resource scheduling method, It is characterized in that The method comprises: Configure a blocking factor for the Kubernetes cluster, and configure an unblocking value and an adding blocking value according to the blocking factor; Setting a scheduling frequency for the Kubernetes cluster, and blocking and unblocking the node servers in the Kubernetes cluster according to the scheduling frequency; Setting a scheduling period for the Kubernetes cluster, and adjusting the application of the node server in the Kubernetes cluster according to the resource utilization rate of the node server in the Kubernetes cluster during the scheduling period; the scheduling period refers to the time period with the least demand for Kubernetes cluster business processing; An emergency node server is set up, and applications whose importance and complexity meet the settings are published to the emergency node server.
2. The Kubernetes cluster resource scheduling method according to claim 1, It is characterized in that The blocking and unblocking of the node server in the Kubernetes cluster includes: When the resource usage rate of the node server in the Kubernetes cluster is higher than the blocking value, the node server is blocked; When the resource usage of the node server in the Kubernetes cluster is lower than the unblocking value, the node server is unblocked.
3. The Kubernetes cluster resource scheduling method according to claim 1, It is characterized in that The adjusting the application of the node server according to the resource utilization rate of the node server in the Kubernetes cluster includes: Switch the application on the node server whose resource utilization rate in the Kubernetes cluster is higher than the set threshold to the node server whose resource utilization rate is lower than the set threshold.
4. A Kubernetes cluster resource scheduling device, It is characterized in that The device comprises: The parameter configuration module is used to configure the blocking factor for the Kubernetes cluster and configure the unblocking value and the blocking value according to the blocking factor; The server status switching module is used to set the scheduling frequency for the Kubernetes cluster and block and unblock the node servers in the Kubernetes cluster according to the scheduling frequency; The server application adjustment module is used to set a scheduling period for the Kubernetes cluster and adjust the application of the node server according to the resource utilization rate of the node server in the Kubernetes cluster during the scheduling period; The flexible emergency module is used to set up emergency node servers and publish applications that meet the set importance and complexity to the emergency node servers.
5. An electronic device, It is characterized in that include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the Kubernetes cluster resource scheduling method as described in any one of claims 1 to 3.
6. A storage medium having computer-readable instructions stored thereon, It is characterized in that The computer-readable instructions are executed by one or more processors to implement the Kubernetes cluster resource scheduling method as described in any one of claims 1 to 3.
Citation Information
Cited By
Kubernetes adaptive deployment method based on elastic resource scheduling
CN120909604A
