Container cluster management method and system, storage medium and electronic equipment

Through an automated container cluster deployment method, deployment strategies are generated and resources are allocated, which solves the problem of manual intervention dependence in the existing technology and realizes efficient and automated container cluster deployment.

CN119847539APending Publication Date: 2025-04-18CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510008042.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

Existing container cluster deployment solutions rely on manual intervention and have low automation, resulting in high labor costs and low deployment efficiency.

Method used

By obtaining cluster deployment instructions and corresponding deployment requirements information, collecting environmental data, generating cluster deployment policies, allocating resources and creating containers, the automated deployment of container clusters is achieved.

Benefits of technology

Reduces manual participation, improves the automation of container cluster management, improves deployment efficiency, and is suitable for a variety of application environments and needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847539A_ABST
    Figure CN119847539A_ABST
Patent Text Reader

Abstract

The invention provides a container cluster management method and system, a storage medium and electronic equipment, and is applied to the technical field of container management, and the method comprises the steps: obtaining a cluster deployment instruction, and obtaining deployment demand information corresponding to the cluster deployment instruction; collecting environment data, wherein the environment data comprises component information and resource state information of infrastructure resources; generating a cluster deployment strategy based on deployment demand information and the environment data; on the basis of resource allocation information in the cluster deployment strategy, allocating resources corresponding to the cluster deployment instruction in infrastructure resources; based on a container creation strategy in the cluster deployment strategy, creating containers on resources corresponding to the cluster deployment instruction, and configuring components and container information for each created container to obtain a container cluster corresponding to the cluster deployment instruction; therefore, in the process of deploying the container cluster, the manual participation degree is reduced, the automation of managing the container cluster is effectively improved, and the deployment efficiency of the capacity cluster is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of container management, and in particular to a container cluster management method and system, a storage medium and an electronic device. Background Art

[0002] In recent years, with the popularity of cloud computing and microservice architecture, containerization technology has rapidly emerged and become a key component of modern software development and deployment. Containers are widely popular due to their advantages such as lightweight, fast startup and environmental consistency.

[0003] The inventors have found that existing container cluster deployment solutions are still highly dependent on manual intervention and have a low degree of automation. Traditional container cluster deployment solutions require high labor costs and have low deployment efficiency. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a container cluster management method and system, a storage medium and an electronic device. After obtaining the cluster deployment instruction, this solution uses the acquired deployment requirement information and resource status information to generate a cluster deployment strategy, and then uses the cluster deployment strategy to create a container to complete the deployment of the container cluster. The entire process reduces manual participation, improves the automation of container cluster management, and improves the efficiency of deploying container clusters.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] The first aspect of the present application discloses a container cluster management method, including:

[0007] Obtaining a cluster deployment instruction and obtaining deployment requirement information corresponding to the cluster deployment instruction;

[0008] Collecting environmental data, the environmental data including component information and resource status information of infrastructure resources;

[0009] Generate a cluster deployment strategy based on the deployment requirement information and the environment data;

[0010] Allocating resources corresponding to the cluster deployment instruction in the infrastructure resources based on the resource allocation information in the cluster deployment strategy;

[0011] Based on the container creation strategy in the cluster deployment strategy, a container is created on the resources corresponding to the cluster deployment instruction, and components and container information are configured for each created container to obtain a container cluster corresponding to the cluster deployment instruction.

[0012] The above method may optionally further include:

[0013] A monitoring task is set for the container cluster, and the monitoring task is executed regularly, so as to collect information of each container in the container cluster after the monitoring task is executed.

[0014] In the above method, optionally, generating a cluster deployment strategy based on the deployment requirement information and the environment data includes:

[0015] Obtaining container description information in the deployment requirement information, and generating container component deployment information corresponding to the container description information based on the container description information and the component information, wherein the container component deployment information includes component deployment information of each container to be created;

[0016] Acquire resource requirement information in the deployment requirement information, and generate a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information;

[0017] The cluster deployment strategy is generated based on the container component deployment information and the resource allocation strategy.

[0018] In the above method, optionally, generating container component deployment information corresponding to the container description information based on the container description information and the component information includes:

[0019] Based on the functional description information of each container to be created in the container description information, determine each target component corresponding to the functional description information, obtain the latest version information of each target component from the component information, and based on the latest version information of each target component, generate container component deployment information for the container to be created.

