Capacity expansion method, device and equipment of Pod cluster, medium and program product

By obtaining the indicators of the Pod cluster and determining its status value, it realizes that after the Pod is virtually loop caused by memory overflow, it uses HPA to automatically expand capacity, solving the problem that HPA cannot expand capacity in an unhealthy state of the Pod, and improving resource utilization.

CN119829205APending Publication Date: 2025-04-15BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411896200.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In Kubernetes environment, the Pod cluster has memory overflow (OOM) due to the memory requirement exceeding the resource usage limit, causing the Pod to restart. HPA cannot expand the capacity when the Pod is in an unhealthy state, and it falls into a dead loop.

Method used

By obtaining the metric set of each Pod in the Pod cluster, including the reason for the last terminated run and the current running state, determine the status value of the Pod to indicate whether it is in a memory overflow state. According to the number of Pods whose status value is the first preset value, the capacity expansion process of the corresponding scale is performed, and the capacity expansion is achieved using HPA.

Benefits of technology

After the Pod's vicious cycle caused by memory overflow, the Pod's indicators are converted into HPA-recognizable status values ​​to achieve automatic expansion, avoiding idle resources and improving resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829205A_ABST
    Figure CN119829205A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a Pod cluster capacity expansion method and device, equipment, a medium and a program product, and the method comprises the following steps: obtaining a reason of last running termination corresponding to each Pod in a Pod cluster and a running state of the Pod at the current moment; determining a state value corresponding to the Pod according to the reason and the operation state; carrying out expansion processing on the Pod cluster according to the number of the Pod with the state value being the first preset value in the Pod cluster; according to the scheme, after the Pod falls into an endless loop caused by memory overflow, the index corresponding to the Pod is converted into the state value which can be identified by the HPA, so that automatic capacity expansion is realized by utilizing the HPA. In addition, according to the embodiment, capacity expansion of a corresponding scale is carried out according to the number of the Pods with the state value being the first preset value in the cluster, so that resource idleness is reduced, and the resource utilization rate is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment, medium and program product for expanding a Pod cluster. Background Art

[0002] A Pod cluster is a collection of multiple Pods in a Kubernetes (k8s) environment. When a Pod is created, a resource usage limit is set for it, which usually includes CPU and memory.

[0003] When a large number of requests are received in a short period of time, it is easy to cause out of memory (OOM) because the memory demand exceeds the upper limit of the memory resource usage of the Pod. Out of memory will cause the Pod to restart, but HPA (Horizontal Pod Autoscaler) cannot expand the capacity when the Pod is in an unhealthy state, causing the old Pod to restart continuously, falling into an infinite loop.

[0004] There are two solutions to Pod OOM errors. One is to issue an alarm and have the staff handle it, but this solution is time-consuming and has a poor user experience. The other is to give the Pod the maximum amount of resources when creating it to avoid OOM errors from the root, but this method will cause idle resources and huge cost increases. Summary of the invention

[0005] In order to solve the above technical problems, the present disclosure provides a Pod cluster expansion method, device, equipment, medium and program product.

[0006] In a first aspect, the present disclosure provides a method for expanding a Pod cluster, including:

[0007] Get the indicator set corresponding to each Pod in the Pod cluster, where the indicator set includes the reason why the Pod last terminated and the running status of the Pod at the current moment; determine the status value corresponding to the Pod according to the reason and the running status, where the status value is readable by the horizontal Pod autoscaler and is used to indicate whether the Pod is in a memory overflow state at the current moment; expand the Pod cluster according to the number of Pods in the Pod cluster whose status value is a first preset value, where the first preset value is used to indicate that the Pod is in a memory overflow state at the current moment.

[0008] In some optional implementations, determining a status value corresponding to the Pod according to the cause and the running status includes:

[0009] When the cause is memory overflow and the operation status is abnormal operation, the state value is determined to be a first preset value.

[0010] In some optional implementations, judging whether the Pod is in a memory overflow state at the current moment according to the cause and the running state further includes:

[0011] When the cause is any one except memory overflow, or the running state is normal operation, the state value is determined to be a second preset value, and the second preset value is used to indicate that the Pod is not in a memory overflow state at the current moment.

[0012] In some optional implementations, the Pod cluster is expanded according to the number of Pods whose status values ​​in the Pod cluster are the first preset values, including:

