Cluster system expansion method, device and medium

By monitoring container horizontal scaling resources and building mirror pre-pull tasks, and combining the schedule node prediction service to obtain target nodes, the problem of low Kubernetes cluster expansion rate is solved, and efficient capacity expansion operations are achieved, which is suitable for cluster systems such as Kubernetes.

CN113064696BActive Publication Date: 2024-11-12NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202110323453.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-25
Publication Date
2024-11-12
Estimated Expiration
2041-03-25

AI Technical Summary

Technical Problem

The existing cluster expansion method based on Kubernetes platform has a low capacity expansion rate, which affects system performance and efficiency.

Method used

By starting the horizontal scaling resources of the listening container and building a mirror pre-pull task, the dispatching node prediction service is used to obtain the target node that meets the preset container scheduling conditions, and sending the mirror pull task to the target node to achieve pre-execution, avoiding the execution of the mirror during expansion. Pull task affects the rate.

Benefits of technology

It effectively improves the cluster capacity expansion rate, ensures that capacity can be expanded in time in application burst traffic scenarios, and improves data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113064696B_ABST
    Figure CN113064696B_ABST
Patent Text Reader

Abstract

The present application provides a cluster system expansion method, device and medium, which relates to the field of computer technology. The method starts monitoring container horizontal scaling resources and constructs image pre-pull tasks; obtains at least one target node that meets the preset container scheduling conditions according to the image pre-pull tasks and the scheduling node prediction service; sends image pull tasks to each target node, so that the target node that receives the image pull task executes the task to complete the expansion. By applying the embodiment of the present application, the image pull task can be pre-executed through the target node, avoiding the execution of the image pull task during the expansion and affecting the expansion rate, which can effectively improve the expansion rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a cluster system expansion method, device and medium. Background Art

[0002] Kubernetes, abbreviated as K8s, is an open source containerized application for managing multiple hosts in a cloud platform. Kubernetes has comprehensive cluster management capabilities, including rapid deployment of applications, rapid expansion and contraction, cross-host scheduling, security protection and access mechanisms, multi-tenant resource isolation, transparent service registration and service discovery mechanisms, load balancing, fault detection and repair capabilities, and multi-dimensional resource quota management capabilities.

[0003] Currently, when scaling up and down based on the Kubernetes platform, it is mainly implemented based on the relevant functions that Kubernetes provides.

[0004] However, since the existing capacity expansion method is relatively simple, there is a problem of low capacity expansion rate. Summary of the invention

[0005] The purpose of the present application is to provide a cluster system expansion method, device and medium to effectively improve the expansion rate in view of the above-mentioned deficiencies in the prior art.