[0020] Optionally, in the above method, generating a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information includes:

[0021] Based on the resource demand information, determine various types of target resources and the demand size of each type of target resource;

[0022] Allocate resources corresponding to the demand size for each type of the target resources in the infrastructure resources, and generate a resource allocation strategy.

[0023] The above method may optionally allocate resources corresponding to the demand size for each type of target resource in the infrastructure resources and generate a resource allocation strategy, including:

[0024] For each type of the target resource, determine the resources in the infrastructure resources that are of the same type as the target resource as the first resource, and determine the idle amount of the first resource;

[0025] When the idle amount of the first resource is greater than or equal to the required size of the target resource, the first resource corresponding to the required size is used as a resource allocated to the target resource of this type, and allocation information of the target resource of this type is generated;

[0026] When the idle amount of the first resource is less than the required size of the target resource, all resources in the infrastructure resources that are not of the same type as the target resource are determined as second resources;

[0027] When there is a third resource in each of the second resources, determine the difference between the idle amount of the first resource and the required size of the target resource, use all the first resources and the third resource corresponding to the difference as resources allocated to the target resource of this type, and generate allocation information of the target resource of this type, wherein the third resource is a resource having the same function as the target resource;

[0028] A resource allocation strategy is generated based on the allocation information of each of the target resources.

[0029] The above method may optionally further include:

[0030] When a capacity adjustment instruction of the container cluster is received, each container in the container cluster is processed based on an adjustment type of the container adjustment instruction.

[0031] The second aspect of the present application discloses a container cluster management system, including:

[0032] A deployment management unit is used to obtain a cluster deployment instruction and deployment requirement information corresponding to the cluster deployment instruction; collect environmental data, the environmental data including component information and resource status information of infrastructure resources; generate a cluster deployment strategy based on the deployment requirement information and the environmental data; and allocate resources corresponding to the cluster deployment instruction in the infrastructure resources based on the resource allocation information in the cluster deployment strategy;

[0033] The container unit is used to create containers on resources corresponding to the cluster deployment instructions based on the container creation strategy in the cluster deployment strategy, and configure components and container information for each created container to obtain a container cluster corresponding to the cluster deployment instruction.

[0034] In the above system, optionally, the container unit is also used to set a monitoring task for the container cluster and execute the monitoring task at a regular interval to collect information of each container in the container cluster after executing the monitoring task; preferably, the collected information of each container is uploaded to the deployment management unit.

[0035] In the above system, optionally, the deployment management unit executes a process of generating a cluster deployment strategy based on the deployment requirement information and the environment data, including:

[0036] Obtaining container description information in the deployment requirement information, and generating container component deployment information corresponding to the container description information based on the container description information and the component information, wherein the container component deployment information includes component deployment information of each container to be created;

[0037] Acquire resource requirement information in the deployment requirement information, and generate a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information;

[0038] The cluster deployment strategy is generated based on the container component deployment information and the resource allocation strategy.

[0039] In the above system, optionally, the deployment management unit performs a process of generating container component deployment information corresponding to the container description information based on the container description information and the component information, including:

[0040] Based on the functional description information of each container to be created in the container description information, determine each target component corresponding to the functional description information, obtain the latest version information of each target component from the component information, and generate container component deployment information for the container to be created based on the latest version information of each target component.

[0041] In the above system, optionally, the deployment management unit executes a process of generating a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information, including:

[0042] Based on the resource demand information, determine various types of target resources and the demand size of each type of target resource;

[0043] Allocate resources corresponding to the demand size for each type of the target resources in the infrastructure resources, and generate a resource allocation strategy.

[0044] In the above system, optionally, the deployment management unit executes a process of allocating resources corresponding to the required size for each type of target resource in the infrastructure resources and generating a resource allocation strategy, including:

[0045] For each type of the target resource, determine the resources in the infrastructure resources that are of the same type as the target resource as the first resource, and determine the idle amount of the first resource;

[0046] When the idle amount of the first resource is greater than or equal to the required size of the target resource, the first resource corresponding to the required size is used as a resource allocated to the target resource of this type, and allocation information of the target resource of this type is generated;

[0047] When the idle amount of the first resource is less than the required size of the target resource, all resources in the infrastructure resources that are not of the same type as the target resource are determined as second resources;

