Pod scheduling method and device in hybrid cloud mode, electronic equipment and storage medium
By migrating stateless Pods to the public cloud in a hybrid cloud model, the problem of insufficient resource utilization in hybrid clouds is solved, achieving full utilization of resources and cost optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-24
AI Technical Summary
In a hybrid cloud model, there are problems such as idle and wasted private cloud resources and underutilized public cloud resources, leading to insufficient resource utilization and excessively high business costs.
By migrating stateless Pods to the public cloud when the current number of Pods in a stateless Pod exceeds the target number of replicas, and ensuring the target number of replicas is less than or equal to the minimum number of replicas, we can fully utilize private cloud resources and adjust the elastic configuration of the public cloud to optimize resource allocation.
It improved the utilization rate of hybrid cloud resources, reduced resource waste, and lowered business costs.
Smart Images

Figure CN121722499A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a Pod scheduling method and apparatus, electronic device and storage medium in a hybrid cloud model. Background Technology
[0002] Currently, with the development of cloud computing, cloud service providers and customers are increasingly adopting hybrid cloud to deploy cloud computing. The following are some common issues encountered when using hybrid cloud: 1. Since private clouds typically use fixed resource pools (e.g., 50k cores), reserving too many elastic resources to cope with peak business demand (e.g., sudden demand + 20k cores) can lead to cost issues related to reserved elastic resources in private clouds: 1.1 Low allocation rate: Reserved resources are not fully utilized during off-peak periods (e.g., only 70% is used), leaving the remaining 30% idle, but still incurring fixed costs such as hardware depreciation, electricity, and maintenance; 1.2 Opportunity cost: These reserved resources could have been used for other businesses, but are wasted due to rigid allocation strategies.
[0003] 2. While the advantage of public cloud is its on-demand scaling (e.g., temporarily adding 20k cores), if private cloud reserves too many elastic resources, businesses will prioritize using private cloud capacity, leading to underutilization of public cloud elastic resources and resulting in cost issues: 2.1 Public cloud resource idleness: Demands that could be met through public cloud elastic scaling are inefficiently allocated and occupied by private cloud, wasting the "pay-as-you-go" cost advantage of public cloud; 2.2 Hybrid cloud cost imbalance: The fixed costs of private cloud + low utilization of public cloud result in a higher overall cost than a rationally allocated solution.
[0004] Since allocation rate = allocated resources / actual total resources (e.g., 90% allocation rate = 45k cores used / 50k cores total), a low private cloud allocation rate (e.g., 70%) means 30% of resources are idle, which directly increases unit business costs; conversely, increasing it to 90% can significantly reduce waste.
[0005] Therefore, there are technical problems in related technologies, such as insufficient utilization of hybrid cloud resources, resulting in idle and wasted resources and excessively high business costs. Summary of the Invention
[0006] This application provides a Pod scheduling method and apparatus, electronic device and storage medium in a hybrid cloud mode, to at least solve the problems of insufficient utilization of hybrid cloud resources, resulting in idle and wasted resources and excessive business costs in related technologies.
[0007] According to one aspect of the embodiments of this application, a Pod scheduling method in a hybrid cloud model is provided, including: Obtain the stateless Pods that are actually running in the private cloud, wherein the stateless Pods are Pods used to run stateless applications; If the current number of Pods in the stateless Pod is greater than the target number of replicas, the target Pod in the stateless Pod will be migrated to the public cloud. The target number of replicas is less than or equal to the minimum number of replicas, which is the minimum number of Pods required to provide application services through the private cloud and / or the public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods.
[0008] Optionally, as described above, the method further includes: If the minimum number of replicas is determined to be greater than the current number of Pods in the private cloud, the elastic configuration of the public cloud is determined based on a first difference between the minimum number of replicas and the current number of Pods and a second difference between the maximum number of replicas and the current number of Pods. The elastic configuration of the public cloud is that the number of Pods on the public cloud is between the first difference and the second difference.
[0009] Optionally, as described above, the step of migrating the target Pod in the stateless Pod to the public cloud when the current number of Pods in the stateless Pod is greater than the target number of replicas includes: If it is determined that the current number of Pods in the private cloud is greater than the minimum number of replicas that is the target number of replicas, the actual minimum number of replicas is obtained from historical monitoring data; If the actual minimum number of replicas is greater than or equal to the current number of Pods, the minimum number of replicas is updated using the actual minimum number of replicas. If the actual minimum number of replicas is less than the current number of Pods, then migrate the Pods to be migrated from the private cloud in a number equal to the difference between the current number of Pods and the actual minimum number of replicas to the public cloud.
[0010] Optionally, as described above, after migrating the target Pod in the stateless Pod to the public cloud, the method further includes: Obtain the private cluster allocation rate of the private cloud, wherein the private cluster allocation rate is used to indicate the resource utilization rate of the private cloud; If the private cluster allocation rate is lower than or equal to a preset value, the specified Pod will be migrated from the public cloud to the private cloud.
[0011] Optionally, as described above, the step of migrating the specified Pod from the public cloud to the private cloud when the private cluster allocation rate is lower than a preset value includes: In the public cloud, fixed Pods that have not been elastically configured are filtered out, and these fixed Pods are designated as the Pods to be migrated. A new Pod is created in the private cloud that corresponds to a specified Pod in the public cloud. If the new Pod is found to be available, the specified Pod in the public cloud is deleted.
[0012] Optionally, as described above, the step of migrating Pods to the public cloud in the case where the actual minimum replica count is less than the current number of Pods includes: If the actual minimum number of replicas is less than the current number of Pods and the private cluster allocation rate is higher than a preset upper limit, the Pods to be migrated shall be forcibly migrated from the private cloud to the public cloud, wherein the preset upper limit is higher than a preset value; If the actual minimum number of replicas is less than the current number of Pods, and the private cluster allocation rate is lower than or equal to the preset value, the Pod to be migrated will not be migrated.
[0013] Optionally, as described above, obtaining the actual minimum number of replicas from historical monitoring data includes: Obtain the historical load information of the private cloud; Based on the historical load data, the historical load characteristics of the private cloud are determined. Based on the historical load characteristics, the actual minimum number of replicas is determined.
[0014] According to another aspect of the embodiments of this application, a Pod scheduling device in a hybrid cloud mode is also provided, comprising: A configuration distribution platform is configured to obtain the stateless Pods actually running in the private cloud, wherein the stateless Pods are Pods used to run stateless applications; A scheduling system is used to migrate a target Pod in a stateless Pod to a public cloud when the current number of Pods in the stateless Pod is greater than the target number of replicas. The target number of replicas is less than or equal to the minimum number of replicas, which is the minimum number of Pods required to provide application services through the private cloud and / or the public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps of any of the above embodiments by running the computer program stored in the memory.
[0016] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the method steps of any of the above embodiments when running.
[0017] In this embodiment, a hybrid cloud-based Pod scheduling method is adopted. This involves acquiring stateless Pods actually running in the private cloud, where each stateless Pod is used to run stateless applications. If the current number of Pods in the stateless Pods exceeds the target number of replicas, the target Pods within those stateless Pods are migrated to the public cloud. The target number of replicas is less than or equal to the minimum number of replicas, which is the minimum number of Pods required to provide application services through the private cloud and / or the public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods. Because the target Pods are migrated to the public cloud only when the current number of Pods exceeds the target number of replicas, the resources of the private cloud are fully utilized, achieving improved resource utilization. This solves the problems of insufficient resource utilization in hybrid cloud technologies, leading to resource idleness and high business costs. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the hardware environment for an optional Pod scheduling method in a hybrid cloud mode according to an embodiment of this application; Figure 2 This is a flowchart illustrating an optional Pod scheduling method in a hybrid cloud mode according to an embodiment of this application; Figure 3 This is a flowchart illustrating another optional Pod scheduling method in a hybrid cloud mode according to an embodiment of this application; Figure 4 This is a flowchart illustrating another optional Pod scheduling method in a hybrid cloud mode according to an embodiment of this application; Figure 5This is a structural block diagram of an optional hybrid cloud mode Pod scheduling device according to an embodiment of this application; Figure 6 This is a structural block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows: 1. A replica refers to multiple identical instances of the same application; its purpose is to: improve availability (if one fails, the others can still be used); enhance concurrent processing capabilities (multiple instances share the load); and achieve load balancing.
[0024] 2. A Pod is the smallest unit of deployment in Kubernetes; it is a concrete, runnable entity that contains containers of applications; each Pod has a unique IP address and lifecycle.
[0025] According to one aspect of the embodiments of this application, a Pod scheduling method in a hybrid cloud mode is provided. Optionally, in this embodiment, the above-described Pod scheduling method in a hybrid cloud mode can be applied to, for example... Figure 1 The hardware environment shown consists of terminal 1402 and server 1404. For example... Figure 1As shown, server 1404 is connected to terminal 1402 via a network and can be used to provide services (such as game services, application services, etc.) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 1404.
[0026] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal may not be limited to PC, mobile phone, tablet computer, etc.
[0027] The Pod scheduling method in the hybrid cloud mode of this application embodiment can be executed by a server, a terminal, or both. Specifically, the Pod scheduling method in the hybrid cloud mode of this application embodiment can also be executed by a client installed on the terminal.
[0028] Taking the Pod scheduling method in the hybrid cloud mode of this embodiment, executed by the server, as an example, Figure 2 A Pod scheduling method in a hybrid cloud model provided in this application includes the following steps: Step S202: Obtain the stateless Pods that are actually running in the private cloud, where a stateless Pod is a Pod used to run stateless applications.
[0029] The Pod scheduling in the hybrid cloud mode of this embodiment can be applied to scenarios where stateless Pods deployed in a hybrid cloud are migrated between private and public clouds.
[0030] Specifically, when the configuration distribution platform distributes elastic configurations for a federated cluster (i.e., including private and public clouds) used to provide application services to a target application, it can obtain the associated Deployment (a controller for managing stateless applications) to determine the distribution of replicas within that federated cluster. Based on this replica distribution, the stateless Pods actually running in the private cloud can then be identified.
[0031] Step S204: If the current number of Pods in a stateless Pod is greater than the target number of replicas, migrate the target Pod in the stateless Pod to the public cloud. The target number of replicas is less than or equal to the minimum number of replicas. The minimum number of replicas is the minimum number of Pods required to provide application services through a private cloud and / or a public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods.
[0032] Specifically, after identifying stateless Pods, the current number of stateless Pods actually running in the private cloud can be determined.
[0033] In this embodiment, the minimum number of replicas is the minimum number of replicas in the federated cluster. Further, this minimum number of replicas can be a fixed number of Pods. Since the minimum number of replicas is one of the configuration options in the elastic configuration issued by the configuration platform (the other being the maximum number of replicas), optionally, the target number of replicas corresponding to the private cloud can be the maximum number of replicas that can exist on the private cloud, and this target number of replicas can be equal to the minimum number of replicas. Furthermore, to reduce the overhead of Pod scheduling between the private cloud and the public cloud—that is, to avoid frequently scheduling Pods from the private cloud to the public cloud (for example, when the target number of replicas can be equal to the minimum number of replicas, every newly created Pod in the private cloud needs to be migrated to the public cloud)—the minimum number of replicas can be greater than or equal to the target number of replicas corresponding to the private cloud.
[0034] In this embodiment, if the current number of Pods is greater than the target number of replicas, the target Pods in the stateless Pods will be migrated to the public cloud. For example, when the number of stateless replicas is M, the number of target replicas is N, and M > N, the MN target Pods in the private cloud will be migrated to the public cloud.
[0035] In this embodiment, a hybrid cloud-based Pod scheduling approach is adopted. This involves acquiring stateless Pods actually running in the private cloud, where each stateless Pod is used to run stateless applications. If the current number of stateless Pods exceeds the target number of replicas, the target Pods within these stateless Pods are migrated to the public cloud. The target number of replicas is less than or equal to the minimum number of replicas, which is the minimum number of Pods required to provide application services through the private cloud and / or public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods. Because the target Pods are only migrated to the public cloud when the current number of Pods exceeds the target number of replicas, the resources of the private cloud are fully utilized, achieving improved resource utilization. This addresses the problems of insufficient resource utilization in hybrid cloud technologies, leading to resource idleness and high business costs.
[0036] As an optional implementation, the method described above further includes the following steps: Given that the minimum number of replicas is greater than the current number of Pods in the private cloud, the elastic configuration of the public cloud is determined based on the first difference between the minimum number of replicas and the current number of Pods, and the second difference between the maximum number of replicas and the current number of Pods. The elastic configuration of the public cloud is defined as the number of Pods on the public cloud falling between the first and second differences. In other words, when the minimum number of replicas is greater than the current number of Pods in the private cloud, the first difference (minus the current number of Pods) and the second difference (minus the current number of Pods) can be calculated to determine the elastic configuration of the public cloud, which can then be distributed to the public cloud. For example, when the minimum number of replicas (minReplicas) = 5, the maximum number of replicas (maxReplicas) = 20, and the current replica distribution is: X Pods (fixed) in the private cloud and 1 Pod (elastic) in the public cloud, when minReplicas > X, the elastic configuration is updated to: minReplicas – X, maxReplicas – X; and this updated elastic configuration is then distributed to the public cloud.
[0037] like Figure 3 As shown, as an optional implementation, the method described above can be implemented by the following steps: Step S204, when the current number of stateless Pods is greater than the target number of replicas, migrates the target Pod in the stateless Pod to the public cloud: Step S302: If it is determined that the current number of Pods in the private cloud is greater than the minimum number of replicas that serves as the target number of replicas, obtain the actual minimum number of replicas from historical monitoring data.
[0038] Specifically, in this embodiment, the target number of replicas is the same as the minimum number of replicas. Therefore, in this embodiment, if the current number of Pods is greater than the minimum number of replicas, it is further determined whether the minimum number of replicas is set too low. Therefore, the actual minimum number of replicas is obtained from historical monitoring data.
[0039] As an optional implementation, the method described above can be used to obtain the actual minimum replica count from historical monitoring data through the following steps: obtaining the historical load of the private cloud; determining the historical load characteristics of the private cloud based on the historical load; and determining the actual minimum replica count based on the historical load characteristics. Optionally, historical load can be obtained through periodic analysis of periodic data (e.g., daily, weekly, monthly / quarterly data within a historical time period). For example: Daily cycle: identifying patterns in load within a day (e.g., morning peak 9-11 am, lunch break low, evening peak 19-22 pm). Weekly cycle: comparing load differences between weekdays and weekends to obtain load changes. Monthly / quarterly cycle: analyzing load changes caused by beginning-of-month report generation, end-of-month settlement, quarterly promotions, etc. Trend analysis of load changes: using methods such as moving averages and linear regression to analyze load changes, obtaining long-term growth or decline trends in load, and determining whether the business is in a period of expansion or contraction. Furthermore, peak and trough analysis can be performed on load changes: the highest historical load, its occurrence time, and duration can be statistically analyzed; the lowest load trough can be identified, providing a reference for determining the "safety floor" for minimum replicas. This allows for the determination of the actual minimum replica count, which reflects the historical real demand for replicas, thus overcoming situations where static configuration is unreasonable.
[0040] Step S304: If the actual minimum number of replicas is greater than or equal to the current number of Pods, update the minimum number of replicas using the actual minimum number of replicas.
[0041] After obtaining the actual minimum number of replicas, you can compare the actual minimum number of replicas with the current number of Pods. If the actual minimum number of replicas is greater than or equal to the current number of Pods, it means that the minimum number of replicas is set too small. Update the minimum number of replicas using the actual minimum number of replicas.
[0042] Step S306: If the actual minimum number of replicas is less than the current number of Pods, migrate the Pods to be migrated from the private cloud to the public cloud in a number equal to the difference between the current number of Pods and the actual minimum number of replicas.
[0043] After obtaining the actual minimum number of replicas, this number can be compared with the current number of Pods. If the actual minimum number of replicas is less than the current number of Pods, it indicates that the current number of Pods is too large. In this case, Pods in the private cloud whose number is equal to the difference Y between the current number of Pods and the actual minimum number of replicas will be migrated to the public cloud. Specifically, the elastic configuration can be the difference Y between the current number of Pods and the actual minimum number of replicas, and this elastic configuration can be sent to the scheduling system for scheduling. The scheduling system will then migrate the Pods in the private cloud whose number is equal to the difference Y between the current number of Pods and the actual minimum number of replicas to the public cloud.
[0044] like Figure 4 As shown, as an optional implementation, the method described above, after migrating the target Pod in the stateless Pod to the public cloud in the aforementioned steps, may further include the following steps: Step S402: Obtain the private cluster allocation rate of the private cloud, wherein the private cluster allocation rate is used to indicate the resource utilization rate of the private cloud.
[0045] Specifically, the resource utilization rate of the private cloud (which can be used resources / total resources, for example, CPU utilization of 70%) can be obtained to determine the private cluster allocation rate.
[0046] Step S404: If the private cluster allocation rate is lower than or equal to a preset value, the specified Pod will be migrated from the public cloud to the private cloud.
[0047] If the private cluster allocation rate is determined to be lower than a preset value (e.g., 60%), a specified Pod can be migrated from the public cloud to the private cloud. The number of specified Pods can be determined based on the current private cluster allocation rate in the private cloud, with the goal that after all specified Pods are migrated to the private cloud, the private cluster allocation rate will not exceed a preset upper limit (e.g., 90%) and will be higher than the preset value. This preset upper limit is higher than the preset value.
[0048] As an optional implementation, the method described above can be implemented through the following steps: Step S404 involves migrating a specified Pod from the public cloud to the private cloud when the private cluster allocation rate is lower than a preset value. In the public cloud, fixed Pods without elastic configuration are filtered out and designated as the specified Pods to be migrated. A new Pod corresponding to the specified Pod in the public cloud is created in the private cloud, and the specified Pod in the public cloud is deleted once the new Pod is confirmed to be available. Specifically, this can be achieved by filtering out all elastic configurations of Deployments in the public cloud to obtain fixed Pods without elastic configuration. After obtaining these fixed Pods, they can be designated as the specified Pods to be migrated. In the migration process, this embodiment first creates a new Pod in the private cloud corresponding to the specified Pod in the public cloud (i.e., the new Pod is identical to the specified Pod), and then deletes the original specified Pod in the public cloud once the new Pod is available.
[0049] The method described in this embodiment can fully utilize resources in the private cloud and reduce the use of resources in the public cloud, thereby further reducing costs.
[0050] As an optional implementation, the method described above can be implemented by the following steps: Step S306 involves migrating Pods to the public cloud in a number equal to the difference between the current number of Pods and the actual minimum number of replicas when the actual minimum number of replicas is less than the current number of Pods. If the actual minimum number of replicas is less than the current number of Pods, and the private cluster allocation rate is higher than the preset limit, the Pods to be migrated will be forcibly migrated from the private cloud to the public cloud. Specifically, if the actual minimum number of replicas is determined to be less than the current number of Pods, the relationship between the private cluster allocation rate and the preset limit will be assessed. If the private cluster allocation rate is higher than the preset limit, it indicates that the private cloud is overloaded. Therefore, the Pods to be migrated will be migrated to the public cloud according to the latest minimum number of replicas. For example, during the migration, a scheduling request sent by the Pod distribution platform can be used to forcibly migrate x Pods (i.e., the Pods to be migrated) from the private cloud to the public cloud, making the fixed number of Pods in the private cloud less than or equal to the actual minimum number of replicas, triggering the Pod distribution platform to distribute the elastic configuration to the public cloud.
[0051] If the actual minimum number of replicas is less than the current number of Pods, and the private cluster allocation rate is lower than or equal to a preset value, the Pod to be migrated will not be migrated. Specifically, if it is determined that the private cluster allocation rate is lower than or equal to the preset value, it means that the load on the private cloud is very low and the resources are not being fully utilized. Therefore, even if the actual minimum number of replicas is less than the current number of Pods, the specified Pod will not be migrated.
[0052] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps of any of the above embodiments by running the computer program stored in the memory.
[0053] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the method steps of any of the above embodiments when running.
[0054] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0055] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0056] According to another aspect of the embodiments of this application, a Pod scheduling apparatus in a hybrid cloud mode for implementing the above-described Pod scheduling method in a hybrid cloud mode is also provided. Figure 5 This is a structural block diagram of an optional hybrid cloud mode Pod scheduling device according to an embodiment of this application, such as... Figure 5 As shown, the device may include: Configure platform 51 to obtain the stateless Pods actually running in the private cloud. The stateless Pods are Pods used to run stateless applications. The scheduling system 52 is used to migrate the target Pod in the stateless Pod to the public cloud when the current number of Pods in the stateless Pod is greater than the target number of replicas. The target number of replicas is less than or equal to the minimum number of replicas. The minimum number of replicas is the minimum number of Pods that provide application services through a private cloud and / or a public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods.
[0057] It should be noted that the configuration distribution platform 51 in this embodiment can be used to execute the above step S202, and the scheduling system 52 in this embodiment can be used to execute the above step S204.
[0058] In addition to the modules described above, the apparatus in this embodiment may also include a module that executes any method in any of the embodiments of Pod scheduling methods under any of the aforementioned hybrid cloud modes.
[0059] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1 The hardware environment shown can be implemented through software or hardware, and the hardware environment includes the network environment.
[0060] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described Pod scheduling method in a hybrid cloud mode is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0061] According to another embodiment of this application, an electronic device is also provided, comprising: Figure 6 As shown, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.
[0062] Memory 1503 is used to store computer programs; When processor 1501 executes the program stored in memory 1503, it performs the following steps: Step S202: Obtain the stateless Pods that are actually running in the private cloud, where a stateless Pod is a Pod used to run stateless applications.
[0063] Step S204: If the current number of Pods in a stateless Pod is greater than the target number of replicas, migrate the target Pod in the stateless Pod to the public cloud. The target number of replicas is less than or equal to the minimum number of replicas. The minimum number of replicas is the minimum number of Pods required to provide application services through a private cloud and / or a public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods.
[0064] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used to represent it in the figure, but this does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned electronic device and other devices.
[0065] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0066] As an example, the aforementioned storage 1503 may include, but is not limited to, the configuration distribution platform 51 and the scheduling system 52 in the Pod scheduling device under the hybrid cloud mode. Furthermore, it may include, but is not limited to, other module units in the Pod scheduling device under the hybrid cloud mode, which will not be elaborated further in this example.
[0067] The processor mentioned above can be a general-purpose processor, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0068] This application also provides a computer-readable storage medium, which includes a stored program, wherein the program executes the method steps of the above method embodiments when it runs.
[0069] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.
[0070] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0071] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0072] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0073] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0074] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the solution provided in this embodiment, depending on actual needs.
[0075] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0076] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A Pod scheduling method in a hybrid cloud model, characterized in that, include: Obtain the stateless Pods that are actually running in the private cloud, wherein the stateless Pods are Pods used to run stateless applications; If the current number of Pods in the stateless Pod is greater than the target number of replicas, the target Pod in the stateless Pod will be migrated to the public cloud. The target number of replicas is less than or equal to the minimum number of replicas, which is the minimum number of Pods required to provide application services through the private cloud and / or the public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods.
2. The method according to claim 1, characterized in that, The method further includes: If the minimum number of replicas is determined to be greater than the current number of Pods in the private cloud, the elastic configuration of the public cloud is determined based on a first difference between the minimum number of replicas and the current number of Pods and a second difference between the maximum number of replicas and the current number of Pods. The elastic configuration of the public cloud is that the number of Pods on the public cloud is between the first difference and the second difference.
3. The method according to claim 1, characterized in that, When the current number of Pods in the stateless Pod is greater than the target number of replicas, migrating the target Pod in the stateless Pod to the public cloud includes: If it is determined that the current number of Pods in the private cloud is greater than the minimum number of replicas that is the target number of replicas, the actual minimum number of replicas is obtained from historical monitoring data; If the actual minimum number of replicas is greater than or equal to the current number of Pods, the minimum number of replicas is updated using the actual minimum number of replicas. If the actual minimum number of replicas is less than the current number of Pods, then migrate the Pods to be migrated from the private cloud in a number equal to the difference between the current number of Pods and the actual minimum number of replicas to the public cloud.
4. The method according to claim 3, characterized in that, After migrating the target Pod in the stateless Pod to the public cloud, the method further includes: Obtain the private cluster allocation rate of the private cloud, wherein the private cluster allocation rate is used to indicate the resource utilization rate of the private cloud; If the private cluster allocation rate is lower than or equal to a preset value, the specified Pod will be migrated from the public cloud to the private cloud.
5. The method according to claim 4, characterized in that, The step of migrating a specified Pod from the public cloud to the private cloud when the allocation rate of the private cluster is lower than a preset value includes: In the public cloud, fixed Pods that have not been elastically configured are filtered out, and these fixed Pods are designated as the Pods to be migrated. A new Pod is created in the private cloud that corresponds to a specified Pod in the public cloud. If the new Pod is found to be available, the specified Pod in the public cloud is deleted.
6. The method according to claim 4, characterized in that, The step of migrating Pods to the public cloud in the case where the actual minimum replica count is less than the current number of Pods includes: If the actual minimum number of replicas is less than the current number of Pods and the private cluster allocation rate is higher than a preset upper limit, the Pods to be migrated shall be forcibly migrated from the private cloud to the public cloud, wherein the preset upper limit is higher than a preset value; If the actual minimum number of replicas is less than the current number of Pods, and the private cluster allocation rate is lower than or equal to the preset value, the Pod to be migrated will not be migrated.
7. The method according to claim 3, characterized in that, The step of obtaining the actual minimum number of replicas from historical monitoring data includes: Obtain the historical load information of the private cloud; Based on the historical load data, the historical load characteristics of the private cloud are determined. Based on the historical load characteristics, the actual minimum number of replicas is determined.
8. A Pod scheduling device in a hybrid cloud model, characterized in that, include: A configuration distribution platform is configured to obtain the stateless Pods actually running in the private cloud, wherein the stateless Pods are Pods used to run stateless applications; A scheduling system is used to migrate a target Pod in a stateless Pod to a public cloud when the current number of Pods in the stateless Pod is greater than the target number of replicas. The target number of replicas is less than or equal to the minimum number of replicas, which is the minimum number of Pods required to provide application services through the private cloud and / or the public cloud. The number of stateless Pods minus the minimum number of replicas equals the number of target Pods.
9. An electronic device comprising a processor, a communication interface, a memory, and a communication bus, wherein, The processor, the communication interface, and the memory communicate with each other via the communication bus, characterized in that... The memory is used to store computer programs; The processor is configured to perform the method of any one of claims 1 to 7 by running the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 7 when run on a processor.