[0013] The number of Pods whose status values ​​are the first preset value is compared with a preset number threshold to obtain a comparison result; and a capacity expansion method corresponding to the comparison result is selected to expand the Pod cluster.

[0014] In some optional implementations, selecting a capacity expansion method corresponding to the comparison result to expand the Pod cluster includes:

[0015] When the number of Pods whose status value is the first preset value exceeds the preset number threshold, the Pod cluster is expanded by twice the number of Pods.

[0016] In some optional implementations, after the Pod cluster is expanded according to the number of Pods whose status values ​​in the Pod cluster are the first preset values, the method further includes:

[0017] Reduce the capacity of the Pod cluster.

[0018] In a second aspect, the present disclosure provides a capacity expansion device for a Pod cluster, including:

[0019] An acquisition module is used to obtain the indicator set corresponding to each Pod in the Pod cluster, and the indicator set includes the reason why the Pod was most recently terminated and the running status of the Pod at the current moment; a determination module is used to determine the status value corresponding to the Pod according to the reason and the running status, and the status value is readable by the horizontal Pod automatic scaler and is used to indicate whether the Pod is in a memory overflow state at the current moment; an expansion module is used to expand the Pod cluster according to the number of Pods in the Pod cluster whose status value is a first preset value, and the first preset value is used to indicate that the Pod is in a memory overflow state at the current moment.

[0020] In a third aspect, the present disclosure provides a computer device, comprising:

[0021] The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for expanding the capacity of the Pod cluster of the first aspect and any embodiment thereof by executing the computer instructions.

[0022] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for expanding the capacity of a Pod cluster of the first aspect and any embodiment thereof.

[0023] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for expanding the capacity of a Pod cluster of the first aspect and any embodiment thereof.

[0024] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0025] Obtain the reason for the most recent termination of each Pod in the Pod cluster and the running status of the Pod at the current moment; determine the status value corresponding to the Pod based on the reason and the running status; expand the Pod cluster based on the number of Pods in the Pod cluster whose status value is the first preset value; the above scheme can convert the indicators corresponding to the Pod into a status value recognizable by HPA after the Pod falls into an infinite loop caused by memory overflow, thereby using HPA to achieve automatic capacity expansion. In addition, this embodiment will expand the capacity of the corresponding scale based on the number of Pods in the cluster whose status value is the first preset value, so as to reduce idle resources and improve resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0027] In order to more clearly illustrate the embodiments of the present invention 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.

[0028] Figure 1 A schematic diagram of a flow chart of a method for expanding a Pod cluster provided in an embodiment of the present disclosure;

[0029] Figure 2 A structural connection diagram of a Pod cluster expansion device provided in an embodiment of the present disclosure;

[0030] Figure 3A structural connection diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0032] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0033] 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.

[0034] Before describing the embodiments of the present disclosure in detail, the relevant terms, expansion principles and background of the present invention are briefly introduced here.

[0035] (I) Related terms

[0036] Kubernetes (K8S): An open source container orchestration platform for automating the deployment, expansion, and management of containerized applications. It can coordinate applications to run on multiple server nodes to ensure high availability and scalability. Deployment and StatefulSet are workloads in a K8S cluster.

[0037] Deployment and StatefulSet: In the above two workloads, a certain Pod template is declared. You only need to modify the expected number of workloads, and K8S will create the corresponding number of Pods according to the Pod template. You do not need to manually create Pods one by one, and you can quickly scale the number of Pods. In this case, you do not need to pay attention to the difference between the two. One Deployment / StatefulSet corresponds to one Pod cluster.

[0038] Pod: It is the smallest deployable computing unit in K8S, which encapsulates one or more containers. The code programs developed by front-end applications and back-end applications will run in the K8S cluster in the form of Pod to process requests sent by users outside the cluster.

[0039] HPA: It is a component in K8S. HPA can be configured for a Deployment or StatefulSet. By monitoring the indicators of the Pods in the Deployment, it determines whether the expansion and contraction conditions are met, thereby automatically adjusting the number of Pods.

[0040] (II) Capacity Expansion Principle

[0041] Based on the expansion operation of Deployment, for example, the expected number of Pods for a Deployment is 1. Therefore, a Pod is created according to the Pod template description in the Deployment. The resource limit of the Pod is that the CPU usage does not exceed 300m (millicores) and the memory usage does not exceed 300mb. Set an HPA for automatic expansion of the Deployment. The set policy is that the average CPU usage of the Pod under the Deployment exceeds 100m, or the average memory usage exceeds 100mb. If it meets the set policy, the expected number of Pods is increased.