[0048] When there is a third resource in each of the second resources, determine the difference between the idle amount of the first resource and the required size of the target resource, use all the first resources and the third resource corresponding to the difference as resources allocated to the target resource of this type, and generate allocation information of the target resource of this type, wherein the third resource is a resource having the same function as the target resource;

[0049] A resource allocation strategy is generated based on the allocation information of each of the target resources.

[0050] In the above system, optionally, the deployment management unit is further configured to process each container in the container cluster based on an adjustment type of the container adjustment instruction when receiving a capacity adjustment instruction of the container cluster.

[0051] A third aspect of the present application discloses a storage medium, which includes stored instructions, wherein when the instructions are executed, a device where the storage medium is located is controlled to execute the container cluster management method as described above.

[0052] In a fourth aspect, the present application discloses an electronic device, comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the container cluster management method as described above.

[0053] Compared with the prior art, this application has the following advantages:

[0054] The present application provides a container cluster management method and system, storage medium and electronic device, including: obtaining cluster deployment instructions, and obtaining deployment requirement information corresponding to the cluster deployment instructions; collecting environmental data, the environmental data including component information and resource status information of infrastructure resources; generating a cluster deployment strategy based on the deployment requirement information and the environmental data; allocating resources corresponding to the cluster deployment instructions in the infrastructure resources based on the resource allocation information in the cluster deployment strategy; creating containers on the resources corresponding to the cluster deployment instructions based on the container creation strategy in the cluster deployment strategy, and configuring components and container information for each created container, so as to obtain a container cluster corresponding to the cluster deployment instruction. In the scheme provided by the present application, after obtaining the cluster deployment instruction, the cluster deployment strategy is generated using the deployment requirement information and environmental data, and then the cluster deployment strategy is used to allocate resources in the infrastructure resources, create containers on the allocated resources, and configure components and resource information for the created containers, so as to obtain a container cluster, thereby reducing manual participation in the process of deploying the container cluster, effectively improving the automation of managing the container cluster, and improving the deployment efficiency of the capacity cluster, and when deploying, the deployment is combined with the environmental data, which can be applied to a variety of application environments and requirements, and improve the applicability and versatility of the scheme. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0056] Figure 1 A flowchart of a container cluster management method provided in an embodiment of the present application;

[0057] Figure 2 A flowchart for generating a cluster deployment strategy based on deployment requirement information and environment data provided in an embodiment of the present application;

[0058] Figure 3 A flowchart of generating a resource allocation strategy corresponding to deployment requirement information based on resource requirement information and resource status information provided in an embodiment of the present application;

[0059] Figure 4 A flowchart for allocating resources corresponding to the size of the demand for each type of target resource in the infrastructure resources provided in the embodiment of the present application, and generating a resource allocation strategy;

[0060] Figure 5 A schematic diagram of the structure of a container cluster management system provided in an embodiment of the present application;

[0061] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0064] The present application can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or equipment, etc.

[0065] Reference Figure 1 , is a flow chart of a container cluster management method provided in an embodiment of the present application, and is specifically described as follows:

[0066] S101. Obtain a cluster deployment instruction, and obtain deployment requirement information corresponding to the cluster deployment instruction.

[0067] Staff can provide cluster deployment instructions through the front-end interactive interface. Cluster deployment instructions are used to deploy container clusters.

[0068] The cluster deployment instructions include deployment requirement information when the staff deploys the container cluster. The deployment requirement information includes but is not limited to resource requirement information, network configuration information, security requirement information, service level agreement information, budget constraint information, geographic distribution information, container description information, etc.

[0069] Furthermore, the resource demand information includes but is not limited to demand information of various resources, such as the required number of servers, CPU demand information, memory size demand information, storage capacity demand information, network resource demand information, etc.

[0070] Network configuration information includes but is not limited to internal network topology, bandwidth limitations, load balancer settings, etc.

[0071] Security requirement information includes but is not limited to data encryption requirements, identity authentication mechanisms, firewall rules, etc.

[0072] Service level agreement information includes, but is not limited to, requirements for response time, availability, recovery time objective (RTO), and recovery point objective (RPO).

[0073] Budget constraint information includes, but is not limited to, total cost of ownership (TCO), including hardware purchases, power consumption, maintenance costs, and the like.