[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, the present invention provides a method for expanding the capacity of a cluster system, the method comprising:

[0008] Start the monitoring container to scale resources horizontally and build image pre-pull tasks;

[0009] According to the image pre-pull task and the scheduling node prediction service, at least one target node that meets the preset container scheduling conditions is obtained;

[0010] Sending an image pull task to each of the target nodes so that the target node receiving the image pull task executes the task to complete the capacity expansion.

[0011] In an optional implementation, the acquiring at least one target node that meets a preset container scheduling condition according to the image pre-pull task and the scheduling node prediction service includes:

[0012] According to the image pre-pull task, a corresponding prediction method is matched and obtained, and the prediction method includes: container horizontal scaling resource threshold prediction, or timing prediction; according to the prediction method, it is determined whether to trigger image pre-pull, and if so, at least one target node that meets the preset container scheduling conditions is obtained according to the scheduling node prediction service.

[0013] In an optional implementation, the prediction method is the container horizontal scaling resource threshold prediction; and judging whether to trigger image pre-pulling according to the prediction method includes: judging whether the current container horizontal scaling resources meet a preset threshold.

[0014] In an optional implementation, the prediction method is the timing prediction; the determining whether to trigger image pre-pulling according to the prediction method includes: calculating and obtaining a prediction value based on the monitored container horizontal scaling resources and the container horizontal scaling resource parameters in the timing queue; and determining whether the prediction value meets a preset pre-pulling condition.

[0015] In an optional implementation, before starting to monitor the container horizontal scaling resources and constructing the image pre-pulling task, it also includes: configuring the monitoring range of the container horizontal scaling resources and the prediction method according to the service configuration file.

[0016] In an optional implementation, matching and obtaining a corresponding prediction method according to the image pre-pull task includes: matching and determining whether the image pre-pull task is in a silent period; if not, matching and obtaining a corresponding prediction method according to the image pre-pull task.

[0017] In an optional implementation, acquiring at least one target node that meets a preset container scheduling condition according to the scheduling node prediction service includes:

[0018] Obtaining the remaining resources of each node in the system according to the scheduling node prediction service;

[0019] At least one target node that meets a preset container scheduling condition is selected according to the remaining resource amount.

[0020] In an optional implementation, acquiring at least one target node that meets a preset container scheduling condition according to the scheduling node prediction service includes:

[0021] According to the scheduling node prediction service, a resource score of each node in the system is obtained, wherein the resource score is calculated and obtained according to a preset algorithm and various resource parameters;

[0022] At least one target node that meets a preset container scheduling condition is selected according to the resource score.

[0023] In a second aspect, the present invention provides a system capacity expansion device for a cluster, the system capacity expansion device comprising:

[0024] The startup module is used to start the monitoring container to scale resources horizontally and build image pre-pull tasks;

[0025] An acquisition module, used to acquire at least one target node that meets a preset container scheduling condition according to the image pre-pull task and the scheduling node prediction service;

[0026] The sending module is used to send the image pulling task to each of the target nodes, so that the target node that receives the image pulling task executes the task to complete the expansion.

[0027] In an optional implementation, the acquisition module is specifically used to match and acquire a corresponding prediction method according to the image pre-pulling task, and the prediction method includes: container horizontal scaling resource threshold prediction, or timing prediction; judging whether to trigger image pre-pulling according to the prediction method, and if so, acquiring at least one target node that meets the preset container scheduling conditions according to the scheduling node prediction service.

[0028] In an optional implementation, the prediction method is the container horizontal scaling resource threshold prediction; the acquisition module is specifically used to determine whether the current container horizontal scaling resources meet a preset threshold.

[0029] In an optional implementation, the prediction method is the timing prediction; the acquisition module is specifically configured to calculate and acquire the prediction value according to the monitored container horizontal scaling resources and the container horizontal scaling resource parameters in the timing queue;

[0030] Determine whether the predicted value meets the preset pre-pull condition.

[0031] In an optional implementation, the system capacity expansion device further includes: a configuration module, configured to configure the monitoring range of the container horizontal scaling resources and the prediction method according to a service configuration file.

[0032] In an optional implementation manner, the acquisition module is specifically used to match and determine whether the image pre-pull task is in a silent period;

[0033] If not, then the corresponding prediction method is matched and obtained according to the image pre-pulling task.

[0034] In an optional implementation, the acquisition module is specifically used to acquire the remaining resource amount of each node in the system according to the scheduling node prediction service;

[0035] At least one target node that meets a preset container scheduling condition is selected according to the remaining resource amount.

[0036] In an optional implementation, according to the scheduling node prediction service, a resource score of each node in the system is obtained, wherein the resource score is calculated and obtained according to a preset algorithm and various resource parameters;

[0037] At least one target node that meets a preset container scheduling condition is selected according to the resource score.

[0038] In a third aspect, the present invention provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the system expansion method of the cluster as described in any of the aforementioned implementations.

[0039] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the cluster system expansion method as described in any of the aforementioned implementation modes are executed.

[0040] The beneficial effects of this application are:

[0041] In the system expansion method, device and medium of the cluster provided in the embodiments of the present application, by starting the monitoring container to horizontally scale resources and constructing an image pre-pull task; according to the image pre-pull task and the scheduling node prediction service, at least one target node that meets the preset container scheduling conditions is obtained; the image pull task is sent to each target node, so that the target node that receives the image pull task executes the task to complete the expansion. By applying the embodiments of the present application, the image pull task can be pre-executed through the target node, avoiding the execution of the image pull task during expansion and affecting the expansion rate, which can effectively improve the expansion rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 A schematic diagram of a flow chart of a cluster system expansion method provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of a flow chart of another cluster system expansion method provided in an embodiment of the present application;

[0045] Figure 3A schematic diagram of a flow chart of another cluster system expansion method provided in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of a flow chart of another cluster system expansion method provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of a flow chart of another cluster system expansion method provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of a flow chart of another cluster system expansion method provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of functional modules of a cluster system expansion device provided in an embodiment of the present application;

[0050] Figure 8 A schematic diagram of functional modules of another cluster system expansion device provided in an embodiment of the present application;

[0051] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0053] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0054] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0055] Before introducing the present application, in order to facilitate a better understanding of the present application, the present application provides an explanation of the relevant terms.