[0042] When the Pod processes user requests, the CPU usage is 200m and the memory usage is 200mb. At this time, the average CPU usage of the Pod under the Deployment is 200m (200m / 1), and the average memory usage is 200mb (200mb / 1). This exceeds the threshold set by the expansion strategy, so HPA increases the expected number of Pods for the Deployment to 2. When the number of Pods becomes 2, the requests will be evenly distributed to the two Pods if the number of user requests remains unchanged. Therefore, the CPU usage of the original Pod is reduced to 100m, and the memory usage is reduced to 100mb. Since the new Pod shares half of the user requests, the CPU usage of the new Pod becomes 100m, and the memory usage becomes 100mb.

[0043] After recalculation, it is determined that the average CPU usage of the Pod under this Deployment is 100m (i.e. (100m+100m) / (1+1)), and the average memory usage is 100mb (i.e. (100mb+100mb) / (1+1)). This is equal to the threshold set by the expansion strategy, so the Deployment expects the number of Pods to remain unchanged. At this point, this expansion is complete.

[0044] (III) Background of this case

[0045] When user requests increase dramatically in a short period of time and are continuously sent to a Pod, the resource requirements of the Pod increase, such as the CPU requirement is 400m and the memory requirement is 400mb. However, it is known that the CPU usage of the Pod does not exceed 300m and the memory usage does not exceed 300mb.

[0046] In fact, for CPU, the Pod can still only apply for 300m, but for memory, if the demand is greater than the limit, it will trigger an Out of Memory (OOM) error. Triggering an OOM error will cause the Pod to restart. However, since HPA cannot obtain the resource usage of the Pod when the Pod is in an unhealthy state, it cannot expand the capacity. Therefore, when an OOM error occurs, the commonly used expansion rules become invalid. Since there is no new Pod to help the original Pod share user requests, the original Pod will continue to restart due to OOM, thus falling into an infinite loop.

[0047] There are two solutions in the related technology. The first is to monitor the health status of the Pod. When the Pod is monitored to be in an unhealthy state, an alarm message is generated and sent to the staff, so as to solve the situation where the Pod is stuck in an infinite loop through manual intervention. The disadvantage of this method is that the process from the occurrence of the problem, to the triggering of the alarm, to the staff receiving the alarm message, to turning on the computer and logging into the server for manual processing is time-consuming, resulting in a poor customer experience. The second is to give the Pod the maximum amount of resources when limiting the resources of the Pod, and measure the upper limit values ​​of each dimension under this condition and put them in the product documentation for user reference. Although this solution avoids the occurrence of OOM errors from the root, since the demand of most users is not high, it will lead to idle resources, waste of a large amount of server resources, and huge cost increases.

[0048] To this end, the embodiments of the present disclosure provide a method, device, equipment, medium and program product for expanding the capacity of a Pod cluster. After the Pod falls into an infinite loop caused by memory overflow, the Pod cluster is automatically expanded by converting the indicators corresponding to the Pod into a state value recognizable by the HPA. In addition, the embodiments of the present disclosure also expand the capacity of the corresponding scale according to the number of Pods in the cluster whose state value is a first preset value, thereby reducing idle resources and improving resource utilization.

[0049] According to an embodiment of the present disclosure, an embodiment of a method for expanding the capacity of a Pod cluster is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0050] In this embodiment, a method for expanding the capacity of a Pod cluster is provided, which can be used on a Kubernetes platform. Figure 1 is a flow chart of a method for expanding a Pod cluster according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:

[0051] S101, obtaining an indicator set corresponding to each Pod in the Pod cluster, where the indicator set includes the reason why the Pod was last terminated and the running status of the Pod at the current moment.

[0052] Specifically, during the operation of the Pod cluster, the indicator receiver kube-state-metrics updates the indicator set corresponding to each Pod in real time according to the actual operation status of each Pod. The indicator set includes two indicator information, namely the reason why the Pod last terminated (kube_pod_container_status_last_terminated_reason) and the current operation status of the Pod (kube_pod_container_status_ready). The monitoring system prometheus integrated in the Kubernetes platform is called to regularly obtain the indicator set corresponding to each Pod in the Pod cluster from kube-state-metrics and store the indicator set in prometheus.