[0074] Geographic distribution information includes but is not limited to the location of data centers and whether multi-region or multi-cloud deployment is required to improve redundancy.

[0075] The deployment requirement information is used to deploy the container cluster required by the worker.

[0076] S102: Collect environmental data, where the environmental data includes component information and resource status information of infrastructure resources.

[0077] Component information is obtained from the image repository, where the component information includes version information of each image component stored in the image repository. Preferably, the version information includes the latest version information of the image component and information of each historical version.

[0078] The current resource status information of the infrastructure resources is obtained. The resource status information includes the current usage information of various resources in the infrastructure resources, such as used information, idle resource information, etc.

[0079] The various types of resources in infrastructure resources include but are not limited to CPU, network resources, servers, memory, storage devices, etc.

[0080] S103: Generate a cluster deployment strategy based on deployment requirement information and environment data.

[0081] Reference Figure 2 , which is a flowchart of generating a cluster deployment strategy based on deployment requirement information and environment data provided in an embodiment of the present application, and is specifically described as follows:

[0082] S201. Obtain container description information in deployment requirement information, and generate container component deployment information corresponding to the container description information based on the container description information and component information, wherein the container component deployment information includes component deployment information of each container to be created.

[0083] The container description information includes information about each container to be created in order to implement the functions of the container cluster. Different containers have different functions or roles, so the information of each container to be created is different.

[0084] Based on the functional description information of each container to be created in the container description information, determine the target components corresponding to the functional description information, obtain the latest version information of each target component from the component information, and based on the latest version information of each target component, generate container component deployment information for the container to be created.

[0085] The functions of a container are implemented by the components deployed therein. Different combinations of components can implement different functions. Therefore, according to the functional description information of each container to be created in the container description information, each target component corresponding to the functional description information is determined.

[0086] Preferably, the components include but are not limited to master-class components: Api Server (receives commands input by users, provides authentication, authorization, API registration and discovery mechanisms, etc.), Scheduler (resource scheduler), controllerManager (control manager, responsible for maintaining the status of the cluster), etcd (responsible for storing information of various resource objects in the cluster); node-class components: Kubelet (responsible for maintaining the life cycle of the container, that is, creating, updating, and destroying containers by controlling docker), Kube Proxy (provides network proxy, load balancing and other operations for the Node node), and Docker (responsible for starting and shutting down the container).

[0087] In order to ensure the performance of the deployed container cluster, the container cluster is deployed using the latest version of the components. Therefore, for each container to be created, the target components corresponding to the functional description information of the container to be created are determined, and then the latest version information of each target component is obtained from the component information to obtain the container component deployment information of the container to be created, which includes the latest version information of each target component.

[0088] S202: Obtain resource requirement information in the deployment requirement information, and generate a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and resource status information.

[0089] Reference Figure 3 , which is a flowchart of generating a resource allocation strategy corresponding to deployment requirement information based on resource requirement information and resource status information provided in an embodiment of the present application, and is specifically described as follows:

[0090] S301. Determine various types of target resources and the demand size of each type of target resource based on resource demand information.

[0091] Each resource recorded in the resource requirement information is determined as a target resource, such as CPU, memory, etc.

[0092] According to the demand information of each resource recorded in the resource demand information, the demand size of each type of target resource is determined, and the demand of different target resources is different.

[0093] S302: Allocate resources corresponding to the demand size for each type of target resource in the infrastructure resources, and generate a resource allocation strategy.

[0094] Reference Figure 4 , which is a flowchart of allocating resources corresponding to the required size for each type of target resource in the infrastructure resources provided by the embodiment of the present application, and generating a resource allocation strategy, is specifically described as follows:

[0095] S401: For each type of target resource, determine a resource in the infrastructure resources that is of the same type as the target resource as the first resource, and determine the idle amount of the first resource.

[0096] For example, when the target resource is a CPU, the CPU in the infrastructure resources is used as the first resource, and the idle amount here can be understood as the amount of resources that have not been occupied by the first resource, or the amount of resources that can be allocated.

[0097] S402: When the idle amount of the first resource is greater than or equal to the required size of the target resource, the first resource corresponding to the required size is used as a resource allocated to the target resource of this type, and allocation information of the target resource of this type is generated.