[0056] Container technology: effectively divides the resources of a single operating system into isolated groups to better balance conflicting resource usage requirements between isolated groups. A container can be understood as a computing unit between a process and a virtual machine.

[0057] Kubernetes: An open source, distributed container orchestration management platform that aims to reduce the complexity of computing, network and storage resource orchestration, making the deployment of containerized applications simple and efficient, and allowing operations and maintenance personnel and developers to focus on container-based applications. Kubernetes has comprehensive cluster management capabilities, including rapid application deployment, rapid expansion and contraction, cross-host scheduling, security protection and access mechanisms, multi-tenant resource isolation, transparent service registration and service discovery mechanisms, load balancing, fault detection and repair capabilities, and multi-dimensional resource quota management capabilities.

[0058] Kubernetes cluster: A typical Kubernetes cluster consists of multiple working nodes (Node nodes), a cluster control node (Master node), and a cluster state storage system (etcd). Among them, the Master node is responsible for the entire cluster management, provides a management interface for the cluster, and monitors and orchestrates each working node in the cluster. Each working node is responsible for running containers in the form of multi-container running units. Therefore, each node needs to configure all the services and resources that the running container depends on, such as the container runtime environment. The Master node is mainly composed of three components: apiserver, controller-manger and scheduler, and an etcd storage for cluster state storage, while each Node node mainly includes components such as kubelet, kube-proxy and container engine (Docker is the most common implementation). In addition, the complete cluster service also relies on some additional components, such as kubeDNS.

[0059] Pod: A combined multi-container running unit. A Pod can include a main container and several auxiliary containers. The containers in the pod share storage and network (UST, NET, IPC namespace) and run on the same host. They work together to complete a specific function. It is the smallest deployable unit for creating and managing Kubernetes computing, and is also the basic granularity of Kubernetes scheduling.

[0060] Node: A working node of a Kubernetes cluster, which can be a physical host or a virtual machine (VM) that hosts the operation of Pod instances.

[0061] Always image pull strategy: means that the image will be pulled once regardless of whether it exists; Never image pull strategy: means that the image will not be pulled regardless of whether it exists; IfNotPresent image pull strategy: means that the image will be pulled only when the image does not exist.

[0062] When the existing cluster is expanded, taking the Kubernetes cluster as an example, the Pod is mainly scheduled to a certain Node according to the preset components and the corresponding scheduler; the image is pulled on the node according to the Pod image pulling strategy (Always strategy, IfNotPresent strategy, Never strategy). It can be seen that the existing image pulling occurs at the time of expansion, especially when the image is large, it takes a long time to complete the expansion. Therefore, the existing expansion method has the problem of low rate.

[0063] In addition, although there are other existing expansion methods, they all have the problem of low expansion rate. For example, the Dragonfly P2P file distribution system uses p2p technology to share traffic to each node in the Kubernetes cluster. Although this method can greatly shorten the time for downloading images and effectively reduce the pressure on the image warehouse, it still has the problem of low expansion rate.

[0064] In view of this, an embodiment of the present application provides a method for expanding the capacity of a cluster system. The method can be applied to any node in the cluster and can improve the expansion rate of the system.

[0065] Figure 1 A flowchart of a method for system expansion of a cluster provided in an embodiment of the present application. The system in the method may refer to a Kubernetes cluster, a Swarm cluster, a Mesos cluster, a Marathon cluster, etc., which is not limited in the present application. Optionally, the method can be applied to any control node in the cluster. In order to better understand the present application, the embodiment of the present application is described herein using the cluster as a Kubernetes cluster as an example. Optionally, the method can be applied to any Master node in the Kubernetes cluster. Optionally, the Master node can be a physical host or a virtual machine, which is not limited in this regard. Figure 1 As shown, the system expansion method may include:

[0066] S101, start the monitoring container to horizontally scale resources and build an image pre-pull task.

[0067] Horizontal Pod Autoscaling (HPA) resources may include but are not limited to CPU, memory, disk, and network resources. The HPA resources monitored according to the actual application scenario may be a combination of multiple resources. For any control node, the control node may start monitoring the HPA resources in the system during operation and build an image pre-pull task. The built image pre-pull task may include image pre-pull logic, which may include but is not limited to the trigger logic of image pre-pull, the setting parameters of the prediction method, etc. The prediction method may be used to determine whether to trigger image pre-pull.

