Container starting method and device
By optimizing the image pull time during container startup and using initial node filtering and image preloading, the problem of slow container startup is solved and more efficient image pull and container startup are achieved.
Patent Information
- Application Number
- CN202410648338.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-08-30
AI Technical Summary
During the container startup process, the image pulling time is too long, resulting in slow container startup and low efficiency.
When the container to be started is scheduled, the initial nodes in the target cluster are initially filtered to determine the candidate nodes that meet the computing resource requirements of the image to be loaded, and the image is pulled in advance to reduce the image pulling time during the startup phase.
By preloading the image, the startup speed of the container is significantly improved, the time for image pulling is reduced, and the startup efficiency of the container is improved.
Smart Images

Figure CN118567783A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software development and deployment, and in particular to a container startup method and device. Background Art
[0002] In the field of modern software development and deployment, container technology has become a widely adopted deployment tool. Containers are well-known for their lightweight virtualization technology, excellent isolation and portability, and solve the problem of consistent application deployment in different environments. Kubernetes, as a container orchestration system, has been widely recognized as the industry's de facto standard.
[0003] The startup of a container depends on an image, which contains the program runtime environment and the program itself. The most time-consuming part of the container startup process is usually the image pull, which can even account for more than 90% of the entire startup time. Therefore, optimizing the image pull time can greatly improve the startup speed of the container. Therefore, a method that can optimize the image pull time to improve the startup speed of the container is urgently needed. Summary of the invention
[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0005] In view of the above-mentioned shortcomings of the prior art, the present invention discloses a container startup method and system to solve the technical problem in the related art that the container startup speed is slow and the startup efficiency is low due to the long image pulling time.
[0006] The embodiment of the present invention discloses a container startup method, which comprises: when a container to be started is scheduled, initial resource information of all initial nodes in a target cluster is initially filtered to obtain a preliminary filtering node; if at least one preliminary filtering node is the same as a candidate node, the same preliminary filtering node is recorded as a target node, the candidate node is an initial node in the target cluster that meets the computing resource requirements of an image to be loaded and is determined by simulation scheduling, and the candidate node pre-pulls and loads the image to be loaded, the image to be loaded is the image of the container to be started, and the number of the candidate nodes is at least two; the container to be started is scheduled to one of all target nodes, and the container to be started is started.
[0007] In one embodiment of the present invention, before the container to be started is scheduled, the method also includes: obtaining the image identifier and image address of the image to be loaded; determining the target cluster according to the image identifier and the preset image cluster mapping relationship; determining the computing resource requirements of the image to be loaded; simulating the scheduling of the initial nodes in the target cluster based on the computing resource requirements, and determining the initial nodes that meet the computing resource requirements as candidate nodes; sending an image preloading instruction to each candidate node, triggering the candidate node to pull the image to be loaded, so as to preload the image to be loaded at the candidate node, at least one of the image preloading instructions includes an image address.
[0008] In one embodiment of the present invention, determining the computing resource requirements of the image to be loaded includes: if the target cluster has a container using the image address, obtaining the current computing resources of the container to determine the computing resource requirements; or, if the target cluster does not have a container using the image address, obtaining preset computing resources and determining the computing resource requirements.
[0009] In one embodiment of the present invention, an image preloading instruction is sent to the candidate node to trigger the candidate node to pull the image to be loaded, including: sending an image preloading instruction to each candidate node, the image preloading instruction including an image address or image pulling object information, the image pulling object information being information of the candidate node including the image address of the received image preloading instruction, at least one of the image preloading instructions including image pulling object information; if the image preloading instruction includes an image address, triggering the candidate node to pull the image to be loaded from a preset image repository according to the image address; if the image preloading instruction includes image pulling object information, triggering the candidate node to pull the image to be loaded from the candidate node corresponding to the image pulling object information.
[0010] In one embodiment of the present invention, before sending the image preloading instruction to each candidate node, the method further includes: sorting all candidate nodes, and dividing all candidate nodes into at least two batches according to the sorting, and the number of nodes in the nth batch is less than or equal to 2 n-1 , n is a positive integer; generating an image preloading instruction for the first candidate node according to the image address; determining one of the candidate nodes in all batches before the batch where the candidate node is located as the image pull object corresponding to the candidate node, and obtaining the image pull objects corresponding to the other candidate nodes except the first candidate node, wherein the image pull objects corresponding to each candidate node of the same batch are different; generating an image preloading instruction for the candidate node according to the image pull object information corresponding to the candidate node, and obtaining the image preloading instructions corresponding to the other candidate nodes except the first candidate node.
[0011] In one embodiment of the present invention, before obtaining the image identifier and image address of the image to be loaded, the method also includes: pipeline construction of the image to be loaded; pushing the image to be loaded to a preset image repository, and triggering the step of obtaining the image identifier and image address of the image to be loaded.
[0012] In one embodiment of the present invention, after the candidate node completes preloading the image to be loaded, the method further includes: feeding back the node identifier of the candidate node to the database; when the container to be started is scheduled, the candidate node is determined by reading the node identifier of the candidate node in the database to perform a preliminary comparison between the filtering node and the candidate node.
[0013] In one embodiment of the present invention, if no preliminary filtering node is the same as the candidate node, at least some of the preliminary filtering nodes are recorded as target nodes; the container to be started is scheduled to at least one preliminary filtering node, and the container to be started is started.
[0014] In one embodiment of the present invention, scheduling the container to be started to one of all target nodes includes: performing scheduling preference scoring on all target nodes to obtain a scheduling preference score for each target node; determining at least one target node as a current scheduling node according to the ranking of the scheduling preference scores; and scheduling the container to be started to the current scheduling node.
[0015] The embodiment of the present invention discloses a container startup device, which includes: a node preliminary filtering module, which is used for performing preliminary filtering according to the initial resource information of all initial nodes in a target cluster when a container to be started is scheduled, so as to obtain a preliminary filtering node; a node re-filtering module, which is used for recording the same preliminary filtering node as a target node if there is at least one preliminary filtering node that is the same as a candidate node, wherein the candidate node is an initial node in the target cluster that meets the computing resource requirements of an image to be loaded and is determined by simulation scheduling, and the candidate node pre-pulls and loads the image to be loaded, the image to be loaded is the image of the container to be started, and the number of the candidate nodes is at least two; and a scheduling module, which is used for scheduling the container to be started to one of all target nodes, and starting the container to be started.
[0016] The present invention discloses an electronic device, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.
[0017] Beneficial effects of the present invention:
[0018] When the container to be started is scheduled, the initial nodes in the target cluster are first preliminarily filtered to obtain the preliminary filtering nodes. If there is a preliminary filtering node that is the same as the candidate node that is pre-loaded with the image to be loaded, the same preliminary filtering node is used as the target node, and the container to be started is scheduled to one of the target nodes to start the container to be started. In the above manner, since the selected target node is pre-loaded with the image to be loaded, the image pulling time in the startup phase can be greatly reduced, and the startup speed of the container can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A schematic diagram of a process of starting a container in an embodiment of the present invention;
[0020] Figure 2 This is a schematic diagram of finding a target cluster through a mirror identifier in an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of a process for pulling an image to be loaded in an embodiment of the present invention;
[0022] Figure 4 This is a schematic diagram of the process of scheduling a container to be started in an embodiment of the present invention;
[0023] Figure 5 This is a schematic diagram of the process of scheduling a container to be started in an embodiment of the present invention;
[0024] Figure 6 Schematic diagram of the working process of the mirror filter in an embodiment of the present invention;
[0025] Figure 7 This is a schematic diagram of a specific process of the container startup method in an embodiment of the present invention;
[0026] Figure 8 A schematic diagram of the overall system architecture of a container startup method according to an embodiment of the present invention;
[0027] Fig. 9 This is a schematic diagram of the structure of a container starting device in an embodiment of the present invention;
[0028] Fig.10 FIG. 4 is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.
[0030] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present invention in a schematic manner. Therefore, the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0031] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0032] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0033] Unless otherwise stated, the term "plurality" means two or more.
[0034] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0035] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0036] For ease of understanding, the terms involved in the embodiments of the present application are explained below:
[0037] Container technology is a virtualization technology that manages applications by virtualizing the operating system. It is a way of encapsulating, distributing, and deploying applications. The container contains a complete application runtime environment. In addition to the application itself, it also includes all dependencies, class libraries, other binary files, configuration files, etc. required for the application to run. They are all packaged into the container image package. When the container application deployed in the container is running, the container needs to be started first.
[0038] Kubernetes (K8S) is a container cluster management system and an open source container orchestration platform that can realize functions such as automated deployment of container clusters, automatic expansion and contraction, maintenance and management of containerized applications. Kubernetes is a container-based cluster orchestration engine with multiple features and capabilities such as cluster expansion, rolling upgrade and rollback, elastic scaling, automatic healing, and service discovery.
[0039] Pod is the smallest scheduling and resource allocation unit of K8S, and the smallest deployable unit. It contains the container operating environment and resources. Pods are isolated from each other. Usually one Pod runs one container. When the relationship between some containers is very close, such as file exchange, frequent RPC (Remote Procedure Call) calls, shared network or storage, etc., it is necessary to run multiple containers in one Pod for convenient scheduling and management. Pod, container group, is a combination of one or more containers that share network and storage resources and run on the same host.
[0040] Kube-scheduler-simulator is a simulation scheduler for Kubernetes that can simulate the scheduling process and obtain scheduling results.
[0041] Taints are defined on nodes and are used to reject Pods from being scheduled to a node unless the Pod has the taint tolerance on the node. Nodes marked with Taints are not faulty nodes.
[0042] Scheduling is the process of allocating a Pod to a node that can satisfy the Pod's resource requests.
[0043] Combination Figure 1 As shown, Figure 1 FIG. 1 is a flow chart of a container startup method in an embodiment of the present invention. Figure 1 As shown, the embodiment of the present disclosure provides a container startup method, including:
[0044] Step S110: When the container to be started is scheduled, preliminary filtering is performed according to the initial resource information of all initial nodes in the target cluster to obtain preliminary filtered nodes.
[0045] This preliminary filtering process can be implemented by the existing Kubernetes scheduler. The filtering stage will select all nodes that meet the Pod scheduling requirements. For example, the Pod Fits Resources filter function checks whether the available resources of the candidate nodes can meet the Pod's resource request. After filtering, a node list containing all schedulable nodes is obtained, that is, the preliminary filtered node list is obtained. Usually, this node list contains more than one node. In other words, the number of preliminary filtered nodes is at least two. Of course, in extreme cases, there may be only one node.
[0046] Sometimes, in a target cluster, the scheduling of one or more copies of the container to be started may be involved. In this case, the method provided in this embodiment can also be used to start the container of each copy of the container to be started. In this embodiment, the start of one container is taken as an example. The start of multiple containers in the target cluster can be implemented by referring to this method, and no further description is given.
[0047] In the process of preliminary filtering, all the initial nodes in the target cluster can be filtered by combining at least one filtering rule of node status filtering, port filtering, taint filtering, resource filtering and other filtering rules set by those skilled in the art. The initial resource information includes but is not limited to at least one of the node status, port, taint, resource status and other attribute information specified by those skilled in the art according to the setting of the filtering rule. This process can be implemented by the node filtering method in the existing container scheduling process known to those skilled in the art. Among them, nodes in an unavailable state can be filtered out by node status filtering, such as nodes that are offline. Since some containers will occupy the ports of the host, port filtering can be used to exclude these hosts if the ports used by the container are already occupied on the host. Computing nodes can be tainted, and containers need to be explicitly configured to tolerate these taints before they can be scheduled to these computing nodes. Through taint filtering, it can be realized that if these taints are not tolerated, the scheduler excludes the computing nodes with taints. Through resource filtering, computing nodes whose CPU or memory and disk resources do not meet the container operation requirements can be filtered out.
[0048] In one embodiment, before the container to be started is scheduled, the method also includes: obtaining the image identifier and image address of the image to be loaded; determining the target cluster according to the image identifier and the preset image cluster mapping relationship; determining the computing resource requirements of the image to be loaded; simulating the scheduling of the initial nodes in the target cluster based on the computing resource requirements, and determining the initial nodes that meet the computing resource requirements as candidate nodes; sending an image preloading instruction to each candidate node, triggering the candidate node to pull the image to be loaded, so as to preload the image to be loaded at the candidate node, at least one image preloading instruction includes an image address.
[0049] Among them, as an example, the domain name of the image address can be used as the image identifier. The image identifier, the image address and the image to be loaded are associated with each other. The image identifier can represent the identity of the image to be loaded, and then the cluster corresponding to the image identifier is found through the pre-set preset image cluster mapping relationship. The preset image cluster mapping relationship represents the mapping relationship between multiple preset image identifiers and preset clusters. A preset image identifier can have a corresponding relationship with one or more preset clusters. If the image to be loaded is one of the preset image identifiers, then the preset cluster corresponding to it, that is, the target cluster, can be found through the image identifier. The number of target clusters may be one or more. If the number of target clusters is multiple, the processing method of each target cluster is similar. The following embodiment takes one target cluster as an example. The processing method of multiple target clusters can be referred to and reproduced on other target clusters by those skilled in the art.
[0050] See also Figure 2 , Figure 2 FIG. 1 is a schematic diagram of finding a target cluster through a mirror identifier in an embodiment of the present invention. Figure 2 As shown, taking the image identifier as the image address domain name as an example, the image address domain name A has a mapping relationship with Kubernetes cluster A (1 target cluster), and the image address domain name B has a mapping relationship with Kubernetes cluster B and Kubernetes cluster C (2 target clusters). That is, it shows that a to-be-loaded image can have a mapping relationship with one or more preset clusters, and the number of target clusters can be one or more.
[0051] Continuing with the above embodiment, determining the computing resource requirements of the image to be loaded includes: if the target cluster has a container using the image address, obtaining the current computing resources of the container to determine the computing resource requirements; or, if the target cluster does not have a container using the image address, obtaining preset computing resources and determining the computing resource requirements.
[0052] In the above manner, first query whether there is a container Pod using the image to be loaded in the target cluster. If there is a Pod using the image to be loaded, the computing resource requirements are determined by the current computing resources of the Pod. The computing resource requirements can directly use the current computing resources as the computing resource requirements, or can be obtained by adding certain preset redundant resources on the basis of the current computing resources. The current computing resources include but are not limited to the CPU and memory configuration information of the Pod. At this time, the computing resource requirements include but are not limited to CPU requirements and memory configuration requirements. If there is no Pod using the image to be loaded, the preset computing resources pre-set by those skilled in the art can be used as the computing resource requirements. The preset computing resources can be pre-set according to the image address or image identifier of different images to be loaded. In this way, preset computing resources that meet the requirements can be designed as much as possible. As an example, the current computing resources can be regarded as the total computing capacity (CPU and memory). At this time, the computing resource requirements are the minimum threshold of the total computing capacity, that is, the minimum CPU threshold and the minimum memory threshold.
[0053] Continuing from the above embodiment, sending an image preloading instruction to a candidate node to trigger the candidate node to pull the image to be loaded includes: sending an image preloading instruction to each candidate node, the image preloading instruction including an image address or image pulling object information, the image pulling object information is the information of the candidate node including the image address in the received image preloading instruction, and at least one image preloading instruction includes the image pulling object information; if the image preloading instruction includes the image address, triggering the candidate node to pull the image to be loaded from the preset image repository according to the image address; if the image preloading instruction includes the image pulling object information, triggering the candidate node to pull the image to be loaded from the candidate node corresponding to the image pulling object information.
[0054] The image to be loaded of at least one candidate node is pulled from the preset image warehouse, and the image to be loaded of at least one candidate node is pulled from other candidate nodes that have already pulled the image to be loaded. In this way, by transferring the pulling objects of the images to be loaded of a part of the candidate nodes from the preset image warehouse to other candidate nodes that have already pulled the images to be loaded, the pressure of the preset image warehouse is effectively diverted, and all candidate nodes do not need to queue up to pull the images to be loaded from the preset image warehouse. The preloading speed of all candidate nodes can be effectively improved, and the problem of performance fluctuations of the preset image warehouse (central image warehouse) caused by all candidate nodes pulling from the preset image warehouse can be avoided. For example, a candidate node pulls the image to be loaded from the preset image warehouse, and then other candidate nodes pull the image to be loaded from the candidate node. By dividing the candidate nodes into multiple batches, each batch pulls the image to be loaded from the candidate nodes of the previous batch in turn, and the candidate nodes that pull the image to be loaded from the preset image warehouse are used as the first batch. In this way, only one candidate node is needed to pull the image to be loaded from the preset image warehouse, which effectively reduces the pressure on the preset image warehouse.
[0055] When the candidate node pulls the image to be loaded, the pulling of the image to be loaded can be achieved by the existing technology, or the method provided by this embodiment can be adopted to inform the candidate node through the preloading instruction whether to pull the image to be loaded from the central image warehouse (preset image warehouse) or from other candidate nodes. When the preloading instruction includes the image address, it indicates that the candidate node is instructed to pull the image to be loaded directly from the preset image warehouse. When the preloading instruction includes the image pulling object information, it indicates that the candidate node is required to pull the image to be loaded from other candidate nodes. In another embodiment, the image preloading instruction includes at least one of the image address and the image pulling object information. When the image preloading instruction includes the image pulling object information and the image address, it indicates that the candidate node is instructed to pull the image to be loaded from other candidate nodes first. If the image to be loaded fails to be pulled from other candidate nodes, the image to be loaded is pulled from the central image warehouse according to the image address. By controlling the content in the image preloading instruction, the image to be loaded of the candidate node can be pulled from the central image repository or preferentially from other candidate nodes that have completed preloading.
[0056] Following the above embodiment, before sending the image preloading instruction to each candidate node, the method further includes: sorting all candidate nodes, and dividing all candidate nodes into at least two batches according to the sorting, and the number of nodes in the nth batch is less than or equal to 2 n-1, n is a positive integer; generating an image preloading instruction for the first candidate node according to the image address; determining one of the candidate nodes in all batches before the batch where the candidate node is located as the image pull object corresponding to the candidate node, and obtaining the image pull objects corresponding to the other candidate nodes except the first candidate node, wherein the image pull objects corresponding to each candidate node of the same batch are different; generating an image preloading instruction for the candidate node according to the image pull object information corresponding to the candidate node, and obtaining the image preloading instructions corresponding to the other candidate nodes except the first candidate node.
[0057] Among them, the sorting criteria for sorting all candidate nodes can be a preset standard by those skilled in the art, or can be sorted in a random manner. Alternatively, they can be sorted according to the simulated scheduling scores obtained during the simulated scheduling of the initial nodes in the target cluster. For candidate nodes with the same simulated scheduling scores, they can also be sorted again randomly or according to the needs of those skilled in the art.
[0058] When dividing the candidate nodes into batches, it can be understood that the batch represents the priority of the candidate node in pulling the image to be loaded. For the first batch, n=1, at this time the number of nodes in the first batch is 1; for the second batch, n=2, at this time the number of nodes in the second batch is 2; for the third batch, n=3, at this time the number of nodes in the third batch is 4; for the fourth batch, n=4, at this time the number of nodes in the fourth batch is 8... For the last batch, there may be fewer candidate nodes left, at this time all the remaining candidate nodes are taken as the last batch. The number of each batch increases exponentially, and the base of the exponent in this embodiment is selected as 2, which can ensure that each candidate node in the subsequent batch can find a corresponding candidate node in the previous batch, so that the pulling of the image to be loaded between the candidate nodes is "point-to-point".
[0059] The image preloading instruction of the first batch of candidate nodes, that is, the candidate nodes ranked first, includes the image address, so that the candidate nodes of the first batch can also pull the image to be loaded from the central image warehouse (preset image warehouse) based on the image address. For the candidate nodes after the first batch, the candidate nodes in the later batch will determine one of the candidate nodes in the previous batch as the image pulling object corresponding to it, so that the candidate nodes in the later batch can subsequently pull the image to be loaded from the image pulling object in the previous batch. By generating an image preloading instruction based on the image pulling object information of the image pulling object, it is indicated that the candidate node in the later batch should pull the image to be loaded from which previous candidate node. It should be noted that the pulling of the image to be loaded is carried out in the order of the batch.
[0060] Through the above method, it is possible to pre-specify whether the image to be loaded for each candidate object is pulled from the central image warehouse or from other candidate nodes, and also specify which previous candidate object the candidate objects in the later batch should pull the image to be loaded from, thereby realizing the generation of image pre-loading instructions for each candidate object.
[0061] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of a method for pulling an image to be loaded in an embodiment of the present invention. Figure 3 As shown, extract the example.com / project / app_name part in the image address example.com / project / app_name:tag, query the database to see if there is a Pod using this address in the target cluster, if there is no Pod, set the CPU and memory configuration of the Pod to the default value (determine the computing resource requirements according to the preset computing resources). If there is a Pod, obtain its (the existing Pod) current CPU and memory configuration (current computing resources), take the simulation scheduling through the kube-scheduler-simulator open source scheduling simulator as an example, use the kube-scheduler-simulator open source scheduling simulator to simulate the scheduling of the CPU and memory resource requirements obtained in the above steps, that is, use the kube-scheduler-simulator open source component to simulate the scheduling of the resources required by the Pod, and obtain the scores of all nodes that enter the scheduler's preferred stage. Entering the preferred stage indicates that the node meets the conditions for running the configured container, that is, obtain the candidate nodes and the simulated scheduling scores of the candidate nodes. The set sorted from high to low by the scheduling score (the simulated scheduling score of the node entering the preferred stage) is {1,2,...N}, where node 1 pulls the image from the central image warehouse. Send image preloading instructions to the client of node 1. The instructions mainly contain two parts of information: one is the address of the preloaded image, and the other is to specify where the client should pull the image from. Node 1 is specified to pull the image from the central image repository. For node i (i>1), it pulls the image from the node before it (such as i-1, etc.). Send image pulling instructions in batches, with 2 nodes in each batch. (n-1) , n starts from 1, for node i (i>1), specify it to pull the image from the client of node i-1.
[0062] In one embodiment, before obtaining the image identifier and image address of the image to be loaded, the method further includes: constructing the image to be loaded by pipeline; pushing the image to be loaded to a preset image repository, and triggering the step of obtaining the image identifier and image address of the image to be loaded. For example, when the image is pushed through the pipeline, the preloading of the image to be loaded is triggered, and the input parameter is the image address.
[0063] In one embodiment, after the candidate node completes preloading of the image to be loaded, the method further includes: feeding back the node identifier of the candidate node to the database; when the container to be started is scheduled, the candidate node is determined by reading the node identifier of the candidate node in the database to perform a preliminary comparison between the filtering node and the candidate node. The database stores the preloading status of the candidate node, and also records data such as the usage status of Pods in different clusters for different image addresses.
[0064] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of scheduling a container to be started in an embodiment of the present invention. Figure 4 As shown, taking the image identifier as the image address as an example, when the pipeline pushes the image, the input parameter is the image address, that is, the input is the image address. The planning matcher in the preload controller is used to determine which clusters are target clusters based on the image address, and the preload calculation module determines which nodes of which cluster should be loaded, and performs the image loading action. The planning matcher pulls the preset image cluster mapping relationship from the database, and then determines the target cluster based on the image address and the preset image cluster mapping relationship. The preload calculation module is then used to perform simulated scheduling of the initial nodes in the target cluster to obtain candidate nodes. Figure 4 In the example, computing node N and computing node M are taken as examples, and computing node P is taken as a non-alternative node. Then, image pulling instructions (image preloading instructions) are issued to the alternative nodes computing node N and computing node M. For computing node N, its image preloading instruction includes the image address, and the image is subsequently pulled from the central image warehouse based on the image address by the client of computing node N. For computing node M, the image preloading instruction includes image pulling object information, instructing the client of computing node M to pull the image from computing node N, that is, to pull the image from the neighboring node. After the image is pulled, the client of computing node M and the client of computing node N will report the node image information to the database so that it can be known which nodes have completed the preloading of the image. For computing node P, which does not pull the image, it can also choose to report the node image information to the database to inform that computing node P has not preloaded the image.
[0065] Step S120: If there is at least one preliminary filtering node that is identical to the candidate node, the identical preliminary filtering node is recorded as the target node.
[0066] Among them, the candidate node is the initial node in the target cluster that meets the computing resource requirements of the image to be loaded and is determined by simulation scheduling, and the candidate node pre-pulls and loads the image to be loaded, the image to be loaded is the image of the container to be started, and the number of candidate nodes is at least two. The candidate node can be the initial node in the target cluster that meets all the computing resource requirements of the image to be loaded obtained by pre-simulation scheduling, and the image to be loaded is pre-loaded on the candidate node, and at least part of the preloading of the image to be loaded is achieved by pulling the resources of the image to be loaded of other candidate nodes.
[0067] It can be understood that in addition to conventional node filtering, this embodiment also provides filtering of the preliminary filtering results based on whether the image to be loaded has been pre-loaded. In this way, the scheduling process can be intervened based on whether the image is pre-loaded, and the image that the container depends on is guaranteed to exist in advance on the scheduling node of the container.
[0068] In one embodiment, if no preliminary filtering node is the same as the candidate node, at least some of the preliminary filtering nodes are recorded as target nodes; the container to be started is scheduled to at least one preliminary filtering node, and the container to be started is started. In special cases, the time interval between the image preloading step and the subsequent scheduling step is long, resulting in a change in the node state, so that the candidate nodes cannot meet the scheduling requirements of the current container. At this time, in order to ensure the normal startup of the container, a suitable node can be found in the previous preliminary filtering node as the target node, giving priority to ensuring the normal startup of the container.
[0069] Step S130: Schedule the container to be started to one of all target nodes, and start the container to be started.
[0070] In one embodiment, scheduling the container to be started to one of all target nodes includes: performing scheduling preference scoring on all target nodes to obtain a scheduling preference score for each target node; determining at least one target node as the current scheduling node according to the ranking of the scheduling preference scores; and scheduling the container to be started to the current scheduling node. For example, the target node with the highest ranking may be used as the current scheduling node to start the container. Of course, sometimes the current scheduling node that may be selected may not be the target node with the highest score, and this can be based on the needs of those skilled in the art to set the selection rules.
[0071] See also Figure 5 , Figure 5 FIG. 1 is a flow chart of scheduling a container to be started in an embodiment of the present invention. Figure 5As shown, the resource information of all computing nodes is obtained, that is, the initial resource information of all initial nodes in the target cluster is obtained, and the filter chain is entered to filter out nodes that do not meet the requirements in turn, that is, to perform preliminary filtering to obtain preliminary filtered nodes. The filter chain includes but is not limited to Figure 4 One or more of the node status filter, port filter, taint filter, resource filter, and other filters shown in the figure. Then, by adding a mirror filter as a new filter at the end of the filter chain, that is, Figure 4 See Mirror Filter in Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the working process of the image filter in an embodiment of the present invention. Figure 6 As shown, get the image list of all nodes, check whether there is a node containing a specific image in the node list reaching this filter, that is, check whether there is an alternative node. If not, the filter directly returns all nodes reaching the filter, and feeds back all the preliminary filtering nodes. If there is a node containing a specific image, filter out the nodes that do not contain the specific image, that is, if there is at least one preliminary filtering node that is the same as the alternative node, record the same preliminary filtering node as the target node, and filter out the preliminary filtering nodes that are not the target nodes. Then enter the optimization scoring stage of the Kubernetes scheduler, and determine the current scheduling node through the scheduling optimization score. As shown Figure 4 As shown, all filters constitute the Kubernetes scheduler filter.
[0072] See also Figure 7 , Figure 7 This is a specific flow chart of the container startup method in an embodiment of the present invention. Figure 8 , Figure 8 FIG. 1 is a schematic diagram of the overall system architecture of the container startup method in an embodiment of the present invention. Figure 7 and Figure 8 As shown, first, the pipeline system builds the image and pushes the image to the image warehouse. The image push event triggers the preloading module (i.e., the image preloading module) to preload the image to certain nodes of a cluster. When the container is scheduled, the scheduler filters out the nodes where the preloaded image does not exist in the filter, that is, the container is scheduled to the node where the image has been preloaded. Take two target clusters as an example, Kubernetes cluster 1 and Kubernetes cluster 2 are the target clusters, and the computing nodes (computing node 1, computing node 2, computing node N, etc.) in each target cluster are scheduled respectively by the container scheduling module, and then according to the container startup method provided in this embodiment, the candidate nodes preloaded with the image are preferably used as the target nodes, and the containers are scheduled on these target nodes.
[0073] The container startup method provided by the above embodiment performs preliminary filtering on the initial nodes in the target cluster to obtain preliminary filtering nodes when the container to be started is scheduled. If there is a preliminary filtering node that is the same as the candidate node pre-loaded with the image to be loaded, the same preliminary filtering node is used as the target node, and the container to be started is scheduled to one of the target nodes to start the container to be started. In the above manner, since the selected target node is pre-loaded with the image to be loaded, the image pulling time in the startup phase can be greatly reduced, and the startup speed of the container can be effectively improved.
[0074] In the related art, the method of pulling the image is often started when the container is started. Even if the bandwidth of the image pulling is increased, a lot of time is needed, resulting in a slow startup speed of the container. The container startup method provided by the embodiment of the present application has the image pre-loaded, so the startup speed of the container will be greatly improved. If the node selection is performed manually and the image is pre-loaded, not only manual operation is required, human resources are consumed, but also there are problems of low efficiency and low accuracy. The container startup method provided by the embodiment of the present application realizes high-accuracy preloading of the container image through an automated method, and achieves zero time consumption for image pulling during the container startup process. If only a node with the highest simulated scheduling score is selected for preloading of the image, because of the time difference between preloading and actual scheduling, the resource usage of the node will change, which will cause the accuracy of preloading to be very low. The container startup method provided by the present embodiment, the candidate node does not only select one node, but selects as many nodes as possible that meet the resource requirements to preload the image, which can effectively avoid the above problems, making it more likely to be scheduled in the candidate node, and effectively saving startup time.
[0075] The preloading process is triggered by the pipeline pushing the image event, and the image is downloaded to certain computing nodes in a cluster in advance. By linking with the pipeline system, a fully automatic preloading process is realized. According to the image address matching rules (preset image cluster mapping relationship), image preloading of multiple clusters (alternative nodes in multiple target clusters) is realized. The existing container resource configuration is queried based on the image, which improves the accuracy of the image preloading algorithm.
[0076] By preloading the image, the image is pulled from the neighboring node where the image already exists, so as to avoid the problem of slow pulling speed from the central image repository or performance fluctuation of the central image repository.
[0077] By intervening in the Kubernetes scheduling algorithm, the existence of the image is considered when scheduling in the priority stage. Nodes with existing images are given high scores. This allows priority scheduling to candidate nodes with existing images during the scheduling stage.
[0078] Combination Fig. 9 As shown, Fig. 9 9 is a schematic diagram of the structure of a container startup device in an embodiment of the present invention. The embodiment of the present disclosure provides a container startup device, including a node preliminary filtering module 901, a node secondary filtering module 902 and a scheduling module 903, wherein:
[0079] The node preliminary filtering module 901 is used to perform preliminary filtering according to the initial resource information of all initial nodes in the target cluster when the container to be started is scheduled, and obtain preliminary filtering nodes;
[0080] The node re-filtering module 902 is used to record the same preliminary filtering node as the target node if there is at least one preliminary filtering node that is the same as the candidate node. The candidate node is the initial node in the target cluster that meets the computing resource requirements of the image to be loaded and is determined by simulation scheduling. The candidate node has pre-pulled and loaded the image to be loaded. The image to be loaded is the image of the container to be started. The number of candidate nodes is at least two.
[0081] The scheduling module 903 is used to schedule the container to be started to one of all target nodes and start the container to be started.
[0082] In one embodiment, the device also includes a rule matcher and an image preloading module, wherein the rule matcher is used to obtain the image identifier and image address of the image to be loaded, and determine the target cluster according to the image identifier and the preset image cluster mapping relationship; the image preloading module is used to determine the computing resource requirements of the image to be loaded; based on the computing resource requirements, the initial nodes in the target cluster are simulated and scheduled, and the initial nodes that meet the computing resource requirements are determined as candidate nodes; an image preloading instruction is sent to each candidate node, triggering the candidate node to pull the image to be loaded, so as to preload the image to be loaded at the candidate node, and at least one image preloading instruction includes an image address.
[0083] Continuing from the above embodiment, the image preloading module is configured to: if there is a container using the image address in the target cluster, obtain the current computing resources of the container to determine the computing resource requirements; or, if there is no container using the image address in the target cluster, obtain the preset computing resources and determine the computing resource requirements.
[0084] Continuing from the above embodiment, the image preloading module is further configured to: send an image preloading instruction to each candidate node, the image preloading instruction includes an image address or image pull object information, the image pull object information is the information of the candidate node including the image address of the received image preloading instruction, and at least one image preloading instruction includes image pull object information; if the image preloading instruction includes an image address, trigger the candidate node to pull the image to be loaded from the preset image repository according to the image address; if the image preloading instruction includes image pull object information, trigger the candidate node to pull the image to be loaded from the candidate node corresponding to the image pull object information.
[0085] Following the above embodiment, the image preloading module is further configured to: before sending the image preloading instruction to each candidate node, sort all the candidate nodes, and divide all the candidate nodes into at least two batches according to the sorting, and the number of nodes in the nth batch is less than or equal to 2 n-1 , n is a positive integer; generating an image preloading instruction for the first candidate node according to the image address; determining one of the candidate nodes in all batches before the batch where the candidate node is located as the image pull object corresponding to the candidate node, and obtaining the image pull objects corresponding to the other candidate nodes except the first candidate node, wherein the image pull objects corresponding to each candidate node of the same batch are different; generating an image preloading instruction for the candidate node according to the image pull object information corresponding to the candidate node, and obtaining the image preloading instructions corresponding to the other candidate nodes except the first candidate node.
[0086] Continuing from the above embodiment, the device also includes a pipeline system, which is used to build the image to be loaded before obtaining the image identifier and image address of the image to be loaded; push the image to be loaded to a preset image warehouse, and trigger the step of obtaining the image identifier and image address of the image to be loaded.
[0087] In one embodiment, the device also includes a database, which is used to feed back the node identifier of the candidate node to the database; when the container to be started is scheduled, the candidate node is determined by reading the node identifier of the candidate node in the database to perform a comparison between the preliminary filtering node and the candidate node.
[0088] In one embodiment, the scheduling module is further configured to: if no preliminary filtering node is the same as the candidate node, record at least some of the preliminary filtering nodes as target nodes; schedule the container to be started to at least one preliminary filtering node, and start the container to be started.
[0089] In one embodiment, the scheduling module is further configured to: perform scheduling preference scoring on all target nodes to obtain a scheduling preference score for each target node; determine at least one target node as the current scheduling node according to the ranking of the scheduling preference scores; and schedule the container to be started to the current scheduling node.
[0090] By adopting the container starting device provided by the embodiment of the present disclosure, when the container to be started is scheduled, the initial nodes in the target cluster are first preliminarily filtered to obtain the preliminary filtering nodes. If there is a preliminary filtering node that is the same as the alternative node that is pre-loaded with the image to be loaded, the same preliminary filtering node is used as the target node, and the container to be started is scheduled to one of the target nodes to start the container to be started. In the above manner, since the selected target node is pre-loaded with the image to be loaded, the image pulling time in the startup phase can be greatly reduced, and the startup speed of the container can be effectively improved.
[0091] An embodiment of the present disclosure further provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes a method provided in any of the above embodiments.
[0092] Fig.10 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and application scope of the embodiments of the present application.
[0093] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003, such as executing the method in the above embodiment. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002 and the RAM 1003 are connected to each other through the bus 1004. The I / O (Input / Output) interface 1005 is also connected to the bus 1004.
[0094] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0095] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.
[0096] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0097] The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run the computer program so that the electronic device executes each step of the above method.
[0098] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0099] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0100] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can 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 embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the systems, devices and units described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0101] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be 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 sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other 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. 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 units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0102] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A container startup method, characterized in that: The container startup method comprises: When the container to be started is scheduled, preliminary filtering is performed based on the initial resource information of all initial nodes in the target cluster to obtain preliminary filtering nodes; If there is at least one preliminary filtering node that is the same as the candidate node, the same preliminary filtering node is recorded as the target node, the candidate node is the initial node in the target cluster that meets the computing resource requirements of the image to be loaded and is determined by simulation scheduling, and the candidate node has pre-pulled and loaded the image to be loaded, the image to be loaded is the image of the container to be started, and the number of the candidate nodes is at least two; The container to be started is scheduled to one of all target nodes, and the container to be started is started.
2. The container startup method according to claim 1, characterized in that: Before the container to be started is scheduled, the method further includes: Get the image ID and image address of the image to be loaded; Determine the target cluster according to the image identifier and the preset image cluster mapping relationship; Determine the computing resource requirements of the image to be loaded; Performing simulated scheduling on the initial nodes in the target cluster based on the computing resource requirements, and determining the initial nodes that meet the computing resource requirements as candidate nodes; An image preloading instruction is sent to each candidate node to trigger the candidate node to pull the image to be loaded, so as to preload the image to be loaded at the candidate node, at least one of the image preloading instructions includes an image address.
3. The container startup method according to claim 2, characterized in that: Determining the computing resource requirements of the image to be loaded includes: If the target cluster has a container using the image address, obtain the current computing resources of the container to determine the computing resource requirement; or, If the target cluster does not have a container using the image address, obtain preset computing resources and determine the computing resource requirements.
4. The container startup method according to claim 2, characterized in that: Sending an image preloading instruction to the candidate node to trigger the candidate node to pull the image to be loaded includes: Sending an image preloading instruction to each candidate node, wherein the image preloading instruction includes an image address or image pull object information, wherein the image pull object information is information of the candidate node including the image address of the received image preloading instruction, and at least one of the image preloading instructions includes the image pull object information; If the image preloading instruction includes an image address, triggering the candidate node to pull the image to be loaded from the preset image repository according to the image address; If the image preloading instruction includes image pulling object information, the candidate node is triggered to pull the image to be loaded from the candidate node corresponding to the image pulling object information.
5. The container startup method according to claim 4, characterized in that: Before sending the image preloading instruction to each candidate node, the method further includes: Sort all candidate nodes and divide them into at least two batches according to the sorting. The number of nodes in the nth batch is less than or equal to 2. n-1 , n is a positive integer; Generate a mirror preloading instruction of the first-ranked candidate node according to the mirror address; Determine one of the candidate nodes in all batches before the batch where a candidate node is located as the image pull object corresponding to the candidate node, and obtain the image pull objects corresponding to the other candidate nodes except the candidate node ranked first, wherein the image pull objects corresponding to each candidate node in the same batch are different; An image preloading instruction of a candidate node is generated according to the image pulling object information corresponding to the candidate node, and image preloading instructions corresponding to other candidate nodes except the candidate node ranked first are obtained.
6. The container startup method according to claim 2, characterized in that: Before obtaining the image identifier and the image address of the image to be loaded, the method further includes: The pipeline builds the image to be loaded; The image to be loaded is pushed to a preset image repository, and the step of obtaining the image identifier and the image address of the image to be loaded is triggered.
7. The container startup method according to claim 2, characterized in that: After the candidate node completes preloading the image to be loaded, the method further includes: Feeding back the node identifier of the candidate node to the database; When the container to be started is scheduled, the candidate node is determined by reading the node identifier of the candidate node in the database, so as to perform a comparison between the preliminary filtering node and the candidate node.
8. The container startup method according to any one of claims 1 to 7, characterized in that: If no preliminary filtered nodes are identical to the candidate nodes, at least some of the preliminary filtered nodes are recorded as target nodes; The container to be started is scheduled to at least one preliminary filtering node, and the container to be started is started.
9. The container startup method according to any one of claims 1 to 7, characterized in that: Scheduling the container to be started to one of all target nodes includes: Perform scheduling optimization scoring on all target nodes to obtain the scheduling optimization score of each target node; A target node is determined as a current scheduling node according to the ranking of scheduling preference scores; The container to be started is scheduled to the current scheduling node.
10. A container starting device, characterized in that: The container starting device comprises: The node preliminary filtering module is used to perform preliminary filtering according to the initial resource information of all initial nodes in the target cluster when the container to be started is scheduled, and obtain the preliminary filtering node; A node re-filtering module, used for recording the same preliminary filtering node as a target node if there is at least one preliminary filtering node that is the same as a candidate node, the candidate node is an initial node in the target cluster that meets the computing resource requirements of the image to be loaded and is determined by simulation scheduling, and the candidate node has pre-pulled and loaded the image to be loaded, the image to be loaded is the image of the container to be started, and the number of the candidate nodes is at least two; The scheduling module is used to schedule the container to be started to one of all target nodes and start the container to be started.
Citation Information
Cited By
Resource scheduling method, related device, equipment, system and storage medium
CN121705034A
Resource scheduling method and related device, equipment, system and storage medium
CN121705034B