[0098] When the idle amount of the first resource is greater than or equal to the required size of the target resource, the first resource may be used to allocate resources to the target resource of this type.

[0099] Exemplarily, the first resource corresponding to the demand size is used as the resource allocated for this type of target resource. For example, assuming that the target resource is memory and the demand size is 100MB, the first resource of 100MB is used as the resource allocated for the target resource. At this time, allocation information of this type of target resource is generated, and the allocation information includes information on the resources allocated for this type of target resource.

[0100] S403: When the idle amount of the first resource is smaller than the required amount of the target resource, all resources in the infrastructure resources that are not of the same type as the target resource are determined as second resources.

[0101] S404. When a third resource exists in each second resource, determine the difference between the idle amount of the first resource and the required size of the target resource, use all the first resources and the third resource corresponding to the difference as resources allocated to this type of target resources, and generate allocation information for this type of target resources. The third resource is a second resource with the same function as the target resource.

[0102] Furthermore, the third resource is a second resource having the same function as the target resource. In other words, the third resource can be used as a supplementary resource to the first resource. For example, the first resource is a storage resource and the third resource is a memory resource.

[0103] Because the function of the third resource is the same as that of the first resource and can implement the function of the first resource, allocating the third resource to the target resource does not affect the functions of subsequent containers.

[0104] For example, when the target resource is memory, the required size of the target resource is 1GB, and the free amount of the first resource is 900MB. In this case, the difference is 124MB. There is a storage resource in each second resource. In this case, the storage resource is determined to be a third resource, and the free amount of the third resource is greater than 124MB. Then, the 900MB first resource and the 124MB third resource are used as resources allocated to the target resource, and then the allocation information of the target resource is generated, which includes the information of the 900MB first resource and the 124MB third resource.

[0105] S405: Generate a resource allocation strategy based on the allocation information of each target resource.

[0106] The resource allocation strategy includes the allocation information of each target resource.

[0107] In the solution provided in the present application, when the third resource does not exist in each second resource, or the idle amount of the third resource is less than the difference, a prompt message of insufficient resources is generated to prompt the staff that the available resources in the infrastructure resources do not meet the resources required to create a capacity cluster.

[0108] In the solution provided in the embodiment of the present application, when the first resource does not meet the demand of the target resource, a resource that can replace the first resource can be found from other resources to meet the demand of the target resource.

[0109] In the solution provided in the embodiment of the present application, when allocating resources for each type of target resource, when the first resource does not meet the needs of the first resource, resources with the same function as the first resource can be used as supplementary resources to allocate resources to the target resource, thereby completing the resource allocation process to the greatest extent and improving the deployment success rate of container integration. In addition, the infrastructure resources can be flexibly adjusted to flexibly adapt to different deployment environments and needs.

[0110] S203: Generate a cluster deployment strategy based on the container component deployment information and the resource allocation strategy.

[0111] The cluster deployment strategy includes component deployment information and resource allocation strategy, as well as service protocol configuration information.

[0112] S104: Allocate resources corresponding to the cluster deployment instruction in the infrastructure resources based on the resource allocation information in the cluster deployment strategy.

[0113] According to the resource allocation information, resources of the cluster deployment instruction are allocated in the infrastructure resources. Preferably, the allocated resources meet the resource requirements when deploying the container cluster.

[0114] S105: Based on the container creation strategy in the cluster deployment strategy, create a container on the resources corresponding to the cluster deployment instruction, and configure components and container information for each created container to obtain a container cluster corresponding to the cluster deployment instruction.

[0115] Furthermore, when configuring components for each created container, various components required for the container are deployed in each container based on the component deployment information in the infrastructure resources. Preferably, each component is the latest version of the component.

[0116] Preferably, container information such as resource occupancy information and used service protocols is configured for each created container.

[0117] After creating each container and configuring components and container information for each container, a container cluster can be obtained.

[0118] In the solution provided by the embodiment of the present application, in order to timely understand various information of the container cluster, a monitoring task is set for the container cluster, and the monitoring task is executed regularly to collect information of each container in the container cluster after the monitoring task is executed. The information of each container includes but is not limited to the version information of each component of the container, the occupied resource information, the operation status, etc. By monitoring the container cluster, the automation of container cluster management can be improved.