[0068] It can be understood that by monitoring HPA resources, the usage of HPA resources in the system can be known, and by constructing image pre-pull tasks, the pre-construction of image pull tasks can be achieved, avoiding the construction of image pull tasks during capacity expansion and affecting the capacity expansion rate. Therefore, the application of the embodiments of the present application can achieve timely capacity expansion and increase the capacity expansion rate to apply burst traffic scenarios.

[0069] Of course, the present application does not limit the monitoring timing of HPA resources. Optionally, the monitoring may be performed cyclically based on a preset monitoring component, or the monitoring may be performed according to a user's monitoring request, etc., which is not limited here.

[0070] S102: Acquire at least one target node that meets preset container scheduling conditions according to the image pre-pull task and the scheduling node prediction service.

[0071] Optionally, the preset container scheduling conditions may include, but are not limited to: the remaining resources of the target node must be greater than the preset remaining resources (for example, the remaining resources of GPU, CPU, memory, disk, etc.) threshold, the resource score of the target node must be greater than the preset resource score threshold, etc., wherein the more remaining resources a node has, the more available resources the node has, and the higher the resource score of the node, the more available resources the node has. In some embodiments, the more available resources a node has, the more likely it is that the node will become the target node. It is understandable that for the scheduling of different multi-container operating units (Pods), different preset container scheduling conditions may correspond, which are not limited here.

[0072] Among them, for the image pre-pull task, by executing the image pre-pull task, it can be determined whether the image pre-pull logic is triggered. If triggered, at least one target node that meets the preset container scheduling conditions can be obtained based on the scheduling node prediction service, so that the image pull task can be executed through the at least one target node obtained to complete the capacity expansion.

[0073] In some embodiments, the scheduling node prediction service may also be integrated into a component, for example, may be integrated into a schedule-predictor component, and the scheduling node prediction service may be called by running the schedule-predictor component, but the actual implementation is not limited thereto.

[0074] S103: Sending an image pull task to each target node, so that the target node receiving the image pull task executes the task to complete capacity expansion.

[0075] Among them, the image pull task is used to obtain the target container image in the image warehouse. Based on the above embodiment, after determining at least one target node, the image pull task can be sent to each target node. It can be understood that after receiving the image pull task, each target node can perform the image pull operation. By performing the image pull operation, the target image can be pulled from the preset image warehouse, and the image pull task can be pre-executed to avoid executing the image pull task during expansion and affecting the expansion rate. Therefore, the application of the embodiment of the present application can effectively improve the expansion rate and ensure data processing efficiency. Among them, by performing the image pre-pull operation, multiple container operation units (such as Pod) can be scheduled to the target node to achieve expansion.

[0076] In summary, the system expansion method of the cluster provided in the embodiment of the present application starts to monitor the container horizontal scaling resources and constructs the image pre-pull task; obtains at least one target node that meets the preset container scheduling conditions according to the image pre-pull task and the scheduling node prediction service; sends the image pull task to each target node, so that the target node that receives the image pull task executes the task to complete the expansion. By applying the embodiment of the present application, the image pull task can be pre-executed through the target node, avoiding the execution of the image pull task during expansion and affecting the expansion rate. When expanding, the expansion rate can be effectively improved.

[0077] Figure 2 A flowchart of another cluster system expansion method provided in an embodiment of the present application. Figure 2 As shown, the above-mentioned acquisition of at least one target node that meets the preset container scheduling conditions based on the image pre-pull task and the scheduling node prediction service may include:

[0078] S201. According to the image pre-pulling task, a corresponding prediction method is matched and obtained.

[0079] The prediction method may include: container horizontal scaling resource threshold prediction, or time series prediction.

[0080] Optionally, the image pre-pull task may include the trigger logic of the image pre-pull and the setting parameters of the prediction method, wherein the setting parameters of the prediction method may be automatically generated when constructing the image pre-pull task, or may be manually specified, which is not limited here. It can be understood that according to the image pre-pull task, it can be determined whether the corresponding prediction method is the container horizontal scaling resource threshold prediction or the timing prediction. Of course, the present application does not limit the specific prediction method here. According to the actual application scenario, it can be a combination of the above two prediction methods, or it can be other prediction methods, which are not limited here.

[0081] S202: Determine whether to trigger image pre-pulling according to the prediction method. If so, obtain at least one target node that meets the preset container scheduling conditions according to the scheduling node prediction service.