[0053] It should be noted that the indicator information may be expressed in the form of an indicator value, but is not limited to an indicator value. When the indicator information is expressed in the form of an indicator value, the meaning of the indicator value corresponding to each indicator is set by the staff. The indicator information involved in this disclosure is described here, and the subsequent embodiments recorded in this disclosure are described based on the information here. The indicator information is as follows:

[0054] kube_pod_container_status_last_terminated_reason{reason="OOMKilled"} is 1, indicating that the last termination of the Pod was due to memory overflow.

[0055] kube_pod_container_status_last_terminated_reason{reason="OOMKilled"} is 0, indicating that the last termination of the Pod was due to reasons other than out of memory. Other reasons include but are not limited to Completed, Failed, OOMKilled, Unknown, and Crashed.

[0056] kube_pod_container_status_ready is 1, indicating that the Pod is currently running normally.

[0057] kube_pod_container_status_ready is 0, indicating that the running status of the Pod at the current moment is abnormal.

[0058] For example, taking a Pod in a Pod cluster as an example, the obtained Pod indicator set is kube_pod_container_status_last_terminated_reason{reason="OOMKilled"} is 1 and kube_pod_container_status_ready is 0. According to the indicator information in the indicator set, the reason for the last termination of the Pod is memory overflow, and the running status of the Pod at the current moment is abnormal operation.

[0059] S102, determining a status value corresponding to the Pod according to the cause and the running status.

[0060] The status value is readable by the horizontal Pod autoscaler and is used to indicate whether the Pod is in a memory overflow state at the current moment. The status value is an indicator that can be recognized by the HPA.

[0061] Specifically, call prometheus-adapter, and determine the status value corresponding to the Pod according to the two indicator information corresponding to each pod stored in prometheus according to the preset rules. And write the status value corresponding to the Pod into the kube-apiserver component of the Kubernetes platform. The preset rules are used to characterize the correspondence between the two indicator information and the status value. It can be expressed in a simple mapping or an expression.

[0062] Exemplarily, in one embodiment, the preset rule is the following mapping relationship.

[0063] When the reason for the last termination of the Pod is memory overflow, and the current running state of the Pod is abnormal, the state value is the first preset value, which is used to indicate that the Pod is in a memory overflow state at the current moment. That is:

[0064] When kube_pod_container_status_last_terminated_reason{reason="OOMKilled"} is 1 and kube_pod_container_status_ready is 0, the status value is the first preset value.

[0065] When the reason for the last termination of the Pod is any reason other than memory overflow, or the current running state of the Pod is normal operation, the status value is the second preset value, which is used to indicate that the Pod is not in the memory overflow state at the current moment. That is, when kube_pod_container_status_last_terminated_reason{reason="OOMKilled"} is 0, or kube_pod_container_status_ready is 1, the status value is the second preset value.

[0066] This embodiment does not limit the specific values ​​of the first preset value and the second preset value, and those skilled in the art can set them by themselves.

[0067] Exemplarily, in another embodiment, the process of determining the state value is implemented by the following code. In this embodiment, the preset rule is a logical expression, corresponding to the code segment corresponding to metricsQuery in the following code.

[0068] -seriesQuery:

[0069]

[0070] Simplify the preset rules in the above code into the following expression:

[0071] x=y*(1-z)

[0072] Among them, x is the status value corresponding to the Pod, and the value of x is 0 or 1. y is the number of Pods whose last termination reason is OOMKilled, and the value of y is 0 or 1. When the last termination reason of the Pod is OOMKilled, y is 1, and when the last termination reason of the Pod is other than OOMKilled, y is 0. z is the number of Pods whose running status is normal at the current moment, and the value of z is 0 or 1. When the running status of the Pod at the current moment is normal, the value of z is 1, and when the running status of the Pod at the current moment is abnormal, the value of z is 0.

[0073] For example, when it is determined based on the indicator information that the reason for the pod's most recent termination is OOMKilled, and the pod's current running state is abnormal, y=1, z=0, and substituting into the above formula, x=1 is obtained. 1 is the first preset value, indicating that the Pod is in a memory overflow state at the current moment.

[0074] For example, when it is determined according to the indicator information that the reason for the pod's most recent termination is OOMKilled, and the pod's current running status is normal running, y=1, z=1, and substituting into the above formula, x=0 is obtained. 0 is the second preset value, indicating that the Pod is not in a memory overflow state at the current moment.

[0075] For example, when it is determined according to the indicator information that the reason for the last termination of the pod is any one except OOMKilled, and the running status of the pod at the current moment is normal operation, y=0, z=1, and x=0 is obtained by substituting into the above formula.

