Pod cluster scaling method, system, device and storage medium
By dynamically matching based on the utilization of multiple types of resources, the resource allocation of the pod cluster is optimized, which solves the problem of low resource utilization in existing technologies and achieves more efficient resource use.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD
- Filing Date
- 2022-09-19
- Publication Date
- 2026-07-31
AI Technical Summary
In existing technologies, Kubernetes achieves horizontal automatic scaling of pod clusters through a single resource metric, resulting in low resource utilization, especially when CPU utilization is high and memory utilization is low, leading to unreasonable resource allocation.
Based on the utilization of multiple resources of pod nodes, the resource configuration within the pod cluster is dynamically matched. The scaling system generates configuration strategies based on the utilization of the second resource to optimize resource allocation.
It improves the utilization rate of physical host resources in the pod cluster, realizes the efficient use of multiple types of resources, and improves the system resource utilization rate.
Smart Images

Figure CN115509745B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to methods, systems, devices, and storage media for scaling up and down pod clusters. Background Technology
[0002] A pod is the atomic scheduling unit in a Kubernetes project. The resource configuration available to a pod is the sum of the configurations of all containers within the pod, and is generally fixed. For example, if a pod requests 0.5 CPUs, it can use a maximum of 1 CPU. To achieve high availability, Kubernetes uses features like Horizontal Pod Autoscaling (HPA) to automatically scale pods horizontally within a cluster based on single resource metrics such as CPU and memory usage. During automatic scaling, newly created pod nodes are created according to the pod's requested resources.
[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] In view of the problems in the prior art, the purpose of this invention is to provide a method, system, device and storage medium for scaling up and down pod clusters, which overcomes the difficulties of the prior art and can improve the resource utilization of pod clusters.
[0005] Embodiments of the present invention provide a method for scaling up or down a pod cluster, comprising:
[0006] The scaling request for the pod cluster is determined based on the first resource utilization rate in the pod cluster. The scaling request is either scaling up or scaling down.
[0007] Obtain the utilization rate of the second resource in the pod cluster, excluding the first resource, and generate a configuration strategy for the second resource of the pod cluster based on the utilization rate of the second resource.
[0008] In response to scaling requests, the pod cluster is scaled up or down based on the second resource configuration strategy.
[0009] In some embodiments, in response to a scaling request, scaling up or down the pod cluster is performed based on a second resource configuration strategy, including:
[0010] When the scaling request is for scaling up, in response to the scaling request, a pod is created in the pod cluster, and the target allocation amount of the second resource is obtained according to the second resource configuration policy. The second resource is then allocated to the newly created pod according to the target allocation amount of the second resource.
[0011] In some embodiments, a second resource configuration policy for the pod cluster is generated based on the utilization rate of the second resource, including:
[0012] If the utilization rate of the second resource is lower than the first threshold, the target allocation amount of the second resource to the newly created pod node is calculated based on the utilization rate and redundancy of the second resource, and the second resource configuration strategy is obtained based on the target allocation amount of the second resource.
[0013] In some embodiments, the target allocation amount of the second resource to the newly created pod node is calculated based on the utilization and redundancy of the second resource, including:
[0014] When the ratio of the utilization rate of the second resource to (1 - the redundancy of the second resource) is less than 1, the target allocation of the second resource is the product of the demand for the second resource and the ratio.
[0015] In some embodiments, the demand for the second resource is used as the target allocation amount of the second resource when the ratio is not less than 1.
[0016] In some embodiments, in response to a scaling request, scaling up or down the pod cluster is performed based on a second resource configuration strategy, including:
[0017] When the scaling-up / scaling request is for scaling down, in response to the scaling-down request, delete the pod in the pod cluster whose utilization of the second resource meets the set conditions.
[0018] This disclosure also provides a pod cluster scaling system, which includes:
[0019] The scaler obtains first resource data from the data collector, calculates the first resource utilization rate based on the first resource data, and determines the scaling request for the pod cluster based on the first resource utilization rate. The scaling request is either scaling up or scaling down. It also obtains the utilization rate of the second resource in the pod cluster other than the first resource, and generates a second resource configuration strategy based on the utilization rate of the second resource.
[0020] The data collector collects resource data from the pod cluster.
[0021] The executor receives scaling requests carrying a second resource configuration policy from the scaler and responds to the scaling requests by performing scaling operations on the pod cluster based on the second resource configuration policy.
[0022] This disclosure also provides a pod cluster scaling system, which includes:
[0023] The module determines the scaling request for the pod cluster based on the first resource utilization rate in the pod cluster. The scaling request is either scaling up or scaling down.
[0024] The generation module obtains the utilization rate of the second resource in the pod cluster, excluding the first resource, and generates a configuration strategy for the second resource of the pod cluster based on the utilization rate of the second resource.
[0025] The scaling up / down operation module responds to scaling up / down requests and performs scaling up / down operations on the pod cluster based on the second resource configuration strategy.
[0026] Embodiments of the present invention also provide an electronic device, comprising:
[0027] processor;
[0028] Memory, which stores the processor's executable instructions;
[0029] The processor is configured to execute the steps of the above-described pod cluster scaling method by executing executable instructions.
[0030] Embodiments of the present invention also provide a computer-readable storage medium for storing a program that, when executed, implements the steps of the above-described pod cluster scaling method.
[0031] The purpose of this invention is to provide a method, system, device, and storage medium for scaling up and down a pod cluster. The invention determines a scaling up or down request for the pod cluster based on the utilization rate of a first resource in the pod cluster (the request may be for scaling up or down). It then obtains the utilization rate of a second resource in the pod cluster (excluding the first resource) and generates a second resource configuration strategy for the pod cluster based on this utilization rate. In response to the scaling up or down request, the invention performs scaling up or down operations on the pod cluster based on the second resource configuration strategy. This embodiment of the invention is based on the real-time utilization rate of the resources required by pod nodes, enabling dynamic matching of multiple types of resources within the pod cluster, improving the efficient use of physical host resources by the pod cluster, and enhancing system resource utilization. Attached Figure Description
[0032] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.
[0033] Figure 1 This is an architecture diagram of the pod cluster scaling system provided in this embodiment of the disclosure;
[0034] Figure 2This is one of the timing diagrams for the pod cluster scaling method provided in the embodiments of this disclosure;
[0035] Figure 3 This is the second timing diagram of the pod cluster scaling method provided in the embodiments of this disclosure;
[0036] Figure 4 This is one of the flowcharts for the pod cluster scaling method provided in this embodiment of the disclosure;
[0037] Figure 5 This is the second flowchart of the pod cluster scaling method provided in this embodiment of the disclosure;
[0038] Figure 6 This is a schematic diagram of the module structure of the pod cluster scaling system provided in this embodiment of the disclosure;
[0039] Figure 7 This is a schematic diagram of the operation of the electronic device of the present invention;
[0040] Figure 8 A schematic diagram of a storage medium according to an embodiment of the present disclosure is shown. Detailed Implementation
[0041] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to fully and completely convey the concept of the exemplary embodiments to those skilled in the art.
[0042] The accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware forwarding modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0043] Furthermore, the processes shown in the accompanying drawings are merely illustrative and do not necessarily include all steps. For example, some steps can be broken down, some steps can be combined or partially combined, and the actual execution order may change depending on the actual situation. The terms "first," "second," and similar terms used in the specific description do not indicate any order, quantity, or importance, but are only used to distinguish different components. It should be noted that, unless otherwise specified, embodiments of the present invention and features in different embodiments can be combined with each other.
[0044] In related technologies, Kubernetes uses features such as HPA to achieve horizontal automatic scaling of pods within a pod cluster based on single resource metrics such as CPU and memory utilization. During automatic scaling, newly created pod nodes are created according to the resources requested by the pod. However, most business operations actually use far less resources than the requested resource limit, which often results in low resource utilization.
[0045] For example, for services that require high computing power / CPU, memory utilization may be low when CPU utilization is high. If new pods are created according to the fixed CPU and memory specifications mentioned above, it may result in low memory resource utilization.
[0046] Figure 1 This disclosure illustrates the architecture diagram of a pod cluster scaling system provided in an embodiment, such as... Figure 1 As shown, the pod cluster scaling system includes: scaler 11, data collector 12, executor 13, and pod cluster 14.
[0047] Figure 2 Display based on Figure 1 The sequence diagram shown illustrates the pod cluster scaling method of the system. This pod cluster scaling method includes, but is not limited to, the following steps:
[0048] Step 210: Scaler 11 obtains the first resource data within the pod cluster from data collector 12;
[0049] Step 220: The scaler 11 obtains the first resource utilization rate based on the first resource data, and determines the scaling request for the pod cluster based on the first resource utilization rate. The scaling request is either scaling up or scaling down.
[0050] Step 230: The scaler 11 also obtains the utilization rate of the second resource in the pod cluster, excluding the first resource, and generates a second resource configuration strategy for the pod cluster based on the utilization rate of the second resource.
[0051] Step 240: Scaler 11 sends a scaling request carrying the second resource configuration strategy to executor 13;
[0052] Step 250: Executor 13 responds to the scaling request and performs scaling operations on the pod cluster based on the second resource configuration strategy.
[0053] Based on the real-time utilization rate of the resources required by the pod nodes, this embodiment of the disclosure realizes dynamic matching of multiple types of resources within the pod cluster, improves the more efficient use of physical host resources by the pod cluster, and enhances the system resource utilization rate.
[0054] In this embodiment, scaler 11 is implemented based on Horizontal Pod Autoscaling (HPA). In Kubernetes, HPA automatically updates workload resources (such as Deployments or StatefulSets) to automatically scale workloads to meet demand.
[0055] Horizontal scaling means responding to workloads by creating or releasing pods, which is different from "vertical" scaling, which in Kubernetes means allocating more resources (such as memory or CPU) to pods that are already running for workloads.
[0056] When the workload in a pod increases, the number of pods will be dynamically increased based on the set scaling rules to ensure the stable operation of the business system; when the workload in a pod decreases, the number of pods will be dynamically reduced based on the set scaling rules to improve resource utilization.
[0057] In this embodiment, the first resource is a measurable resource metric for scaling up and down operations. The first resource can be CPU, memory utilization, etc., and is not limited thereto. The scaler 11 determines the horizontal scaling up and down of pods within the pod cluster based on the utilization of the first resource.
[0058] In this embodiment of the disclosure, the data collector 12 can be implemented based on the Metrics API, which is specifically designed for processing raw metric data and aims to continuously generate summaries of this metric data (efficiently and synchronously). The scaler 11 can obtain various resource utilization rates in the pod cluster through the Metrics API.
[0059] In this embodiment of the disclosure, the executor 13 can be implemented based on the Deployment, which performs scaling operations on pod nodes in the pod cluster.
[0060] Figure 3 A timing diagram of a specific pod cluster scaling method provided in this embodiment of the disclosure is shown below. Figure 3 As shown, the method for scaling up and down a pod cluster includes the following steps:
[0061] Step 310: The scaler 31 calculates the number of new pod nodes to be created based on the HPA function using a single resource metric (first resource k);
[0062] Step 320: Except for the first resource k, calculate the average utilization C of other resources (such as the second resource j) of the pods currently running in the pod cluster. j :Cj
[0063] Among them, U ij R represents the actual usage of the second resource j on pod node i. ij This represents the allocation amount of the second resource j on pod node i, corresponding to the required amount for the node to be created.
[0064] Step 330: As in C j <TAU j Among them, TAU j This indicates the lower limit of the utilization of the second resource j in the pod cluster (default value is 50%, configurable). When a new pod is created, the first resource k is created according to the amount of resources requested by the pod, and the second resource j is allocated according to the following principles:
[0065] If C j / (1-Red j If ) < 1, then Among them, Red j This indicates the redundancy of the second resource j of the pod node (default value is 50%, configurable). When creating a pod node, the second resource j is set to R. ij Allocation will be made; otherwise, the original requested resource amount R will be used. ij Distribute
[0066] Step 340: The scaler 31 generates a pod cluster expansion request and forwards it to the executor 32. The pod cluster expansion request includes the number of new pod nodes and resource configuration strategies.
[0067] Step 350: Executor 32 responds to the pod cluster expansion request and performs the expansion operation.
[0068] Step 311: Based on the HPA function, scaler 31 calculates the pod nodes that need to be released using a single resource metric (first resource k);
[0069] Step 313: Calculate the average utilization C of other resources (such as the second resource j) of the currently running pods in the pod cluster, excluding the first resource k. j :
[0070] Step 315: Actuator 32 prioritizes deleting C. j The lowest number of pod nodes, thereby improving the resource utilization of the pod cluster.
[0071] Figure 4 The flowchart is a method for scaling up and down a pod cluster provided in the embodiments of this disclosure, as follows: Figure 4 As shown, the method for scaling up and down a pod cluster includes the following steps:
[0072] Step 410: Determine the scaling request for the pod cluster based on the first resource utilization rate in the pod cluster. The scaling request can be either scaling up or scaling down.
[0073] Step 420: Obtain the utilization rate of the second resource that is running in the pod cluster in addition to the first resource, and generate a configuration policy for the second resource of the pod cluster based on the utilization rate of the second resource;
[0074] Step 430: In response to the scaling request, perform scaling operations on the pod cluster based on the second resource configuration strategy.
[0075] Using the embodiments of this disclosure, based on the real-time utilization rate of the resources required by the pod nodes, dynamic matching of multiple types of resources within the pod cluster is achieved, thereby improving the more efficient use of physical host resources by the pod cluster and enhancing system resource utilization.
[0076] In this embodiment of the disclosure, when the scaling request is for scaling up, in response to the scaling request, a pod is created in the pod cluster, and the target allocation amount of the second resource is obtained according to the second resource configuration policy. The second resource is then allocated to the newly created pod according to the target allocation amount of the second resource.
[0077] When the scaling-up / scaling request is for scaling down, in response to the scaling-down request, delete the pod in the pod cluster whose utilization of the second resource meets the set conditions.
[0078] In this embodiment of the disclosure, when the scaling request is for scaling up, if the utilization rate of the second resource is lower than the first threshold, the target allocation amount of the second resource to be allocated to the newly created pod node is calculated according to the utilization rate and redundancy of the second resource, and the second resource configuration strategy is obtained based on the target allocation amount of the second resource.
[0079] Specifically, the target allocation amount of the second resource to the newly created pod node is calculated based on the utilization and redundancy of the second resource, including, for example... Figure 5 The steps shown are as follows:
[0080] Step 510: Determine whether the utilization rate of the second resource is less than the first threshold;
[0081] If so, proceed to step 520 to calculate the ratio of the utilization rate of the second resource to (1 - the redundancy of the second resource);
[0082] Step 530: Determine if the ratio is less than 1;
[0083] If it is less than 1, proceed to step 540 and calculate the target allocation of the second resource = the demand of the second resource * the utilization rate of the second resource / (1 - the redundancy of the second resource).
[0084] If it is not less than 1, proceed to step 550 and use the demand for the second resource as the target allocation amount for the second resource.
[0085] If the utilization rate of the second resource is not less than the first threshold, proceed to step 550, and use the demand for the second resource as the actual resource quantity of the second resource.
[0086] The first threshold can be the lower limit of the second resource utilization rate.
[0087] In this embodiment of the disclosure, the configuration strategy for the first resource will be allocated according to the number of newly created pods, such as by equal distribution, which is not limited here.
[0088] In this embodiment of the disclosure, during scaling down, at least one pod node with the lowest second resource utilization rate can be deleted from the pod cluster based on the second resource utilization rate of each pod node within the pod cluster. Therefore, the condition set above can refer to the pod node having the lowest second resource utilization rate.
[0089] Figure 6 This is a schematic diagram of a module of one embodiment of the pod cluster scaling system provided in this disclosure, as shown below. Figure 6 As shown, the pod cluster scaling system 600 includes, but is not limited to, the following modules:
[0090] Module 610 determines the scaling request for the pod cluster based on the first resource utilization rate in the pod cluster. The scaling request is either scaling up or scaling down.
[0091] The generation module 620 obtains the utilization rate of the second resource in the pod cluster, excluding the first resource, and generates a configuration strategy for the second resource of the pod cluster based on the utilization rate of the second resource.
[0092] The scaling operation module 630 responds to scaling requests and performs scaling operations on the pod cluster based on the second resource configuration strategy.
[0093] The implementation principle of the above modules can be found in [link to documentation]. Figure 4 The relevant information regarding the scaling methods for the pod cluster shown is not repeated here.
[0094] Optionally, the expansion / shrinkage operation module 630 is specifically used for:
[0095] When the scaling request is for scaling up, in response to the scaling request, a pod is created in the pod cluster, and the target allocation amount of the second resource is obtained according to the second resource configuration policy. The second resource is then allocated to the newly created pod according to the target allocation amount of the second resource.
[0096] Optionally, the generation module 620 is specifically used for:
[0097] If the utilization rate of the second resource is lower than the first threshold, the target allocation amount of the second resource to the newly created pod node is calculated based on the utilization rate and redundancy of the second resource, and the second resource configuration strategy is obtained based on the target allocation amount of the second resource.
[0098] Optionally, the generation module 620 is specifically used for:
[0099] When the ratio of the utilization rate of the second resource to (1 - the redundancy of the second resource) is less than 1, the target allocation of the second resource is the product of the demand for the second resource and the ratio.
[0100] Optionally, the generation module 620 is also specifically used for:
[0101] If the ratio is not less than 1, the demand for the second resource shall be used as the target allocation amount of the second resource.
[0102] Optionally, the expansion / shrinkage operation module 630 is specifically used for:
[0103] When the scaling-up / scaling request is for scaling down, in response to the scaling-down request, delete the pod in the pod cluster whose utilization of the second resource meets the set conditions.
[0104] The pod cluster scaling system of this disclosure is based on the real-time utilization of the resources required by the pod nodes, and realizes dynamic matching of multiple types of resources within the pod cluster, thereby improving the more efficient use of physical host resources by the pod cluster and improving system resource utilization.
[0105] This invention also provides an electronic device, including a processor and a memory storing executable instructions for the processor. The processor is configured to execute steps of a pod cluster scaling method by executing the executable instructions.
[0106] As shown above, the electronic device in this embodiment of the present disclosure can achieve dynamic matching of multiple types of resources within the pod cluster based on the real-time utilization rate of the resources required by the pod node, thereby improving the more efficient use of physical host resources by the pod cluster and enhancing system resource utilization.
[0107] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "platform."
[0108] Figure 7 A schematic diagram of the electronic device of the present invention. Referring below... Figure 7To describe an electronic device 700 according to this embodiment of the present invention. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0109] like Figure 7 As shown, the electronic device 700 is presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different platform components (including storage unit 720 and processing unit 710), a display unit 740, etc.
[0110] The storage unit stores program code, which can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the pod cluster scaling method section of this specification, according to various exemplary embodiments of the present invention. For example, the processing unit 710 can execute... Figure 4 The steps are shown.
[0111] Storage unit 720 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 721 and / or cache memory 722, and may further include a read-only memory (ROM) 723.
[0112] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, including but not limited to: a processing system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0113] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0114] The electronic device 700 can also communicate with one or more external devices 70 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with the electronic device 700, and / or with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). Such communication can be performed through the input / output (I / O) interface 750.
[0115] Furthermore, the electronic device 700 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via the network adapter 760. The network adapter 760 can communicate with other modules of the electronic device 700 via the bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0116] This invention also provides a computer-readable storage medium for storing a program, which, when executed, implements the steps of a pod cluster scaling method. In some possible implementations, various aspects of this invention can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to execute the steps described in the above-described pod cluster scaling method section of this specification according to various exemplary embodiments of the invention.
[0117] refer to Figure 8 As shown, a program product 800 for implementing the above-described method according to an embodiment of the present disclosure is described. The program product for implementing the above-described method according to an embodiment of the present invention may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0118] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0119] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0120] Program code for performing the processing of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0121] In summary, the purpose of this invention is to provide a method, system, device, and storage medium for scaling up and down a pod cluster. The invention determines a scaling up or down request for the pod cluster based on the utilization rate of a first resource in the pod cluster (the request may be for scaling up or down). It then obtains the utilization rate of a second resource in the pod cluster (excluding the first resource) and generates a second resource configuration strategy for the pod cluster based on this utilization rate. In response to the scaling up or down request, the invention performs scaling up or down operations on the pod cluster based on the second resource configuration strategy. This embodiment of the invention is based on the real-time utilization rate of the resources required by pod nodes, enabling dynamic matching of multiple types of resources within the pod cluster, improving the efficient use of physical host resources by the pod cluster, and enhancing system resource utilization.
[0122] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for scaling up and down a pod cluster, characterized in that, include: The scaling request for the pod cluster is determined based on the first resource utilization rate in the pod cluster, and the scaling request is either scaling up or scaling down. Obtain the utilization rate of the second resource in the pod cluster, excluding the first resource, and generate a second resource configuration strategy for the pod cluster based on the utilization rate of the second resource. In response to the scaling request, the pod cluster is scaled up or down based on the second resource configuration strategy, including: In the case of scaling up or down requesting scaling up, in response to the scaling up request, a pod is created in the pod cluster, and the target allocation amount of the second resource is obtained according to the second resource configuration policy. The second resource is then allocated to the newly created pod according to the target allocation amount of the second resource. If the scaling-up / scaling request is for scaling down, in response to the scaling-down request, the pods whose utilization of the second resource meets the set conditions are deleted from the pod cluster.
2. The pod cluster scaling method according to claim 1, characterized in that, The step of generating a second resource configuration strategy for the pod cluster based on the utilization rate of the second resource includes: If the utilization rate of the second resource is lower than the first threshold, the target allocation amount of the second resource to the newly created pod node is calculated according to the utilization rate and redundancy of the second resource, and the second resource configuration strategy is obtained based on the target allocation amount of the second resource.
3. The pod cluster scaling method according to claim 2, characterized in that, The calculation of the target allocation amount of the second resource to the newly created pod node based on the utilization and redundancy of the second resource includes: If the ratio of the utilization rate of the second resource to (1 - the redundancy of the second resource) is less than 1, the target allocation of the second resource is the product of the demand for the second resource and the ratio.
4. The pod cluster scaling method according to claim 3, characterized in that, If the ratio is not less than 1, the demand for the second resource shall be used as the target allocation amount of the second resource.
5. A pod cluster scaling system, characterized in that, include: The scaler obtains first resource data from the data collector, calculates a first resource utilization rate based on the first resource data, and determines a scaling request for the pod cluster based on the first resource utilization rate, wherein the scaling request is for scaling up or scaling down. It also obtains the utilization rate of a second resource in the pod cluster other than the first resource, and generates a second resource configuration strategy for the pod cluster based on the utilization rate of the second resource. The data collector collects resource data from the pod cluster. An executor receives a scaling request carrying the second resource configuration policy from the scaler, and in response to the scaling request, performs scaling operations on the pod cluster based on the second resource configuration policy, including: In the case of scaling up or down requesting scaling up, in response to the scaling up request, a pod is created in the pod cluster, and the target allocation amount of the second resource is obtained according to the second resource configuration policy. The second resource is then allocated to the newly created pod according to the target allocation amount of the second resource. If the scaling-up / scaling request is for scaling down, in response to the scaling-down request, the pods whose utilization of the second resource meets the set conditions are deleted from the pod cluster.
6. A pod cluster scaling system, characterized in that, include: The determination module determines the scaling up or scaling down request for the pod cluster based on the first resource utilization rate in the pod cluster, wherein the scaling up or scaling down request is for scaling up or scaling down. The generation module obtains the utilization rate of the second resource in the pod cluster, excluding the first resource, and generates a second resource configuration strategy for the pod cluster based on the utilization rate of the second resource. The scaling up / down operation module, in response to the scaling up / down request, performs scaling up / down operations on the pod cluster based on the second resource configuration strategy, including: In the case of scaling up or down requesting scaling up, in response to the scaling up request, a pod is created in the pod cluster, and the target allocation amount of the second resource is obtained according to the second resource configuration policy. The second resource is then allocated to the newly created pod according to the target allocation amount of the second resource. If the scaling-up / scaling request is for scaling down, in response to the scaling-down request, the pods whose utilization of the second resource meets the set conditions are deleted from the pod cluster.
7. An electronic device, characterized in that, include: processor; A memory in which executable instructions of the processor are stored; The processor is configured to perform the steps of the pod cluster scaling method according to any one of claims 1 to 4 by executing the executable instructions.
8. A computer-readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps of the pod cluster scaling method according to any one of claims 1 to 4.