Cluster container deployment method and device, equipment, medium and program product

By adjusting the hardware and software limitations of container resources, and combining the resource affinity type of the target cluster with the business attributes of the user's containers, the problem of low cluster resource utilization was solved, achieving more efficient resource utilization and improved stability.

CN121832972APending Publication Date: 2026-04-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-06
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing container deployment methods result in low cluster resource utilization and resource redundancy waste, and resource consumption is lower than the soft limit in actual operation.

Method used

By obtaining the resource affinity type of the target cluster and the business attributes of the user container, the hard limits of container resources are adjusted, an adjustment coefficient is introduced, the soft limits of container resources are determined, and a host machine for deploying the user container is selected in the target cluster.

Benefits of technology

It improved the utilization of cluster resources, enhanced the performance and operational stability of user containers, and reduced the cost of modification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121832972A_ABST
    Figure CN121832972A_ABST
Patent Text Reader

Abstract

The invention discloses a cluster container deployment method, device and equipment, a medium and a program product, and relates to the technical field of cloud computing. The method is applied to a container management platform, and comprises the following steps: acquiring a target cluster needing to deploy a user container, and configuring a container resource hard restriction of the user container; according to the resource affinity type of the target cluster and the service attribute of the user container, processing the container resource hard restriction, and determining the container resource soft restriction; wherein the service attribute is used for representing whether the user container needs to be bound with resources or not; adjusting the container resource hard limit and the container resource soft limit according to the adjustment coefficient of the target cluster; and calling a target cluster interface, issuing the user container to a target cluster, and enabling the target cluster to select a target host machine for deploying the user container according to the container resource hard limitation and the container resource soft limitation. According to the technical scheme of the embodiment of the invention, the utilization rate of cluster resources can be effectively improved with relatively low transformation cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing technology, and in particular to a cluster container deployment method, apparatus, equipment, media, and program product. Background Technology

[0002] The container management platform provides management capabilities for multiple clusters and containers, and offers users related container management functions. For platform users with different importance levels, the container management platform applies hard and soft limits according to a fixed ratio. In this case, platform users can set hard limits for container resources through the container management platform, which calculates the soft limits based on the user's level and then distributes the user's containers to the corresponding container orchestration platform cluster by calling the cluster interface.

[0003] However, in actual test environments, the server resources consumed by existing container deployment methods only account for 10%-15% of the total server resources when all containers are running normally. In actual operation, the resources consumed by containers are even lower than the soft limit of container resources. Existing container deployment methods suffer from low cluster resource utilization and resource redundancy waste. Summary of the Invention

[0004] This invention provides a cluster container deployment method, apparatus, equipment, media, and program product that can effectively improve the utilization rate of cluster resources with low modification costs.

[0005] According to one aspect of the present invention, a cluster container deployment method is provided, applied to a container management platform, the method comprising:

[0006] Obtain the target cluster where user containers need to be deployed, and configure the hard limits of container resources for the user containers;

[0007] Based on the resource affinity type of the target cluster and the business attributes of the user container, the hard limits of container resources are processed to determine the soft limits of container resources; wherein, the business attributes are used to characterize whether the user container needs to bind resources;

[0008] The hard and soft limits of container resources are adjusted according to the adjustment coefficient of the target cluster.

[0009] The target cluster interface is invoked to distribute the user container to the target cluster, enabling the target cluster to select a target host machine for deploying the user container based on the container resource hard limits and the container resource soft limits.

[0010] According to another aspect of the present invention, a cluster container deployment apparatus is provided, applied to a container management platform, the apparatus comprising:

[0011] The container resource hard limit configuration module is used to obtain the target cluster where user containers need to be deployed and to configure the container resource hard limits of the user containers.

[0012] The container resource soft limit determination module is used to process the container resource hard limit based on the resource affinity type of the target cluster and the business attributes of the user container, and determine the container resource soft limit; wherein, the business attributes are used to characterize whether the user container needs to bind resources;

[0013] The container resource soft limit adjustment module is used to adjust the container resource hard limit and the container resource soft limit according to the adjustment coefficient of the target cluster;

[0014] The user container delivery module is used to call the target cluster interface to deliver the user container to the target cluster, so that the target cluster selects the target host machine for deploying the user container based on the container resource hard limit and the container resource soft limit.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] At least one processor; and

[0017] A memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the cluster container deployment method according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the cluster container deployment method according to any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the cluster container deployment method according to any embodiment of the present invention.