[0076] For example, when it is determined according to the indicator information that the reason for the last termination of the pod is any one except OOMKilled, and the running state of the pod at the current moment is abnormal operation, y=0, z=0, and x=0 is obtained by substituting into the above formula.

[0077] S103: Expand the capacity of the Pod cluster according to the number of Pods whose status values ​​in the Pod cluster are the first preset values.

[0078] The first preset value is used to indicate that the Pod is in a memory overflow state at the current moment, that is, the Pod is restarted due to an OOM error.

[0079] Specifically, first, HPA obtains the number of Pods in the Pod cluster whose status value is the first preset value by accessing the kube-apiserver component. Then, the number of Pods whose status value is the first preset value is compared with the preset number threshold. Finally, the expansion method corresponding to the comparison result is selected to expand the Pod cluster.

[0080] In an optional embodiment, when the number of Pods whose status values ​​are the first preset value exceeds a preset number threshold, the Pod cluster is expanded by twice the number of Pods.

[0081] The preset number threshold is half of the total number of Pods in the Pod cluster.

[0082] Specifically, when a large number of Pods overflow memory in a Pod cluster, the overall performance of the cluster will be reduced, causing resource problems, and in severe cases, causing the cluster system to crash. To this end, when more than half of the Pods in the cluster are in a memory overflow state, the Pod cluster is expanded by twice the number of Pods in a memory overflow state. By increasing the number of expected Pod replicas, the situation of a large number of Pods constantly restarting in the cluster can be alleviated, thereby improving the overall load capacity of the Pod cluster.

[0083] The expansion operation in this embodiment is implemented by the following code:

[0084]

[0085] The expansion rules in the above code can be simplified as follows:

[0086] y=n*(x / n / 0.5),{x / n>0.5}

[0087] Among them, y is the expansion quantity, n is the total number of Pods in the Pod cluster, and x is the number of Pods whose status value is the first preset value.

[0088] In another optional embodiment, when the number of Pods whose status value is the first preset value does not exceed the preset number threshold, according to the expected number of Pods preset in the Deployment / StatefulSet, when other Pods in the Pod cluster except the memory overflow Pod reach the set resource limit upper limit, the Pod cluster is expanded according to the preset expected number of Pods.

[0089] In yet another optional embodiment, after S103, the Pod cluster is scaled down.

[0090] As the number of user requests gradually decreases, the resource demand for the Pod decreases. At this point, low resource utilization will occur. In this case, this embodiment scales down the Pod cluster. Specifically, when the resource demand corresponding to the Pod is lower than the lower limit of the resource limit, the number of Pod copies can be reduced. This approach can reduce idle resources, reduce costs, and improve resource utilization.

[0091] The method for expanding the Pod cluster provided in this embodiment obtains the reason for the most recent termination of operation of each Pod in the Pod cluster and the running status of the Pod at the current moment; determines the status value corresponding to the Pod according to the reason and the running status; and expands the Pod cluster according to the number of Pods in the Pod cluster whose status value is the first preset value; the above scheme can convert the indicator corresponding to the Pod into a status value recognizable by HPA after the Pod falls into an infinite loop caused by memory overflow, thereby realizing automatic expansion using HPA. In addition, this embodiment will expand the capacity of the corresponding scale according to the number of Pods in the cluster whose status value is the first preset value, so as to reduce idle resources and improve resource utilization.

[0092] In this embodiment, a device for expanding the capacity of a Pod cluster is also provided, which is used to implement the above embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0093] This embodiment provides a device for expanding the capacity of a Pod cluster, such as Figure 2 As shown, including:

[0094] The acquisition module 201 is used to obtain the indicator set corresponding to each Pod in the Pod cluster, and the indicator set includes the reason why the Pod was terminated most recently and the running status of the Pod at the current moment.

[0095] The determination module 202 is used to determine a status value corresponding to the Pod according to the cause and the running status, where the status value is readable by the horizontal Pod autoscaler and is used to indicate whether the Pod is in a memory overflow state at the current moment.

[0096] The capacity expansion module 203 is used to expand the Pod cluster according to the number of Pods in the Pod cluster whose status value is a first preset value, where the first preset value is used to indicate that the Pod is in a memory overflow state at the current moment.

[0097] In some optional implementations, the determination module 202 includes:

[0098] The first determining submodule is used to determine the state value as a first preset value when the cause is a memory overflow and the operation state is abnormal operation.

[0099] In some optional implementations, the determining module 202 further includes:

[0100] The second determination submodule is used to determine the state value as a second preset value when the cause is any one except the memory overflow, or the running state is normal operation, and the second preset value is used to indicate that the Pod is not in the memory overflow state at the current moment.

[0101] In some optional implementations, the capacity expansion module 203 includes:

[0102] The comparison submodule is used to compare the number of Pods whose status value is the first preset value with the preset number threshold to obtain a comparison result; the expansion submodule is used to select an expansion method corresponding to the comparison result to expand the Pod cluster.

[0103] In some optional implementations, the expansion submodule includes:

[0104] The capacity expansion unit is used to expand the Pod cluster by twice the number of Pods when the number of Pods whose status values ​​are the first preset value exceeds a preset number threshold.

[0105] In some optional embodiments, the device further comprises:

[0106] The capacity reduction module is used to reduce the capacity of the Pod cluster after expanding the Pod cluster according to the number of Pods whose status values ​​in the Pod cluster are the first preset value.

[0107] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0108] The capacity expansion device of the Pod cluster in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0109] The present disclosure also provides a computer device having the above Figure 2 The expansion device of the Pod cluster is shown.

[0110] See also Figure 3 , Figure 3 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 3As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.

[0111] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0112] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0113] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0114] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0115] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0116] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0117] In addition to the above-mentioned computer device and computer-readable storage medium, the embodiments of the present application may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the steps of the sound source localization method provided by any embodiment of the present application.

[0118] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0119] 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.

[0120] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. 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 disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for expanding a Pod cluster, characterized in that: include: Get the indicator set corresponding to each Pod in the Pod cluster, which includes the reason why the Pod was last terminated and the running status of the Pod at the current moment; Determine, according to the cause and the running status, a status value corresponding to the Pod, where the status value is readable by a horizontal Pod autoscaler and is used to indicate whether the Pod is in a memory overflow state at a current moment; The Pod cluster is expanded according to the number of Pods in the Pod cluster whose status value is a first preset value, where the first preset value is used to indicate that the Pod is in a memory overflow state at the current moment.

2. The method according to claim 1, characterized in that Determining the state value corresponding to the Pod according to the cause and the running state includes: When the cause is memory overflow and the operation status is abnormal operation, the status value is determined to be the first preset value.

3. The method according to claim 1 or 2, characterized in that: The determining, based on the cause and the running status, whether the Pod is in a memory overflow state at the current moment, further includes: When the cause is any one except memory overflow, or the running state is normal running, the state value is determined to be a second preset value, where the second preset value is used to indicate that the Pod is not in a memory overflow state at the current moment.

4. The method according to claim 1, characterized in that: The step of expanding the capacity of the Pod cluster according to the number of Pods whose status values ​​in the Pod cluster are the first preset values ​​includes: Compare the number of Pods whose status value is the first preset value with a preset number threshold to obtain a comparison result; A capacity expansion method corresponding to the comparison result is selected to expand the capacity of the Pod cluster.

5. The method according to claim 4, characterized in that The selecting a capacity expansion method corresponding to the comparison result and performing capacity expansion processing on the Pod cluster includes: When the number of Pods whose status value is the first preset value exceeds a preset number threshold, the Pod cluster is expanded by twice the number of Pods.

6. The method according to claim 1, characterized in that After the Pod cluster is expanded according to the number of Pods whose status values ​​in the Pod cluster are the first preset values, the method further includes: The Pod cluster is scaled down.

7. A Pod cluster expansion device, characterized in that: include: An acquisition module is used to obtain an indicator set corresponding to each Pod in the Pod cluster, wherein the indicator set includes the reason why the Pod was last terminated and the running status of the Pod at the current moment; A determination module, used to determine a status value corresponding to the Pod according to the cause and the running status, where the status value is readable by a horizontal Pod autoscaler and is used to indicate whether the Pod is in a memory overflow state at a current moment; The capacity expansion module is used to expand the Pod cluster according to the number of Pods in the Pod cluster whose status value is a first preset value, where the first preset value is used to indicate that the Pod is in a memory overflow state at the current moment.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for expanding the capacity of a Pod cluster according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for expanding the capacity of a Pod cluster according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for expanding the capacity of a Pod cluster according to any one of claims 1 to 6 are implemented.