[0119] By setting monitoring tasks, you can timely understand the status of the container cluster and facilitate the management of the container cluster. For example, when it is detected that the component of the container in the container cluster is not the latest version, the component can be updated to the latest version. In this way, you can ensure that the components in the containers in the container cluster are the latest version, ensuring the performance of the container cluster.

[0120] In the embodiment provided by the present application, when a capacity adjustment instruction of a container cluster is received, each container in the container cluster is processed based on the adjustment type of the container adjustment instruction. The adjustment type of the capacity adjustment instruction can be shrinking or expanding; when the adjustment instruction of the container adjustment instruction is shrinking, the resource proportion of each container in the container cluster can be reconfigured, thereby reducing the resource occupation of the container cluster, or the containers with low frequency of use in the container cluster can be deleted, thereby reducing the resource occupation of the container cluster, thereby completing the shrinking operation corresponding to the container adjustment instruction; when the adjustment type of the container adjustment instruction is expansion, the resources of each container in the container cluster are reconfigured, thereby expanding the resources of some or all containers in the container resources, and then expanding the container cluster; or a new container is created in the container cluster, thereby expanding the container cluster; thereby completing the expansion operation corresponding to the container adjustment instruction.

[0121] In the method provided in the embodiment of the present application, a cluster deployment instruction is obtained, and deployment requirement information corresponding to the cluster deployment instruction is obtained; environmental data is collected, and the environmental data includes component information and resource status information of infrastructure resources; based on the deployment requirement information and the environmental data, a cluster deployment strategy is generated; based on the resource allocation information in the cluster deployment strategy, resources corresponding to the cluster deployment instruction are allocated in the infrastructure resources; based on the container creation strategy in the cluster deployment strategy, containers are created on the resources corresponding to the cluster deployment instruction, and components and container information are configured for each created container, so as to obtain a container cluster corresponding to the cluster deployment instruction. In the scheme provided in the present application, after obtaining the cluster deployment instruction, a cluster deployment strategy is generated using the deployment requirement information and environmental data, and then the cluster deployment strategy is used to allocate resources in the infrastructure resources, and containers are created on the allocated resources, and components and resource information are configured for the created containers, so as to obtain a container cluster, thereby reducing manual participation in the process of deploying the container cluster, effectively improving the automation of managing the container cluster, and improving the deployment efficiency of the capacity cluster, and when deploying, deployment is combined with environmental data, which can be applied to a variety of application environments and requirements, and improve the applicability and versatility of the scheme.

[0122] The present application also provides a container cluster management system. Figure 5 , is a schematic diagram of the structure of a container cluster management system provided in an embodiment of the present application, the system is used to support Figure 1 The implementation of the method shown is described in detail as follows:

[0123] The deployment management unit 501 is used to obtain a cluster deployment instruction and deployment requirement information corresponding to the cluster deployment instruction; collect environmental data, the environmental data including component information and resource status information of infrastructure resources; generate a cluster deployment strategy based on the deployment requirement information and the environmental data;

[0124] The container unit 502 is used to allocate resources corresponding to the cluster deployment instructions in the infrastructure resources based on the resource allocation information in the cluster deployment strategy; create containers on the resources corresponding to the cluster deployment instructions based on the container creation strategy in the cluster deployment strategy, and configure components and resource information for each created container to obtain a container cluster corresponding to the cluster deployment instruction.

[0125] In the system provided by the embodiment of the present application, a cluster deployment instruction is obtained, and deployment requirement information corresponding to the cluster deployment instruction is obtained; environmental data is collected, and the environmental data includes component information and resource status information of infrastructure resources; based on the deployment requirement information and the environmental data, a cluster deployment strategy is generated; based on the resource allocation information in the cluster deployment strategy, resources corresponding to the cluster deployment instruction are allocated in the infrastructure resources; based on the container creation strategy in the cluster deployment strategy, containers are created on the resources corresponding to the cluster deployment instruction, and components and container information are configured for each created container, so as to obtain a container cluster corresponding to the cluster deployment instruction. In the scheme provided by the present application, after obtaining the cluster deployment instruction, a cluster deployment strategy is generated using the deployment requirement information and environmental data, and then the cluster deployment strategy is used to allocate resources in the infrastructure resources, and containers are created on the allocated resources, and components and resource information are configured for the created containers, so as to obtain a container cluster, thereby reducing manual participation in the process of deploying the container cluster, effectively improving the automation of managing the container cluster, and improving the deployment efficiency of the capacity cluster, and when deploying, deployment is combined with environmental data, which can be applied to a variety of application environments and requirements, and improve the applicability and versatility of the scheme.