[0021] The technical solution of this invention determines soft limits for container resources by processing hard limits based on the resource affinity type of the target cluster and the business attributes of the user containers. In determining the soft limits, the resource affinity type of the target cluster and the business attributes of the user containers are considered first, improving the accuracy of the determined soft limits and thus increasing cluster resource utilization. Furthermore, by adjusting the hard and soft limits based on the adjustment coefficient of the target cluster, the accuracy of the soft limits is further improved, thereby further enhancing cluster resource utilization. In addition, the technical solution of this invention can effectively improve cluster resource utilization and enhance the performance and operational stability of user containers with relatively low modification costs.

[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of a cluster container deployment method provided in Embodiment 1 of the present invention;

[0025] Figure 2 This is a flowchart of a cluster container deployment method provided in Embodiment 2 of the present invention;

[0026] Figure 3 This is a flowchart of an existing cluster container deployment method provided according to Embodiment 2 of the present invention;

[0027] Figure 4 This is a flowchart of a cluster container deployment method provided in Embodiment 2 of the present invention;

[0028] Figure 5 This is a schematic diagram of a cluster container deployment device according to Embodiment 3 of the present invention;

[0029] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the cluster container deployment method of this invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention 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 the invention 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 a 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.

[0032] Example 1

[0033] Figure 1 This is a flowchart illustrating a cluster container deployment method according to Embodiment 1 of the present invention. This embodiment of the invention is applicable to the deployment of cluster containers. The method can be executed by a cluster container deployment device, which can be implemented in hardware and / or software. This device can be configured in an electronic device that carries cluster container deployment functionality, such as a client or server.

[0034] See Figure 1 The cluster container deployment method shown is applied to a container management platform and includes:

[0035] S101. Obtain the target cluster where user containers need to be deployed, and configure the hard limits of container resources for user containers.

[0036] Within a cluster, a container is a self-contained, lightweight package containing the application and its dependencies. Clusters can use container images to create containers. Container images contain all necessary components, including the application, libraries, and configuration, ensuring the application runs in the same way across the cluster in any environment. User containers are containers that users need to create and deploy within the cluster. The target cluster is the cluster where the user container is to be deployed. A user cluster can correspond to at least one target cluster.

[0037] A container resource hard limit can be the maximum resource available to a user container. For example, resources can include CPU and memory. Accordingly, when a user container uses more CPU or memory than its set container resource hard limit, the following may occur: If the user container's CPU usage exceeds the CPU hard limit, the user container will be restricted, such as rate-limited or stopped. If the user container's memory usage exceeds the memory hard limit, the process corresponding to the user container may be terminated to free up memory.

[0038] Specifically, the Completely Fair Scheduler (CFS) can be used to limit CPU usage in a target cluster. For example, when a user container attempts to use more CPUs than the hard limit, the CFS quota and period can be used to limit the time the user container can use CPUs within a fixed period. If a user container exhausts its quota within a given period, it will be throttled for the remainder of that period, i.e., suspended, until the next period begins. The user container's process will not be terminated, but its running speed will be reduced; that is, the user container will be rate-limited, which may cause application slowdowns or increased latency. For example, if the CPU quota is set to 1.5, then the user container can use a maximum of 150ms of CPU time every 100ms (default period). If the user container's process attempts to use more than 150ms, the user container will be rate-limited until the next period begins. Furthermore, if a user container's CPU usage exceeds the hard limit, the container image daemon will log this event, and the user container will stop running and exit.

[0039] Specifically, if a user container attempts to allocate more memory than its hard limit, and the system has no available swap space (or the swap space is also limited), then a process (usually a process within the user container) will be selected and terminated to free up the memory.

[0040] Specifically, a pre-configured cluster container deployment list by operations personnel can be obtained. From this list, the target clusters corresponding to user containers can be queried to identify the target clusters where the user containers need to be deployed. The user container deployment requester can configure hard limits on container resources for the user containers. The cluster container deployment list can be used to record the deployment relationships between clusters and containers. That is, the list can record which target cluster(s) a particular user container is deployed in.

[0041] S102. Based on the resource affinity type of the target cluster and the business attributes of the user container, process the hard limits of container resources and determine the soft limits of container resources.

[0042] Resource affinity types characterize whether a target cluster supports resource binding. From a functional perspective, resource affinity types indicate whether a target cluster supports user container core binding. In other words, resource affinity types indicate whether, within the target cluster's container environment, a user container's process or thread can be bound to a specific resource, such as a CPU core. Business attributes, on the other hand, characterize whether a user container needs to bind resources from a business requirements perspective.

[0043] In an optional embodiment of the present invention, before processing the hard limits of container resources based on the resource affinity type of the target cluster and the business attributes of the user container to determine the soft limits of container resources, the method further includes: obtaining the business type corresponding to the user container; and determining the business attributes of the user container based on the performance sensitivity of the business type.

[0044] The business type refers to the specific type of business that the user container needs to process. Optionally, based on the nature of the business, processing method, and resource requirements, the various businesses in the cluster can be divided into multiple business types. Performance sensitivity can be used to characterize the response characteristics of the user container to changes in cluster environment resources, load fluctuations, or external interference when processing the business corresponding to a business type. It can be understood that the higher the performance sensitivity of the business type, the more significant the performance fluctuations with changes in resources or load, which may lead to service interruptions in the application in the user container and a degraded user experience; the lower the performance sensitivity of the business type, the stronger the robustness of performance to changes in resources or load fluctuations, thus maintaining the stability of the application in the user container or enabling it to adapt quickly.

[0045] Specifically, the business type corresponding to the user container can be detected. The performance sensitivity of the business type can be compared with a preset performance sensitivity. If the performance sensitivity of the business type is greater than or equal to the preset performance sensitivity, the user container's business attribute is determined to be that the user container needs to bind resources; if the performance sensitivity of the business type is less than the preset performance sensitivity, the user container's business attribute is determined to be that the user container does not need to bind resources. The preset performance sensitivity is used to measure whether the user container needs to bind resources. The preset performance sensitivity can be a pre-defined minimum performance sensitivity value for a user container that requires resource binding.

[0046] This solution considers the performance sensitivity of the business types processed by user containers and predetermines the business attributes of user containers. When the performance sensitivity of the business type is high, the user container is bound to resources. This allows the process or thread of the user container to be bound to specific resources in the container environment of the target cluster, which can optimize the performance of the application in the user container, reduce the additional overhead caused by resource switching, improve the resource utilization in the cluster, and reduce the performance jitter of the application in the user container caused by the requisition of shared resources.

[0047] The container resource soft limit can be the minimum resources required for a user container to start. Conversely, if the available resources on the target host are less than the container resource soft limit, the user container cannot be deployed to the target host in the target cluster.

[0048] Specifically, the calculation method for container resource soft limits can be determined based on the resource affinity type of the target cluster and the business attributes of the user containers. This soft limit calculation method is then used to process the container resource hard limits, thus determining the final container resource soft limits. A pre-defined mapping relationship can exist between the resource affinity type of the target cluster, the business attributes of the user containers, and the calculation method for container resource soft limits, and this mapping can be stored on the device.

[0049] S103. Adjust the hard and soft limits of container resources according to the adjustment coefficient of the target cluster.

[0050] The adjustment factor is used to further adjust the hardware and software limits of container resources for user containers that need to be deployed in the target cluster. User containers can correspond to various resources in the target cluster. The adjustment factor can be different for different resources.

[0051] In an optional embodiment of the present invention, before adjusting the hard limit and soft limit of container resources according to the adjustment coefficient of the target cluster, the method further includes: detecting the actual cluster resource usage of the target cluster; and determining the adjustment coefficient of the target cluster according to the actual cluster resource usage.

[0052] Actual cluster resource usage represents the actual amount of resources used in the target cluster. It characterizes the actual resource utilization of the target cluster. Higher actual resource usage corresponds to a larger adjustment coefficient, and lower actual resource usage corresponds to a smaller adjustment coefficient.

[0053] Specifically, the actual cluster resource usage of the target cluster can be compared with the resource usage of a reference cluster. When the actual cluster resource usage equals the reference cluster resource usage, the adjustment coefficient for the target cluster is set to 1. When the actual cluster resource usage is greater than the reference cluster resource usage, the adjustment coefficient for the target cluster is greater than 1. This can be achieved by calculating the difference between the actual and reference cluster resource usage, and based on this difference, querying the corresponding change in the adjustment coefficient, and summing 1 with the change in the adjustment coefficient to obtain the adjustment coefficient for the target cluster. When the actual cluster resource usage is less than the reference cluster resource usage, the adjustment coefficient for the target cluster is less than 1. This can be achieved by calculating the difference between the actual and reference cluster resource usage, and based on this difference, querying the corresponding change in the adjustment coefficient, and summing 1 with the change in the adjustment coefficient to obtain the adjustment coefficient for the target cluster. The reference cluster resource usage can be used to measure the cluster's resource utilization. The reference cluster resource usage can be predetermined and adjusted by technical personnel. The change in the adjustment coefficient represents the degree of change of the adjustment coefficient relative to 1. Optionally, there is a preset mapping relationship between the difference and the change in the adjustment coefficient. Based on the difference, the corresponding change in the adjustment coefficient can be queried.

[0054] This solution takes into account the actual cluster resource usage of the target cluster, predetermines the adjustment coefficient of the target cluster, improves the accuracy of the adjustment coefficient of the target cluster, and thus improves the resource utilization rate of the target cluster.

[0055] Specifically, the product between the adjustment coefficient of the target cluster and the soft and hard limits of container resources can be calculated to adjust the soft limits of container resources. For example, if the adjustment coefficient is equal to 1, the soft and hard limits of container resources remain unchanged; if the adjustment coefficient is greater than 1, the soft and hard limits of container resources increase; if the adjustment coefficient is less than 1, the soft and hard limits of container resources decrease.

[0056] S104. Call the target cluster interface to distribute the user container to the target cluster, so that the target cluster can select the target host machine for deploying the user container based on the hard and soft limits of container resources.

[0057] The target cluster interface can be used to implement data transfer within the target cluster. The target host machine can be the actual deployment environment for user containers within the target cluster.

[0058] Specifically, the target cluster interface can be called to deploy user containers to the target cluster. The target cluster then selects a target host machine with available resources within the hard and soft limits of container resources for deploying the user containers.

[0059] The technical solution of this invention determines soft limits for container resources by processing hard limits based on the resource affinity type of the target cluster and the business attributes of the user containers. In determining the soft limits, the resource affinity type of the target cluster and the business attributes of the user containers are considered first, improving the accuracy of the determined soft limits and thus increasing cluster resource utilization. Furthermore, by adjusting the hard and soft limits based on the adjustment coefficient of the target cluster, the accuracy of the soft limits is further improved, thereby further enhancing cluster resource utilization. In addition, the technical solution of this invention can effectively improve cluster resource utilization and enhance the performance and operational stability of user containers with relatively low modification costs.

[0060] Example 2

[0061] Figure 2 This is a flowchart of a cluster container deployment method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment of the present invention specifies the process of "processing container resource hard limits according to the resource affinity type of the target cluster and the business attributes of the user container to determine container resource soft limits" as follows: "Based on the resource affinity type of the target cluster, detect whether the target cluster has resource affinity characteristics; when the target cluster has resource affinity characteristics, process container resource hard limits according to the business attributes of the user container to determine container resource soft limits; when the target cluster does not have resource affinity characteristics, calculate container resource soft limits according to container resource hard limits and user level." This takes into account the resource affinity characteristics of the target cluster, improves the flexibility and accuracy of container resource soft limit calculation, and thus further improves the utilization rate of cluster resources. It should be noted that parts not described in detail in this embodiment of the present invention can be found in the descriptions of other embodiments.

[0062] See Figure 2 The cluster container deployment method shown is applied to a container management platform and includes:

[0063] S201. Obtain the target cluster where user containers need to be deployed, and configure the hard limits of container resources for user containers.

[0064] S202. Based on the resource affinity type of the target cluster, detect whether the target cluster has resource affinity characteristics.

[0065] Resource affinity is a feature that enables a target cluster to support resource binding. From a functional perspective, resource affinity characterizes the target cluster's ability to support user container binding to cores. For example, the resource affinity type of a target cluster can include having resource affinity and not having resource affinity. Having resource affinity means that the target cluster supports user container binding to resources. Not having resource affinity means that the target cluster does not support user container binding to resources.

[0066] Specifically, content detection can be performed on the resource affinity type of the target cluster. If the content of the target cluster's resource affinity type is the target content, the target cluster is determined to have resource affinity characteristics; if the content of the target cluster's resource affinity type is non-target content, the target cluster is determined not to have resource affinity characteristics. Here, target content is used to identify whether the target cluster has resource affinity characteristics.

[0067] In an optional embodiment of the present invention, detecting whether the target cluster has resource affinity characteristics based on the resource affinity type of the target cluster includes: detecting the field value of the resource affinity type of the target cluster; determining that the target cluster has resource affinity characteristics when the field value is a target field value; and determining that the target cluster does not have resource affinity characteristics when the field value is a non-target field value.

[0068] The field value can be the actual field content of the resource affinity type of the target cluster. The target field value is used to identify that the target cluster has resource affinity characteristics. For example, the target field value can be "Yes". The non-target field value is a field value other than the target field value. For example, the non-target field value can be "No".

[0069] Specifically, the field value of the resource affinity type of the target cluster can be checked. If the field value is the target field value, such as "Yes", the target cluster is determined to have resource affinity characteristics; if the field value is a non-target field value, such as "No", the target cluster is determined not to have resource affinity characteristics.

[0070] This solution determines whether a target cluster has resource affinity characteristics by using the field value of the resource affinity type of the target cluster, which improves the detection efficiency of the resource affinity characteristics of the target cluster and thus improves the deployment efficiency of user containers on the target cluster.

[0071] S203. When the target cluster has resource affinity characteristics, process the hard limits of container resources according to the business attributes of the user container and determine the soft limits of container resources.

[0072] Among them, business attributes are used to characterize whether the user container needs to be bound to resources.

[0073] Specifically, when the target cluster has resource affinity characteristics, the calculation method for the soft limit of container resources is determined based on the business attributes of the user containers. This soft limit calculation method is then used to process the hard limits of container resources, thus determining the soft limit of container resources. A preset mapping relationship can exist between the business attributes of the user containers and the calculation method for the soft limit of container resources, and this mapping can be stored on the local device.

[0074] In an optional embodiment of the present invention, the container resource hard limit is processed according to the business attributes of the user container to determine the container resource soft limit, including: determining whether the user container needs to bind resources according to the business attributes of the user container; when the user container needs to bind resources, the container resource hard limit is determined as the container resource soft limit, and the adjustment coefficient is determined to be 1; when the user container does not need to bind resources, the container resource soft limit is calculated according to the container resource hard limit and the user level.

[0075] User containers need to be bound to resources, which can be understood as user containers needing to be bound to resources from the perspective of business requirements, so that user containers can better handle the corresponding business. Defining container resource hard limits as container resource soft limits can be understood as setting the ratio between container resource soft limits and container resource hard limits to 1:1; setting the adjustment coefficient to 1 can be understood as not making further adjustments to container resource soft and hard limits when deploying user containers.

[0076] User containers do not need to be bound to resources; this can be understood as meaning that, from the perspective of business requirements, user containers do not need to be bound to resources. User levels can be used to characterize the importance of a user in the container management platform. There is a mapping relationship between user levels and the ratio between container resource soft limits and container resource hard limits. Different user levels correspond to different ratios between container resource soft limits and container resource hard limits. For example, the ratio between container resource soft limits and container resource hard limits can include 1:2 or 1:3, etc.

[0077] Specifically, based on the user container's business attributes, the resource requirement of the user container is determined. If the user container's resource requirement is high (greater than or equal to a preset requirement), the user container needs to bind resources. If the user container's resource requirement is low (less than a preset requirement), the user container also needs to bind resources. When a user container needs to bind resources, the container resource hard limit is directly determined as the container resource soft limit, and an adjustment coefficient of 1 is set. When a user container does not need to bind resources, the container resource soft limit is calculated based on the ratio between the container resource hard limit and the container resource soft limit corresponding to the user level. A preset mapping relationship exists between the user container's business attributes and its resource requirement, and this relationship is stored on the device. The user container's resource requirement can be queried based on its business attributes.

[0078] This solution determines whether a user container needs to bind resources based on its business attributes. When resource binding is required, the hard limit of the container resource is designated as a soft limit, with an adjustment coefficient of 1. By considering the business needs of the user container and assuming the target container has affinity characteristics, this solution achieves resource binding for the user container, avoiding the additional overhead of resource switching, improving cluster resource utilization, and reducing performance fluctuations caused by shared resource preemption. When the user container does not need resource binding, the soft limit of the container resource is calculated based on the hard limit and user level, improving the flexibility of soft limit calculation and further enhancing cluster resource utilization.

[0079] S204. When the target cluster does not have resource affinity, calculate the container resource soft limit based on the container resource hard limit and user level.

[0080] There is a mapping relationship between user level and the ratio between container resource soft limits and container resource hard limits. Different user levels correspond to different ratios between container resource soft limits and container resource hard limits. For example, the ratio between container resource soft limits and container resource hard limits may include 1:2 or 1:3, etc.

[0081] Specifically, when the target cluster does not have resource affinity, the container resource soft limit is calculated based on the ratio between the container resource hard limit and the container resource soft limit and container resource hard limit corresponding to the user level.

[0082] S205. Adjust the hard and soft limits of container resources according to the adjustment coefficient of the target cluster.

[0083] S206. Call the target cluster interface to distribute the user container to the target cluster, so that the target cluster can select the target host machine for deploying the user container based on the hard and soft limits of container resources.

[0084] The technical solution of this invention detects whether the target cluster has resource affinity. When the target cluster has resource affinity, it processes the hard limits of container resources according to the business attributes of the user containers to determine the soft limits of container resources. When the target cluster does not have resource affinity, it calculates the soft limits of container resources according to the hard limits of container resources and the user level. By taking into account the resource affinity of the target cluster, it improves the flexibility and accuracy of the calculation of soft limits of container resources, thereby further improving the utilization rate of cluster resources.

[0085] Figure 3 A flowchart illustrating the deployment method for existing cluster containers. (e.g.) Figure 3 As shown, existing cluster container deployment methods include:

[0086] The container management platform is used to select the container cluster for container deployment and configure hard limits for container resources. The platform also retrieves user levels and calculates soft limits for container resources based on a fixed ratio between the hard and soft limits. The platform then calls the container cluster interface to distribute user containers to the cluster. Finally, the container cluster selects the target host machine for deploying user containers based on the hard and soft limits. The target cluster consists of a storage module, an orchestration module, and a host machine. The storage module stores cluster information; the orchestration module manages container orchestration, deployment, and scheduling; and the host machine is the platform on which the containers run.

[0087] However, in actual test environments, existing container deployment methods consume only 10%-15% of the total server resources when all containers are running normally. In real-world operation, the resources consumed by containers are even lower than the soft limit of container resources. Existing container deployment methods suffer from low cluster resource utilization and resource redundancy waste. Furthermore, if performance is improved by fixing the ratio between the soft and hard limits of container resources to 1:1, container operation suffers from insufficient performance and stability. Given the multi-core hardware characteristics of servers, while using a 1:1 ratio as the primary performance improvement method, high-performance clusters can be used to improve the stability of applications running in containers. However, this scenario requires a fixed 1:1 ratio between the soft and hard limits of container resources to achieve container core binding, while current container management platforms only offer ratios of 1:2 and 1:3 for user levels, which do not support this scenario.

[0088] This solution takes the calculation of user container resource soft and hard limits on the container management platform as its starting point and proposes a method to improve cluster resource utilization. It mainly involves modifications to the platform's computing logic, user container configuration, and cluster configuration, specifically including:

[0089] (1) Add the identifier of resource affinity type, the adjustment coefficient of central processing unit and the adjustment coefficient of memory in cluster configuration.

[0090] The container management platform's database records all managed cluster information through a cluster database table. A new resource affinity type identifier has been added to the cluster database table to record whether a cluster possesses resource affinity characteristics; additionally, CPU tuning coefficients and memory tuning coefficients have been added.

[0091] The container management platform can configure the field value of the resource affinity type identifier. If the cluster has affinity characteristics and can support container core binding, the field value of the "resource affinity type identifier" of the cluster is recorded as "YES", otherwise it is configured as "NO".

[0092]

[0093] If the cluster lacks affinity, the hardware and software limits for container resources can be adjusted using adjustment coefficients. Specifically, adjustment coefficients for the CPU and memory can be configured based on the actual cluster resource usage. When distributing containers, the container management platform will use these adjustment coefficients to calculate the actual hardware and software limits of container resources that need to be allocated to the container.

[0094] (2) Add an identifier that requires resource binding to the business attributes of user containers with high performance sensitivity.

[0095] Specifically, when configuring container information on the container management platform, users select the user containers that need to be bound to resources based on the performance sensitivity of the user container's business type, and configure the identifier of the resources to be bound in the business attributes of that type of user container.

[0096] (3) Modify the computational logic of the container management platform to overcome hardware and software limitations.

[0097] The container management platform has adjusted the calculation logic for the hardware and software limitations of container resources, and added a judgment on the field value of the "resource affinity type" of the target cluster where the user's container is deployed.

[0098] If the target cluster does not have affinity characteristics, then when the user container is deployed to the target cluster, the soft and hard limits of the container resources in the target cluster are calculated based on the product between the soft and hard limits of the container resources and the adjustment coefficient.

[0099] If the target cluster has affinity characteristics, then verify whether the user container's business attributes are configured to require resource binding. If a resource binding identifier is configured, then adjust the user container's soft resource limit to the hard resource limit value, which is used as the actual container configuration deployed on the target cluster. At this time, the CPU's soft and hard limit ratio is 1:1, and container core binding can be achieved on the target cluster.

[0100] Specifically, Figure 4 This is a cluster container deployment method applied to a container management platform, comprising: obtaining the target cluster where user containers need to be deployed, and configuring the hard limits of container resources for the user containers and the identifier of whether the user containers need to bind resources in the business attributes. Querying the cluster database table to obtain the resource affinity type, CPU adjustment coefficient, and memory adjustment coefficient of the target cluster. Based on the resource affinity type of the target cluster, detecting whether the target cluster has resource affinity characteristics. If the target cluster does not have resource affinity characteristics, calculating the soft limits of container resources according to the original logic, and then multiplying the soft and hard limits of container resources by the adjustment coefficient to obtain the adjusted soft and hard limits of container resources. If the target cluster has resource affinity characteristics, determining whether the user containers need to bind resources based on the business attributes of the user containers. If the user containers need to bind resources, calculating the soft limits of container resources according to the original logic, and then deploying the user containers to the target containers. If the user containers do not need to bind resources, determining the hard limits of container resources of the user containers as the soft limits of container resources. Call the container orchestration platform cluster interface to distribute the user container to the target cluster, so that the target cluster can select the target host machine for deploying the user container based on the hard and soft limits of container resources.

[0101] This invention supports adjusting the hardware and software limits of container resources at the cluster and resource granularity, and supports determining the adjustment coefficient according to the actual cluster resource usage. In resource-scarce scenarios, it can improve the utilization rate of cluster resources. Moreover, this invention also supports users to configure container core binding at the container granularity, which can reduce the temporary business impact caused by system resource switching of performance-sensitive user containers, and improve container performance and operational stability.

[0102] Example 3

[0103] Figure 5 This is a schematic diagram of a cluster container deployment device provided in Embodiment 3 of the present invention. This embodiment of the present invention is applicable to the deployment of cluster containers. This device can execute a cluster container deployment method. The device can be implemented in hardware and / or software, and can be configured in an electronic device that carries the cluster container deployment function, such as a client or server.

[0104] See Figure 5The cluster container deployment device shown is applied to a container management platform and includes: a container resource hard limit configuration module 501, a container resource soft limit determination module 502, a container resource soft limit adjustment module 503, and a user container delivery module 504. The container resource hard limit configuration module 501 is used to obtain the target cluster where user containers need to be deployed and configure the container resource hard limits for the user containers. The container resource soft limit determination module 502 is used to process the container resource hard limits according to the resource affinity type of the target cluster and the business attributes of the user containers to determine the container resource soft limits; wherein, the business attributes are used to characterize whether the user containers need to bind resources. The container resource hard and soft limit adjustment module 503 is used to adjust the container resource hard and soft limits according to the adjustment coefficient of the target cluster. The user container delivery module 504 is used to call the target cluster interface to deliver the user containers to the target cluster, so that the target cluster selects the target host machine for deploying the user containers according to the container resource hard and soft limits.

[0105] The technical solution of this invention determines soft limits for container resources by processing hard limits based on the resource affinity type of the target cluster and the business attributes of the user containers. In determining the soft limits, the resource affinity type of the target cluster and the business attributes of the user containers are considered first, improving the accuracy of the determined soft limits and thus increasing cluster resource utilization. Furthermore, by adjusting the hard and soft limits based on the adjustment coefficient of the target cluster, the accuracy of the soft limits is further improved, thereby further enhancing cluster resource utilization. In addition, the technical solution of this invention can effectively improve cluster resource utilization and enhance the performance and operational stability of user containers with relatively low modification costs.

[0106] In an optional embodiment of the present invention, the container resource soft limit determination module 502 includes: a resource affinity detection unit, configured to detect whether the target cluster has resource affinity characteristics based on the resource affinity type of the target cluster; a first container resource soft limit determination unit, configured to, when the target cluster has resource affinity characteristics, process the container resource hard limit according to the service attributes of the user container to determine the container resource soft limit; and a second container resource soft limit determination unit, configured to, when the target cluster does not have resource affinity characteristics, calculate the container resource soft limit based on the container resource hard limit and the user level.

[0107] In an optional embodiment of the present invention, the first container resource soft limit determination unit includes: a business attribute detection subunit, configured to determine whether the user container needs to bind resources based on the business attributes of the user container; a first soft limit determination subunit, configured to determine the container resource hard limit as a container resource soft limit when the user container needs to bind resources, and determine the adjustment coefficient as 1; and a second soft limit determination subunit, configured to calculate the container resource soft limit based on the container resource hard limit and the user level when the user container does not need to bind resources.

[0108] In an optional embodiment of the present invention, the resource affinity detection unit includes: a field value detection subunit, used to detect the field value of the resource affinity type of the target cluster; a first affinity detection unit, used to determine that the target cluster has resource affinity when the field value is a target field value; and a second affinity detection unit, used to determine that the target cluster does not have resource affinity when the field value is a non-target field value.

[0109] In an optional embodiment of the present invention, the apparatus further includes: a service type acquisition module, configured to acquire the service type corresponding to the user container before processing the container resource hard limit according to the resource affinity type of the target cluster and the service attribute of the user container to determine the container resource soft limit; and a service attribute determination module, configured to determine the service attribute of the user container according to the performance sensitivity of the service type.

[0110] In an optional embodiment of the present invention, the apparatus further includes: an actual cluster resource usage detection module, configured to detect the actual cluster resource usage of the target cluster before adjusting the container resource hard limit and the container resource soft limit according to the adjustment coefficient of the target cluster; and an adjustment coefficient determination module, configured to determine the adjustment coefficient of the target cluster according to the actual cluster resource usage.

[0111] The cluster container deployment device provided in the embodiments of the present invention can execute the cluster container deployment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0112] In the technical solutions of this invention, the information collected is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0113] Example 4