[0082] Among them, based on the above embodiment, after obtaining the prediction method, it can be further determined whether to trigger image pre-pulling according to the obtained prediction method. It can be understood that if image pre-pulling is not triggered, it means that there is no need to expand capacity at this time; if image pre-pulling is triggered, it means that capacity expansion may be required in this case, then at least one target node that meets the preset container scheduling conditions can be obtained, and an image pull task can be sent to each target node. In this process, it can be understood that since the storage space of each node is limited, compared to allowing each node to execute the image pull task, the implementation of this application can solve the problem of insufficient storage space of each node and improve the success rate of the image pull task by dynamically predicting at least one target node that meets the preset container scheduling conditions to execute the image pull task to complete the expansion.

[0083] Optionally, the prediction method is container horizontal scaling resource threshold prediction; the above-mentioned determining whether to trigger image pre-pulling according to the prediction method includes: determining whether the current container horizontal scaling resources meet a preset threshold.

[0084] Based on the above embodiments, after starting to monitor HPA resources, it is possible to determine whether the current HPA resources meet the preset threshold. It is understandable that different preset thresholds may correspond to different HPA resource categories. For example, if it is a memory resource, it may be that the memory usage rate reaches 90%; if it is a CPU resource, it may be that the CPU usage rate reaches 80%. It is not limited here. It is understandable that if it is determined that the current container horizontal scaling resources do not meet the preset threshold, image pre-pull may not be triggered. If it is determined that the current container horizontal scaling resources meet the preset threshold, image pre-pull may be triggered.

[0085] Optionally, the prediction method is a timing prediction; the above-mentioned determining whether to trigger image pre-pulling according to the prediction method may include:

[0086] The predicted value is calculated and obtained according to the monitored container horizontal scaling resources and the container horizontal scaling resource parameters in the timing queue; and it is determined whether the predicted value meets the preset pre-pulling condition.

[0087] Among them, the container horizontal scaling resource parameters in the time series queue can reflect the change pattern of the container horizontal scaling resources in the historical time period. Then, according to the monitored container horizontal scaling resources and the container horizontal scaling resource parameters in the time series queue, the predicted value can be calculated and obtained, and the predicted value can indicate the change trend of the container horizontal scaling resources in the system.

[0088] Optionally, the predicted value may include, but is not limited to, predicted time parameters, container horizontal scaling predicted resource parameters, etc. For example, it is predicted that the CPU usage will reach 90% after 10 minutes. It is understandable that based on the obtained predicted value, it can be further determined whether the predicted value meets the preset pre-pull condition, and if so, the image pre-pull can be triggered.

[0089] Optionally, the preset pre-pull condition may correspond to the content of the predicted value. For example, if the predicted value is: it is predicted that the CPU usage will reach 90% after 10 minutes, optionally, the preset pre-pull condition may be: the CPU usage will be greater than 85% after 10 minutes. It can be understood that at this time, the predicted value meets the preset pre-pull condition, which will trigger the image pre-pull.

[0090] Of course, the present application does not limit the method for obtaining the prediction value. Optionally, it can be implemented based on a neural network. For example, the prediction value can be calculated based on a long short-term memory network (Long Short-Term Memory, LSTM), but it is not limited to this.

[0091] Figure 3 A schematic diagram of a flow chart of another cluster system expansion method provided in an embodiment of the present application. Figure 3 As shown, before starting the monitoring container to scale resources horizontally and build the image pre-pull task, the method further includes:

[0092] S301. Configure the monitoring range and prediction method of container horizontal scaling resources according to the service configuration file.

[0093] Optionally, the service configuration file may include multiple listening range options for HPA resources and multiple prediction method options. It is understandable that before starting to monitor the container horizontal scaling resources and build the image pre-pull task, the listening range and prediction method of the HPA resources can be configured according to the service configuration file, so that the HPA resources can be monitored based on the configured listening range of the HPA resources and the image pre-pull task can be built based on the configured prediction method.

[0094] Of course, it should be noted that, according to the actual application scenario, other parameters can also be configured through the service configuration file, for example, the silent period can be configured, and the silent period can be understood as the minimum interval period between the previous image pull task and the next image pull task, that is, after executing the previous image pull task, the image pull task will no longer be executed during the silent period, so that frequent execution of image pull tasks can be avoided, and the applicability of the expansion method can be improved. Optionally, the silent period can be 10 minutes, 30 minutes, or 1 hour, etc., and this application is not limited here.

[0095] Figure 4 A flowchart of another cluster system expansion method provided in an embodiment of the present application. Figure 4 As shown, the above-mentioned matching and obtaining corresponding prediction methods according to the image pre-pull task may include:

[0096] S401: Match and determine whether the image pre-pull task is in a silent period.

[0097] S402: If not, then according to the image pre-pull task, a corresponding prediction method is matched and obtained.

[0098] Among them, for the description of the silent period, please refer to the relevant parts mentioned above, and this application will not go into details here. Based on the above description, after constructing the image pre-pull task, optionally, you can match and determine whether the image pre-pull task is in the silent period based on the execution time of the previous image pull task. If it is, it means that there is no need to execute the image pre-pull task at this time, and then the image pull task will not be sent to each target node; if not, you can match and obtain the corresponding prediction method based on the constructed image pre-pull task. For this part of the content, please refer to the relevant description mentioned above, and this application does not limit it here.

[0099] Figure 5 A schematic diagram of a flow chart of another cluster system expansion method provided in an embodiment of the present application. Figure 5 As shown, the above-mentioned method of obtaining at least one target node that meets the preset container scheduling conditions according to the scheduling node prediction service includes:

[0100] S501. Obtain the remaining resources of each node in the system according to the scheduling node prediction service.

[0101] S502: Select at least one target node that meets a preset container scheduling condition according to the remaining resources.

[0102] In some embodiments, for each node in the system, the remaining resource amount of each node in the system can be obtained based on the scheduling node prediction service. Optionally, the types of remaining resources may include but are not limited to GPU, CPU, memory, disk, network, etc.

[0103] Referring to the above-mentioned related instructions, it can be known that the preset container scheduling condition is: the remaining resource amount of the target node must be greater than the preset remaining resource amount threshold. After obtaining the remaining resource amount of each node in the system, at least one target node that meets the preset container scheduling condition can be selected from multiple nodes according to the remaining resource amount of each node.

[0104] Figure 6 A flowchart of another cluster system expansion method provided in an embodiment of the present application. Figure 6 As shown, the above-mentioned method of obtaining at least one target node that meets the preset container scheduling conditions according to the scheduling node prediction service includes:

[0105] S601. Obtain resource scores of each node in the system according to the scheduling node prediction service, wherein the resource scores are calculated and obtained according to a preset algorithm and various resource parameters.

[0106] S602: Select at least one target node that meets a preset container scheduling condition according to the resource score.

[0107] Referring to the above-mentioned related instructions, it can be known that the preset container scheduling condition is: the resource score of the target node must be greater than the preset resource score threshold. In some embodiments, for each node in the system, it is also possible to obtain the resource score of each node in the system based on the scheduling node prediction service, and then select at least one target node that meets the preset container scheduling condition based on the resource score of each node.

[0108] Optionally, different resource categories may correspond to different preset algorithms and resource parameters. For example, for CPU resources, the CPU resource parameters may include CPU utilization, and the preset algorithm may be a mapping relationship between CPU utilization and resource score. For example, the CPU utilization is 60% to 70%, and the corresponding resource score may be 6 points; the CPU utilization is 70% to 80%, and the corresponding resource score may be 3 points; the CPU utilization is 80% to 90%, and the corresponding resource score may be 1 point; the CPU utilization is 90% to 100%, and the corresponding resource score may be 0 points. Of course, the actual preset algorithm is not limited to this.

[0109] In some embodiments, when making a selection, the resource score of each node can be sorted in a preset order (for example, descending or ascending order), and at least one target node can be determined according to the sorting order. For example, if the node's resource score is higher, it means that the node has more available resources, then any number of nodes with a higher ranking can be selected as target nodes. Of course, the present application does not limit the number of target nodes, which can be 3, 5, 10, etc., or it can be 20% of the total number of nodes, 30% of the total number of nodes, etc., and is not limited here.

[0110] Based on the relevant content of the above-mentioned embodiments, the embodiments of the present application are explained here using the Kubernetes cluster as an example. Optionally, the above-mentioned method can also be integrated into a preset control component, for example, it can be integrated into the imagePreLoader-controller control component. Optionally, the above-mentioned process of starting the monitoring container to horizontally scale resources and build an image pre-pull task can be implemented based on the imagePreLoader-controller control component. The control component imagePreLoader-controller can also further obtain at least one target node that meets the preset container scheduling conditions from the aforementioned schedule-predictor component through an HTTP request.