[0126] It should be noted that the system provided in the present application also includes an infrastructure unit and an image repository. The infrastructure unit includes various resources, such as CPU resources, storage resources, and network resources; the image repository is used to store various components and version information of various components; preferably, the component can also be called a component image.

[0127] Furthermore, the deployment management unit has version detection function, component version management function, deployment strategy generation function and resource management function. The deployment management unit can obtain component information from the image repository using the version detection function; the component version management function can update the components in the container cluster; the deployment strategy generation function can generate cluster deployment strategies; the resource management function can schedule various resources in the infrastructure unit, such as resource allocation when deploying a container cluster. The container unit is used to orchestrate and create containers according to the cluster deployment strategy generated by the deployment management unit, thereby deploying a container cluster.

[0128] In another embodiment provided in the present application, the container unit of the system is further used to set a monitoring task for the container cluster, and execute the monitoring task at a regular interval, so as to collect information of each container in the container cluster after executing the monitoring task; preferably, the collected information of each container is uploaded to the deployment management unit.

[0129] In another embodiment provided by the present application, the deployment management unit of the system executes a process of generating a cluster deployment strategy based on the deployment requirement information and the environment data, including:

[0130] Obtaining container description information in the deployment requirement information, and generating container component deployment information corresponding to the container description information based on the container description information and the component information, wherein the container component deployment information includes component deployment information of each container to be created;

[0131] Acquire resource requirement information in the deployment requirement information, and generate a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information;

[0132] The cluster deployment strategy is generated based on the container component deployment information and the resource allocation strategy.

[0133] In another embodiment provided by the present application, the deployment management unit of the system performs a process of generating container component deployment information corresponding to the container description information based on the container description information and the component information, including:

[0134] Based on the functional description information of each container to be created in the container description information, determine each target component corresponding to the functional description information, obtain the latest version information of each target component from the component information, and generate container component deployment information for the container to be created based on the latest version information of each target component.

[0135] In another embodiment provided by the present application, the deployment management unit of the system executes a process of generating a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information, including:

[0136] Based on the resource demand information, determine various types of target resources and the demand size of each type of target resource;

[0137] Allocate resources corresponding to the demand size for each type of the target resources in the infrastructure resources, and generate a resource allocation strategy.

[0138] In another embodiment provided by the present application, the deployment management unit of the system executes a process of allocating resources corresponding to the demand size for each type of the target resource in the infrastructure resources and generating a resource allocation strategy, including:

[0139] For each type of the target resource, determine the resources in the infrastructure resources that are of the same type as the target resource as the first resource, and determine the idle amount of the first resource;

[0140] When the idle amount of the first resource is greater than or equal to the required size of the target resource, the first resource corresponding to the required size is used as a resource allocated to the target resource of this type, and allocation information of the target resource of this type is generated;

[0141] When the idle amount of the first resource is less than the required size of the target resource, all resources in the infrastructure resources that are not of the same type as the target resource are determined as second resources;

[0142] When there is a third resource in each of the second resources, determine the difference between the idle amount of the first resource and the required size of the target resource, use all the first resources and the third resource corresponding to the difference as resources allocated to the target resource of this type, and generate allocation information of the target resource of this type, wherein the third resource is a resource having the same function as the target resource;

[0143] A resource allocation strategy is generated based on the allocation information of each of the target resources.

[0144] In another embodiment provided by the present application, the deployment management unit of the system is further configured to process each container in the container cluster based on an adjustment type of the container adjustment instruction when receiving a capacity adjustment instruction of the container cluster.

[0145] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above container cluster management method.

[0146] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to perform the following operations:

[0147] Obtaining a cluster deployment instruction and obtaining deployment requirement information corresponding to the cluster deployment instruction;

[0148] Collecting environmental data, the environmental data including component information and resource status information of infrastructure resources;

[0149] Generate a cluster deployment strategy based on the deployment requirement information and the environment data;

