Container deployment method, device, electronic device, and computer-readable storage medium
The method addresses container deployment failures by filtering multiple nodes, rolling back and retrying on alternate nodes, ensuring successful deployment and improved system stability.
Patent Information
- Application Number
- CN202110001438.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-04
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-01-04
AI Technical Summary
Existing container deployment methods fail due to undetected issues within nodes, leading to deployment failures and affecting system stability and availability.
A method that filters multiple nodes meeting deployment requirements, performs initial deployment, rolls back upon suspension, and retries on alternative nodes until successful deployment is achieved, incorporating a rollback mechanism and timer/counter functions to manage retries.
Ensures timely detection of deployment issues and reselection of nodes, preventing failure and enhancing system stability and availability by compensating for existing filtering mechanism limitations.
Smart Images

Figure CN114721765B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a container deployment method, device, electronic device and computer-readable storage medium. Background Art
[0002] A container is a collection of interfaces between applications / components and server platforms, which makes it easy to deploy applications / components to servers and run them. The container shields the complexity of the server platform, making it easy and quick to deploy applications / components on it.
[0003] In the related art, the container deployment method is usually as follows: first, based on the filtering rules, filter out the nodes that do not meet the container deployment requirements. For example, based on the container resource requirements, filter out the nodes whose available resources are less than the container required resources; second, select the node for deploying the container from the nodes filtered in the previous stage, and perform the container deployment operation.
[0004] However, due to the limitations of existing filtering mechanisms, when a node meets the deployment requirements of a container, the container deployment may fail due to certain problems inside the node. Summary of the invention
[0005] Embodiments of the present invention provide a container deployment method, device, electronic device, and computer-readable storage medium to solve the above-mentioned problems existing in container deployment.
[0006] In a first aspect, an embodiment of the present invention provides a container deployment method, including:
[0007] According to the deployment requirement of the first container, the nodes are filtered to select N nodes that meet the deployment requirement, where N is an integer greater than 1;
[0008] Selecting a first node from the N nodes, and performing a first deployment operation of the first container; the first deployment operation is used to deploy the first container on the first node;
[0009] During the execution of the first deployment operation, in response to detecting that the first deployment operation is suspended, rolling back the first deployment operation;
[0010] A second node is selected, and a second deployment operation of the first container is performed; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
[0011] In a second aspect, an embodiment of the present invention further provides a container deployment device, including:
[0012] A filtering module, used to filter nodes according to the deployment requirements of the first container, and select N nodes that meet the deployment requirements, where N is an integer greater than 1;
[0013] A first execution module, configured to select a first node from the N nodes and execute a first deployment operation of the first container; the first deployment operation is configured to deploy the first container on the first node;
[0014] a rollback module, configured to roll back the first deployment operation in response to detecting that the first deployment operation is suspended during the execution of the first deployment operation;
[0015] The second execution module is used to select a second node and execute a second deployment operation of the first container; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
[0016] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor is configured to read the program in the memory to implement the steps in the container deployment method as described above.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the container deployment method as described above are implemented.
[0018] In the embodiment of the present invention, during the container deployment process, by detecting whether the deployment operation is successful, problems can be discovered in time during the container deployment process and a deployment node can be reselected for the container to ensure successful container deployment. In this way, the situation where the container cannot be deployed successfully can be avoided, the potential defects of the existing filtering mechanism can be compensated, and the stability and availability of the system can be enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1 is a flow chart of a container deployment method provided by an embodiment of the present invention;
[0021] Figures 2 to 4 is an example diagram of a container deployment process provided by an embodiment of the present invention;
[0022] Figure 5 is a structural diagram of a container deployment device provided by an embodiment of the present invention;
[0023] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] In the related art, when deploying a container (Pod), the client can create container resources through the Representational State Transfer API (REST API) or the northbound interface (Kubernetes API) tool of the Application Programming Interface (API) server. After receiving the user request, the API Server stores the relevant data in a distributed key-value database system (such as an Etcd database). The scheduler monitors the API Server to view the node list of the container and cyclically tries to allocate a node for each container. This allocation process may include the following two stages:
[0026] First, the preselection phase (Predicates). In this phase, the scheduler can filter out nodes that do not meet the container requirements based on preset rules. For example, if the container sets a resource request, then the nodes with less available resources than the resources required by the container will be filtered out.
[0027] Second, in the Priorities stage, the nodes filtered out in the previous stage are scored, and the scheduler will consider some overall optimization strategies, such as distributing multiple container replicas controlled by Deployment to different nodes and using the node with the lowest load.
[0028] After the above stages, the node with the highest score is selected and bound to the container, and then the result is stored in the etcd database. Finally, the node agent (kubelet) corresponding to the selected node executes the relevant operations of container deployment.
[0029] However, due to the limitations of the existing filtering mechanism, it is impossible to take into account all filtering conditions. When the selected node meets the deployment requirements of the container, due to certain problems inside the node, such as CPU Model, kernel version or other compatibility issues, the container may be in a pending / error state, resulting in container deployment failure, causing system failure, and affecting system stability and availability.
[0030] In view of this, embodiments of the present invention provide a container deployment method, device, electronic device, and computer-readable storage medium to solve the above-mentioned problems existing in container deployment.
[0031] See also Figure 1 , Figure 1 is a flow chart of a container deployment method provided by an embodiment of the present invention, such as Figure 1 As shown, the following steps are included:
[0032] Step 101: Filter nodes according to the deployment requirements of the first container to select N nodes that meet the deployment requirements, where N is an integer greater than 1.
[0033] The above-mentioned node can be a host or a server.
[0034] In this step, in response to receiving the request to deploy the first container, the nodes may be filtered according to the deployment requirements of the first container to select the nodes that meet the deployment requirements of the first container.
[0035] The embodiment of the present invention may filter nodes based on the filtering rules in the related art, or may filter nodes based on other filtering rules.
[0036] As an example, the filtering rules may include but are not limited to the following algorithms:
[0037] PodFitsResources: Whether the remaining resources on the node are greater than the resources requested by the container;
[0038] PodFitsHos: If the container specifies a node name (NodeName), check whether the node name matches NodeName;
[0039] PodFitsHostPorts: whether the port already used on the node conflicts with the port requested by the container;
[0040] PodSelectorMatches: Filter out nodes that do not match the labels specified by the container;
[0041] NoDiskConflict: The mounted volume does not conflict with the container-specified volume unless they are both read-only.
[0042] CheckNodeDiskPressure: Checks whether the node's disk space meets the requirements;
[0043] CheckNodeMemoryPressure: Checks whether the node has sufficient memory.
[0044] Step 102: Select a first node from the N nodes and perform a first deployment operation of the first container; the first deployment operation is used to deploy the first container on the first node.
[0045] In this step, a first node may be selected from the screened N nodes, and a first deployment operation of the first container may be performed, that is, an operation of deploying the first container on the first node.
[0046] The embodiment of the present invention may select the node with the highest score as the first node from N nodes based on the optimization rule in the related art, or may select the first node from N nodes based on other rules.
[0047] For example, the first node can be selected based on the priority rule. The priorities of the nodes can be represented by the following key-value pairs, where the key is the name of the priority and the value is its weight:
[0048] LeastRequestedPriority: The weight is determined by calculating the CPU and memory usage. The lower the usage, the higher the weight.
[0049] SelectorSpreadPriority: To achieve better high availability, multiple container replicas under the same deployment controller or replication controller (RC) are scheduled to different nodes as much as possible. When a container is scheduled, the controller corresponding to the container is first searched, and then the existing containers under the controller are checked. The node with fewer running containers has a higher weight.
[0050] ImageLocalityPriority: If there is already an image node to be used on a certain node, the larger the total size of the image, the higher the weight;
[0051] NodeAffinityPriority: Calculates a weight value based on the affinity of the node.
[0052] Step 103: During the execution of the first deployment operation, in response to detecting that the first deployment operation is suspended, rolling back the first deployment operation.
[0053] During the execution of the first deployment operation, the first deployment operation may be suspended (pending) due to some problems existing inside the first node.
[0054] In this step, during the execution of the first deployment operation, in response to detecting that the first deployment operation is suspended, the first deployment operation is rolled back. Specifically, during the execution of the first deployment operation, if the first deployment operation is suspended, the Kubernetes API may be actively notified to perform a rollback process.
[0055] Step 104: Select a second node and perform a second deployment operation of the first container; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
[0056] In this step, a deployment node may be reselected for the first container. Specifically, the first node may be excluded, and a second node may be selected from the remaining nodes, and a second deployment operation of the first container may be performed, that is, an operation of deploying the first container on the second node.
[0057] It should be noted that during the execution of the second deployment operation, it is also possible to monitor whether the second deployment operation is successful. In the case where the second deployment operation is suspended, the second deployment operation can be rolled back and a deployment node can be reselected for the first container, and so on, until the first container is successfully deployed. To avoid repetition, this will not be described in detail.
[0058] In the embodiment of the present invention, during the container deployment process, by detecting whether the deployment operation is successful, problems can be discovered in time during the container deployment process and a deployment node can be reselected for the container to ensure successful container deployment. In this way, the situation where the container cannot be deployed successfully can be avoided, the potential defects of the existing filtering mechanism can be compensated, and the stability and availability of the system can be enhanced.
[0059] Optionally, during the process of executing the first deployment operation of the first container, in response to detecting that the first deployment operation is suspended, rolling back the first deployment operation includes:
[0060] During the execution of the first deployment operation of the first container, timing the first deployment operation;
[0061] In response to the time of the first deployment operation reaching a first threshold and detecting that the first deployment operation is suspended, the first deployment operation is rolled back.
[0062] In this implementation, a RetryFilter filter can be introduced when deploying a container. By introducing the RetryFilter filter, a timer function can be added to the container deployment operation. Within a configurable certain time period, such as 10 seconds or other, if the container deployment operation is paused, the Kubernetes API can be actively notified to perform a rollback process and roll back the container deployment operation.
[0063] In this implementation, by introducing a timer function for the container deployment operation, problems existing in the container deployment process can be discovered in a timely manner, thereby enabling better monitoring of the container deployment process.
[0064] Optionally, selecting the second node and performing the second deployment operation of the first container includes:
[0065] In response to the number of times the first deployment operation is rolled back reaching a second threshold, a second node is selected, and a second deployment operation of the first container is performed.
[0066] In this implementation, when deploying a container, a RetryFilter filter can be introduced. By introducing the RetryFilter filter, a counter function can be added to the container deployment operation. After rolling back the first deployment operation, the first deployment operation can be executed again. For each additional rollback operation, the RetryFilter filter will increase the number of rollbacks by 1 until the number of rollbacks reaches a second threshold, such as 3 times.
[0067] In this implementation, by introducing a counter function for the container deployment operation, it is possible to avoid the situation where the container deployment fails due to accidental events, thereby avoiding unnecessary subsequent node reselection and redeployment processes.
[0068] Optionally, the method further includes:
[0069] In response to the number of times the first deployment operation is rolled back reaching a second threshold, the first node is marked as an unavailable node of the first container.
[0070] In this implementation, when the number of rollbacks of the first deployment operation reaches a second threshold, the first node is marked as an unavailable node of the first container. For example, the first node is set as a "tainted" node. Specifically, the first node can be placed in the unavailable node list of the first container.
[0071] In this implementation, the first node is marked as an unavailable node of the first container. When the first container needs to be scheduled again, it will not be scheduled to the first node, thereby avoiding the situation where the first container fails to be scheduled again.
[0072] After the first node is marked as an unavailable node of the first container, the administrator may also be notified to repair the first node.
[0073] Optionally, after marking the first node as an unavailable node of the first container, the method further includes:
[0074] In response to the first node being repaired, the first node is marked as an available node for the first container.
[0075] In this implementation, after the first node is repaired, the first node can also be marked as an available node of the first container. Specifically, the identifier of the first node is deleted from the unavailable node list of the first container. When the first container needs to be scheduled again, it can be rescheduled to the first node, thus expanding the number of nodes that can be scheduled for the first container and providing more options for scheduling the first container.
[0076] Optionally, selecting the second node includes:
[0077] Based on the priority of the nodes, the second node is selected.
[0078] In this implementation, in order to make the selected deployment node better meet the deployment requirements of the first container, the second node may be selected for the first container according to the priority of the node.
[0079] In this implementation, applications may be subdivided into different priorities, and resources may be preferentially provided to high-priority applications.
[0080] For example, define PriorityClass, and different PriorityClass values are different. If RetryFilter records the node that failed to schedule last time, it can be removed from the filter list during the next scheduling. Set the priorityClassName field of the container to the expected PriorityClass, and select the node recorded by RetryFilter.
[0081] In this implementation, the second node is selected according to the node priority, which can improve resource availability and ensure high-priority service quality.
[0082] In order to better understand the embodiments of the present invention, Figures 2 to 4 This section describes the process of container deployment with examples.
[0083] like Figure 1As shown, it is assumed that there are six nodes from node 1 to node 6. First, in the pre-selection stage, based on the filtering rules, the nodes that do not meet the first container deployment requirements are filtered out from the six nodes. Assuming that node 2 and node 5 do not meet the first container deployment requirements, the N nodes that meet the first container deployment requirements are node 1, node 3, node 4 and node 6. Secondly, in the optimization stage, the four nodes of node 1, node 3, node 4 and node 6 are prioritized and scored. The order of the scores from high to low is node 3, node 1, node 6 and node 4. Subsequently, node 3 is selected as the first node.
[0084] like Figure 2 As shown, in the process of deploying the first container on node 3, due to some compatibility issues of node 3, the first container is in a pending or error state, and the first container cannot be deployed.
[0085] like Figure 3 As shown, the above deployment operation is rolled back, node 3 is marked as an unavailable node of the first container, and a deployment node of the first container is reselected from node 1, node 6 and node 4. Figure 3 In the example, the node with the highest priority (i.e., node 1) can be further used as the second node according to the priority of the nodes, and the first container can be deployed on node 1. At this time, the first container is deployed successfully.
[0086] It should be noted that the various optional implementations in the embodiments of the present invention can be implemented in combination with each other or can be implemented separately, and this application does not limit this.
[0087] In the embodiment of the present invention, during the container deployment process, by detecting whether the deployment operation is successful, problems can be discovered in time during the container deployment process and a deployment node can be reselected for the container to ensure successful container deployment. In this way, the situation where the container cannot be deployed successfully can be avoided, the potential defects of the existing filtering mechanism can be compensated, and the stability and availability of the system can be enhanced.
[0088] The embodiment of the present invention also provides a container deployment device. Figure 5 , Figure 5 2 is a structural diagram of a container deployment device provided in an embodiment of the present invention. Since the principle of solving the problem by the container deployment device is similar to that of the container deployment method in an embodiment of the present invention, the implementation of the container deployment device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0089] like Figure 5 As shown, the container deployment device 500 includes:
[0090] A filtering module 501 is used to filter nodes according to the deployment requirements of the first container, and select N nodes that meet the deployment requirements, where N is an integer greater than 1;
[0091] A first execution module 502 is used to select a first node from the N nodes and execute a first deployment operation of the first container; the first deployment operation is used to deploy the first container on the first node;
[0092] A rollback module 503, configured to roll back the first deployment operation in response to detecting that the first deployment operation is suspended during the execution of the first deployment operation;
[0093] The second execution module 504 is used to select a second node and execute a second deployment operation of the first container; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
[0094] Optionally, the rollback module 503 includes:
[0095] a timing unit, configured to time the first deployment operation of the first container during the execution of the first deployment operation;
[0096] The rollback unit is configured to roll back the first deployment operation in response to the time of the first deployment operation reaching a first threshold and detecting that the first deployment operation is suspended.
[0097] Optionally, the second execution module 504 is specifically configured to:
[0098] In response to the number of times the first deployment operation is rolled back reaching a second threshold, a second node is selected, and a second deployment operation of the first container is performed.
[0099] Optionally, the container deployment device 500 further includes:
[0100] The first marking module is configured to mark the first node as an unavailable node of the first container in response to the number of times the first deployment operation is rolled back reaching a second threshold.
[0101] Optionally, the container deployment device 500 further includes:
[0102] The second marking module is configured to mark the first node as an available node of the first container in response to the first node being repaired.
[0103] Optionally, the second execution module 504 is specifically configured to:
[0104] A second node is selected according to the priority of the node, and a second deployment operation of the first container is performed.
[0105] The container deployment device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.
[0106] The embodiment of the present invention further provides an electronic device. Since the principle of solving the problem by the electronic device is similar to the electronic device method in the embodiment of the present invention, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0107] like Figure 6 As shown, the electronic device according to an embodiment of the present invention includes:
[0108] The processor 600 is used to read the program in the memory 620 and execute the following process:
[0109] According to the deployment requirement of the first container, the nodes are filtered to select N nodes that meet the deployment requirement, where N is an integer greater than 1;
[0110] Selecting a first node from the N nodes, and performing a first deployment operation of the first container; the first deployment operation is used to deploy the first container on the first node;
[0111] During the execution of the first deployment operation, in response to detecting that the first deployment operation is suspended, rolling back the first deployment operation;
[0112] A second node is selected, and a second deployment operation of the first container is performed; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
[0113] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 600 and memory represented by memory 620. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, namely, a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 may store data used by the processor 600 when performing operations.
[0114] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0115] During the execution of the first deployment operation of the first container, timing the first deployment operation;
[0116] In response to the time of the first deployment operation reaching a first threshold and detecting that the first deployment operation is suspended, the first deployment operation is rolled back.
[0117] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0118] In response to the number of times the first deployment operation is rolled back reaching a second threshold, a second node is selected, and a second deployment operation of the first container is performed.
[0119] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0120] In response to the number of times the first deployment operation is rolled back reaching a second threshold, the first node is marked as an unavailable node of the first container.
[0121] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0122] In response to the first node being repaired, the first node is marked as an available node for the first container.
[0123] Optionally, the processor 600 is further configured to read a program in the memory 620 and execute the following steps:
[0124] Based on the priority of the nodes, the second node is selected.
[0125] The electronic device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0126] In addition, the computer-readable storage medium of the embodiment of the present invention is used to store a computer program, and the computer program can be executed by a processor to implement the following steps:
[0127] According to the deployment requirement of the first container, the nodes are filtered to select N nodes that meet the deployment requirement, where N is an integer greater than 1;
[0128] Selecting a first node from the N nodes, and performing a first deployment operation of the first container; the first deployment operation is used to deploy the first container on the first node;
[0129] During the execution of the first deployment operation, in response to detecting that the first deployment operation is suspended, rolling back the first deployment operation;
[0130] A second node is selected, and a second deployment operation of the first container is performed; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
[0131] Optionally, the computer program may also be executed by a processor to implement the following steps:
[0132] During the execution of the first deployment operation of the first container, timing the first deployment operation;
[0133] In response to the time of the first deployment operation reaching a first threshold and detecting that the first deployment operation is suspended, the first deployment operation is rolled back.
[0134] Optionally, the computer program may also be executed by a processor to implement the following steps:
[0135] In response to the number of times the first deployment operation is rolled back reaching a second threshold, a second node is selected, and a second deployment operation of the first container is performed.
[0136] Optionally, the computer program may also be executed by a processor to implement the following steps:
[0137] In response to the number of times the first deployment operation is rolled back reaching a second threshold, the first node is marked as an unavailable node of the first container.
[0138] Optionally, the computer program may also be executed by a processor to implement the following steps:
[0139] In response to the first node being repaired, the first node is marked as an available node for the first container.
[0140] Optionally, the computer program may also be executed by a processor to implement the following steps:
[0141] Based on the priority of the nodes, the second node is selected.
[0142] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices 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.
[0143] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included 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.
[0144] 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.) to perform some steps of the sending and receiving method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0145] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A container deployment method, characterized in that: include: According to the deployment requirement of the first container, the nodes are filtered to select N nodes that meet the deployment requirement, where N is an integer greater than 1; Selecting a first node from the N nodes, and performing a first deployment operation of the first container; The first deployment operation is used to deploy the first container on the first node; During the execution of the first deployment operation, in response to detecting that the first deployment operation is suspended, rolling back the first deployment operation; A second node is selected, and a second deployment operation of the first container is performed; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
2. The method according to claim 1, characterized in that The step of rolling back the first deployment operation in response to detecting that the first deployment operation is suspended during the execution of the first deployment operation of the first container includes: During the execution of the first deployment operation of the first container, timing the first deployment operation; In response to the time of the first deployment operation reaching a first threshold and detecting that the first deployment operation is suspended, the first deployment operation is rolled back.
3. The method according to claim 1, characterized in that The selecting a second node and performing a second deployment operation of the first container includes: In response to the number of times the first deployment operation is rolled back reaching a second threshold, a second node is selected, and a second deployment operation of the first container is performed.
4. The method according to claim 1, characterized in that The method further comprises: In response to the number of times the first deployment operation is rolled back reaching a second threshold, the first node is marked as an unavailable node of the first container.
5. The method according to claim 4, characterized in that After marking the first node as an unavailable node of the first container, the method further includes: In response to the first node being repaired, the first node is marked as an available node for the first container.
6. The method according to claim 1, characterized in that The selecting the second node comprises: Based on the priority of the nodes, the second node is selected.
7. A container deployment device, characterized in that: include: A filtering module, used to filter nodes according to the deployment requirements of the first container, and select N nodes that meet the deployment requirements, where N is an integer greater than 1; A first execution module, configured to select a first node from the N nodes and execute a first deployment operation of the first container; The first deployment operation is used to deploy the first container on the first node; a rollback module, configured to roll back the first deployment operation in response to detecting that the first deployment operation is suspended during the execution of the first deployment operation; The second execution module is used to select a second node and execute a second deployment operation of the first container; the second deployment operation is used to deploy the first container on the second node, and the second node is a node among the N nodes except the first node.
8. The device according to claim 7, characterized in that The rollback module includes: a timing unit, configured to time the first deployment operation of the first container during the execution of the first deployment operation; The rollback unit is configured to roll back the first deployment operation in response to the time of the first deployment operation reaching a first threshold and detecting that the first deployment operation is suspended.
9. The device according to claim 7, characterized in that The second execution module is specifically used for: In response to the number of times the first deployment operation is rolled back reaching a second threshold, a second node is selected, and a second deployment operation of the first container is performed.
10. The device according to claim 7, characterized in that Also includes: The first marking module is configured to mark the first node as an unavailable node of the first container in response to the number of times the first deployment operation is rolled back reaching a second threshold.
11. The device according to claim 10, characterized in that Also includes: The second marking module is configured to mark the first node as an available node of the first container in response to the first node being repaired.
12. The device according to claim 7, characterized in that The second execution module is specifically used for: A second node is selected according to the priority of the node, and a second deployment operation of the first container is performed.
13. An electronic device, comprising: A transceiver, a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor is configured to read the program in the memory to implement the steps of the method according to any one of claims 1 to 6.
14. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method, device and system for creating virtual machine
CN106020937A
Method and apparatus for scheduling containers in parallel in cluster
CN106919445A
Container processing method and device
CN108628664A
Cloud service deployment method and system
CN108900356A
Docker container deployment method, system and device and storage medium
CN111190696A