[0114] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.

[0115] Figure 6 A schematic diagram of an electronic device 600 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0116] like Figure 6 As shown, the electronic device 600 includes at least one processor 601 and a memory, such as a read-only memory 602 or a random access memory 603, communicatively connected to the at least one processor 601. The memory stores computer programs executable by the at least one processor. The processor 601 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 602 or loaded into the random access memory 603 from storage unit 608. The random access memory 603 can also store various programs and data required for the operation of the electronic device 600. The processor 601, read-only memory 602, and random access memory 603 are interconnected via a bus 604. An input / output interface 605 is also connected to the bus 604.

[0117] Multiple components in electronic device 600 are connected to input / output interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0118] Processor 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 601 include, but are not limited to, central processing units, graphics processing units, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any suitable processor, controller, microcontroller, etc. Processor 601 performs the various methods and processes described above, such as cluster container deployment methods.

[0119] In some embodiments, the cluster container deployment method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 600 via read-only memory 602 and / or communication unit 609. When the computer program is loaded into random access memory 603 and executed by processor 601, one or more steps of the cluster container deployment method described above may be performed. Alternatively, in other embodiments, processor 601 may be configured to perform the cluster container deployment method by any other suitable means (e.g., by means of firmware).

[0120] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays, application-specific integrated circuits (ASICs), application-specific standard products (ASICs), systems-on-a-chip (SoCs), complex programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0121] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0122] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube or liquid crystal display monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0124] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0125] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system. This addresses the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.