[0150] Allocating resources corresponding to the cluster deployment instruction in the infrastructure resources based on the resource allocation information in the cluster deployment strategy;

[0151] Based on the container creation strategy in the cluster deployment strategy, a container is created on the resources corresponding to the cluster deployment instruction, and components and container information are configured for each created container to obtain a container cluster corresponding to the cluster deployment instruction.

[0152] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0153] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.

[0154] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0155] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0156] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A container cluster management method, characterized in that: include: Obtaining a cluster deployment instruction and obtaining deployment requirement information corresponding to the cluster deployment instruction; Collecting environmental data, the environmental data including component information and resource status information of infrastructure resources; Generate a cluster deployment strategy based on the deployment requirement information and the environment data; Allocating resources corresponding to the cluster deployment instruction in the infrastructure resources based on the resource allocation information in the cluster deployment strategy; Based on the container creation strategy in the cluster deployment strategy, a container is created on the resources corresponding to the cluster deployment instruction, and components and container information are configured for each created container to obtain a container cluster corresponding to the cluster deployment instruction.

2. The method according to claim 1, characterized in that Also includes: A monitoring task is set for the container cluster, and the monitoring task is executed regularly, so as to collect information of each container in the container cluster after the monitoring task is executed.

3. The method according to claim 1, characterized in that The generating a cluster deployment strategy based on the deployment requirement information and the environment data includes: Obtaining container description information in the deployment requirement information, and generating container component deployment information corresponding to the container description information based on the container description information and the component information, wherein the container component deployment information includes component deployment information of each container to be created; Acquire resource requirement information in the deployment requirement information, and generate a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information; The cluster deployment strategy is generated based on the container component deployment information and the resource allocation strategy.

4. The method according to claim 3, characterized in that The generating, based on the container description information and the component information, container component deployment information corresponding to the container description information includes: Based on the functional description information of each container to be created in the container description information, determine each target component corresponding to the functional description information, obtain the latest version information of each target component from the component information, and generate container component deployment information for the container to be created based on the latest version information of each target component.

5. The method according to claim 3, characterized in that: The generating a resource allocation strategy corresponding to the deployment requirement information based on the resource requirement information and the resource status information includes: Based on the resource demand information, determine various types of target resources and the demand size of each type of target resource; Allocate resources corresponding to the demand size for each type of the target resources in the infrastructure resources, and generate a resource allocation strategy.

6. The method according to claim 5, characterized in that The allocating resources corresponding to the demand size for each type of the target resource in the infrastructure resources and generating a resource allocation strategy includes: For each type of the target resource, determine the resources in the infrastructure resources that are of the same type as the target resource as the first resource, and determine the idle amount of the first resource; When the idle amount of the first resource is greater than or equal to the required size of the target resource, the first resource corresponding to the required size is used as a resource allocated to the target resource of this type, and allocation information of the target resource of this type is generated; When the idle amount of the first resource is less than the required size of the target resource, all resources in the infrastructure resources that are not of the same type as the target resource are determined as second resources; When there is a third resource in each of the second resources, determine the difference between the idle amount of the first resource and the required size of the target resource, use all the first resources and the third resource corresponding to the difference as resources allocated to the target resource of this type, and generate allocation information of the target resource of this type, wherein the third resource is a resource having the same function as the target resource; A resource allocation strategy is generated based on the allocation information of each of the target resources.

7. The method according to claim 1, characterized in that Also includes: When a capacity adjustment instruction of the container cluster is received, each container in the container cluster is processed based on an adjustment type of the container adjustment instruction.

8. A container cluster management system, characterized in that: include: A deployment management unit, used to obtain a cluster deployment instruction and obtain deployment requirement information corresponding to the cluster deployment instruction; Collecting environmental data, the environmental data including component information and resource status information of infrastructure resources; Based on the deployment requirement information and the environment data, a cluster deployment strategy is generated; based on the resource allocation information in the cluster deployment strategy, resources corresponding to the cluster deployment instruction are allocated in the infrastructure resources; The container unit is used to create containers on resources corresponding to the cluster deployment instructions based on the container creation strategy in the cluster deployment strategy, and configure components and container information for each created container to obtain a container cluster corresponding to the cluster deployment instruction.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the container cluster management method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The system comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to execute the container cluster management method according to any one of claims 1 to 7.