[0111] Optionally, for each node, an image pulling service component imagePreLoader-worker can also be deployed on each node to perform image pulling operations. For example, if a node is determined to be a target node according to the aforementioned method, the target node can perform image pulling operations through the imagePreLoader-worker component. Of course, it should be noted that when pulling the image, if it is necessary to obtain the image private key, the imagePreLoader-worker component can also be used to obtain the corresponding image private key from the secret corresponding to the container, and then the target image can be obtained in the image repository based on the image private key and the corresponding image public key in the image repository.

[0112] In some embodiments, the above method can also be used in combination with related components in the Kubernetes platform. In this way, the development efficiency of the system expansion method of the present application can be improved. For example, the Deployment mode can be used to deploy the services corresponding to the above schedule-predictor component and the imagePreLoader-controller component in the system, and the DaemonSet mode can be used to deploy the services corresponding to the above imagePreLoader-worker component on each node, but the actual deployment method is not limited to this.

[0113] Based on the content of the above embodiments, it is also necessary to explain that after capacity expansion, capacity can also be reduced according to a preset reduction algorithm, and the storage space of the node can be cleaned up regularly. For example, the disk usage percentage that triggers image cleaning (for example, 90%) and the disk usage percentage that triggers image cleaning to stop (for example, 80%) can be set, but the actual cleaning method is not limited to this.

[0114] Figure 7This is a functional module diagram of a cluster system expansion device provided in an embodiment of the present application. The basic principle and technical effects of the device are the same as those of the corresponding method embodiment described above. For the sake of brief description, the parts not mentioned in this embodiment can be referred to the corresponding contents in the method embodiment. Figure 7 As shown, the system expansion device 200 includes:

[0115] The start module 210 is used to start monitoring the horizontal scaling resources of the container and build the image pre-pull task; the acquisition module 220 is used to obtain at least one target node that meets the preset container scheduling conditions based on the image pre-pull task and the scheduling node prediction service; the sending module 230 is used to send the image pull task to each target node, so that the target node that receives the image pull task executes the task to complete the expansion.

[0116] In an optional implementation, the acquisition module 220 is specifically used to match and acquire the corresponding prediction method according to the image pre-pulling task, and the prediction method includes: container horizontal scaling resource threshold prediction, or timing prediction; judging whether to trigger image pre-pulling according to the prediction method, and if so, acquiring at least one target node that meets the preset container scheduling conditions according to the scheduling node prediction service.

[0117] In an optional implementation, the prediction method is container horizontal scaling resource threshold prediction; the acquisition module 220 is specifically used to determine whether the current container horizontal scaling resources meet a preset threshold.

[0118] In an optional implementation, the prediction method is timing prediction; the acquisition module 220 is specifically used to calculate and obtain the prediction value based on the monitored container horizontal scaling resources and the container horizontal scaling resource parameters in the timing queue; and determine whether the prediction value meets the preset pre-pull condition.

[0119] Figure 8 A schematic diagram of the functional modules of another cluster system expansion device provided in an embodiment of the present application. In an optional implementation, as Figure 8 As shown, the system expansion device 200 further includes: a configuration module 240, which is used to configure the monitoring range and prediction method of the container horizontal scaling resources according to the service configuration file.

[0120] In an optional implementation, the acquisition module 220 is specifically used to match and determine whether the image pre-pull task is in a silent period; if not, then match and acquire a corresponding prediction method according to the image pre-pull task.

[0121] In an optional implementation, the acquisition module 220 is specifically used to acquire the remaining resources of each node in the system according to the scheduling node prediction service; and select at least one target node that meets the preset container scheduling conditions according to the remaining resources.

[0122] In an optional implementation, the acquisition module 220 is specifically used to obtain the resource score of each node in the system based on the scheduling node prediction service, wherein the resource score is calculated and obtained based on a preset algorithm and various resource parameters; and at least one target node that meets the preset container scheduling conditions is selected based on the resource score.

[0123] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0124] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0125] Fig. 9 This is a schematic diagram of an electronic device structure provided in an embodiment of the present application. Fig. 9 As shown, the electronic device may include: a processor 510, a storage medium 520 and a bus 530, the storage medium 520 stores machine-readable instructions executable by the processor 510, when the electronic device is running, the processor 510 and the storage medium 520 communicate through the bus 530, and the processor 510 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0126] Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method embodiment are executed. The specific implementation method and technical effect are similar and will not be repeated here.