[0126] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0127] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for deploying a cluster container, characterized in that, Applied to a container management platform, the method includes: Obtain the target cluster where user containers need to be deployed, and configure the hard limits of container resources for the user containers; Based on the resource affinity type of the target cluster and the business attributes of the user container, the hard limits of container resources are processed to determine the soft limits of container resources; wherein, the business attributes are used to characterize whether the user container needs to bind resources; The hard and soft limits of container resources are adjusted according to the adjustment coefficient of the target cluster. The target cluster interface is invoked to distribute the user container to the target cluster, enabling the target cluster to select a target host machine for deploying the user container based on the container resource hard limits and the container resource soft limits.

2. The method of claim 1, wherein, The step of processing the container resource hard limits and determining the container resource soft limits based on the resource affinity type of the target cluster and the business attributes of the user container includes: Based on the resource affinity type of the target cluster, detect whether the target cluster has resource affinity characteristics; When the target cluster has resource affinity characteristics, the hard limits of container resources are processed according to the business attributes of the user container to determine the soft limits of container resources; When the target cluster does not have resource affinity, the container resource soft limit is calculated based on the container resource hard limit and user level.

3. The method of claim 2, wherein, The step of processing the hard limits of container resources and determining the soft limits of container resources based on the business attributes of the user container includes: Based on the business attributes of the user container, determine whether the user container needs to be bound to resources; When the user container needs to bind resources, the container resource hard limit is determined as the container resource soft limit, and the adjustment coefficient is determined to be 1; When the user container does not need to bind resources, the soft limit of container resources is calculated based on the container resource hard limit and the user level.

4. The method of claim 2, wherein, The step of detecting whether the target cluster has resource affinity characteristics based on the resource affinity type of the target cluster includes: The field values ​​of the resource affinity type of the target cluster are detected; When the value of the field is the target field value, it is determined that the target cluster has resource affinity characteristics; When the value of the field is not the target field value, it is determined that the target cluster does not have resource affinity characteristics.

5. The method of claim 1, wherein, Before determining the container resource soft limit by processing the container resource hard limit based on the resource affinity type of the target cluster and the business attributes of the user container, the method further includes: Obtain the service type corresponding to the user container; The service attributes of the user container are determined based on the performance sensitivity of the service type.

6. The method of claim 1, wherein, Before adjusting the container resource hard limit and the container resource soft limit according to the adjustment coefficient of the target cluster, the method further includes: The actual cluster resource usage of the target cluster is detected; The adjustment coefficient of the target cluster is determined based on the actual cluster resource usage.

7. A cluster container deployment apparatus characterized by comprising: The device, used in a container management platform, includes: The container resource hard limit configuration module is used to obtain the target cluster where user containers need to be deployed and to configure the container resource hard limits of the user containers. The container resource soft limit determination module is used to process the container resource hard limit based on the resource affinity type of the target cluster and the business attributes of the user container, and determine the container resource soft limit; wherein, the business attributes are used to characterize whether the user container needs to bind resources; The container resource hard and soft limit adjustment module is used to adjust the container resource hard limit and the container resource soft limit according to the adjustment coefficient of the target cluster; The user container delivery module is used to call the target cluster interface to deliver the user container to the target cluster, so that the target cluster selects the target host machine for deploying the user container based on the container resource hard limit and the container resource soft limit.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the cluster container deployment method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the cluster container deployment method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the cluster container deployment method according to any one of claims 1-6.