[0127] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0130] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0131] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0132] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A cluster system expansion method, characterized in that: The method comprises: Start the monitoring container to scale resources horizontally and build image pre-pull tasks; According to the image pre-pull task and the scheduling node prediction service, at least one target node that meets the preset container scheduling conditions is obtained; Sending an image pull task to each of the target nodes, so that the target node receiving the image pull task executes the task to complete the expansion; The acquiring at least one target node that meets a preset container scheduling condition according to the image pre-pull task and the scheduling node prediction service includes: According to the image pre-pull task, a corresponding prediction method is matched and obtained, and the prediction method includes: time series prediction; If the prediction method is time series prediction, a prediction value is calculated based on the monitored container horizontal scaling resources and the container horizontal scaling resource parameters in the time series queue, wherein the container horizontal scaling resource parameters in the time series queue are used to indicate the change law of the container horizontal scaling resources in the historical time period, and the prediction value is used to indicate the change trend of the container horizontal scaling resources in the system; Determine whether the predicted value meets the preset pre-pull condition, and if so, obtain at least one target node that meets the preset container scheduling condition according to the scheduling node prediction service; The matching and obtaining of the corresponding prediction method according to the image pre-pulling task includes: Matching to determine whether the image pre-pull task is in a silent period; If not, then the corresponding prediction method is matched and obtained according to the image pre-pulling task.

2. The method according to claim 1, characterized in that: The acquiring at least one target node that meets a preset container scheduling condition according to the image pre-pull task and the scheduling node prediction service includes: According to the image pre-pull task, a corresponding prediction method is matched and obtained, and the prediction method includes: container horizontal scaling resource threshold prediction; According to the prediction method, it is determined whether to trigger image pre-pulling. If so, at least one target node that meets the preset container scheduling conditions is obtained according to the scheduling node prediction service.

3. The method according to claim 2, characterized in that The prediction method is the prediction of the container horizontal scaling resource threshold; The determining whether to trigger image pre-pulling according to the prediction method includes: Determine whether the current container horizontal scaling resources meet the preset threshold.

4. The method according to claim 2 or 3, characterized in that: Before starting the monitoring container to scale resources horizontally and build the image pre-pull task, the following is also included: According to the service configuration file, the monitoring range of the container horizontal scaling resource and the prediction method are configured.

5. The method according to claim 2, characterized in that: The obtaining, according to the scheduling node prediction service, at least one target node that meets the preset container scheduling conditions includes: Obtaining the remaining resources of each node in the system according to the scheduling node prediction service; At least one target node that meets a preset container scheduling condition is selected according to the remaining resource amount.

6. The method according to claim 2, characterized in that The obtaining, according to the scheduling node prediction service, at least one target node that meets the preset container scheduling conditions includes: According to the scheduling node prediction service, a resource score of each node in the system is obtained, wherein the resource score is calculated and obtained according to a preset algorithm and various resource parameters; At least one target node that meets a preset container scheduling condition is selected according to the resource score.

7. A cluster system expansion device, characterized in that: The system expansion device comprises: The startup module is used to start the monitoring container to scale resources horizontally and build image pre-pull tasks; An acquisition module, used to acquire at least one target node that meets a preset container scheduling condition according to the image pre-pull task and the scheduling node prediction service; A sending module, used for sending an image pull task to each of the target nodes, so that the target node receiving the image pull task executes the task to complete the expansion; The acquisition module is specifically used to match and acquire a corresponding prediction method according to the image pre-pulling task, and the prediction method includes: time series prediction; If the prediction method is time series prediction, a prediction value is calculated based on the monitored container horizontal scaling resources and the container horizontal scaling resource parameters in the time series queue, wherein the container horizontal scaling resource parameters in the time series queue are used to indicate the change law of the container horizontal scaling resources in the historical time period, and the prediction value is used to indicate the change trend of the container horizontal scaling resources in the system; Determine whether the predicted value meets the preset pre-pull condition, and if so, obtain at least one target node that meets the preset container scheduling condition according to the scheduling node prediction service; The matching and obtaining of the corresponding prediction method according to the image pre-pulling task includes: Matching to determine whether the image pre-pull task is in a silent period; If not, then the corresponding prediction method is matched and obtained according to the image pre-pulling task.

8. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the system expansion method of the cluster as described in any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the cluster system expansion method according to any one of claims 1 to 6 are executed.

Citation Information

Patent Citations

  • Load prediction based dynamic cloud computing resource scaling method

    CN106201718A

  • Method, device and system for expanding application cluster

    CN108076082A

  • Service publishing system, method, device and equipment

    CN110413294A

  • Container scheduling method based on time sequence prediction

    CN111045820A

  • Mirror image preloading method and device and storage medium

    CN111897550A