CN110569109B - Container updating method, control node and edge node - Google Patents
Container updating method, control node and edge node Download PDFInfo
- Publication number
- CN110569109B CN110569109B CN201910858081.1A CN201910858081A CN110569109B CN 110569109 B CN110569109 B CN 110569109B CN 201910858081 A CN201910858081 A CN 201910858081A CN 110569109 B CN110569109 B CN 110569109B
- Authority
- CN
- China
- Prior art keywords
- container
- resource
- updated
- node
- edge
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 140
- 230000008569 process Effects 0.000 claims description 69
- 238000004891 communication Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 7
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application provides a container updating method, a control node and an edge node, and relates to the technical field of container management. By carrying out resource locking on the target container group to which the container to be updated belongs, the edge node deletes the container to be updated from the target container group instead of directly deleting the target container group when receiving the update instruction. Because the resources used by the container to be updated are borne in the target container group and the resources of the target container group are locked, the resources of the container to be updated borne by the target container group can be prevented from being released, so that the resources of the container to be updated can be utilized to create a corresponding new version container, and even under the condition of insufficient resources, the container can be updated.
Description
Technical Field
The present application relates to the field of container management technologies, and in particular, to a container updating method, a control node, and an edge node.
Background
The container cluster management system provides a series of complete functions such as deployment and operation, resource scheduling, service discovery and dynamic expansion for containerized application, and improves the convenience of large-scale container cluster management. The existing container cluster management system mainly provides the following two ways to update the container: firstly, creating a new version of container, and then deleting an old version of container; second, the old version of the container is deleted before the new version of the container is created.
However, when the resources of the container cluster are insufficient, if the first method is adopted, the resources for creating a new version of the container cannot be applied, and the container cannot be updated; if the second method is adopted, the resources released by deleting the old version of the container may be preempted by other applications, so that the new version of the container cannot be created, and further the updating of the container fails.
Therefore, the existing container cluster management system cannot realize the updating of the container under the condition of insufficient cluster resources.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a container update method, a control node and an edge node, so as to solve the problem in the prior art that the container update cannot be implemented under the condition of insufficient cluster resources.
In order to achieve the above purpose, the embodiments of the present application employ the following technical solutions:
in a first aspect, an embodiment of the present application provides a container update method, which is applied to a control node in a container cluster management system, and the method includes:
sending a locking notice to an edge node, wherein the locking notice comprises a container identifier of a container to be updated, and enabling the edge node to add a resource locking label to a target container group to which the container to be updated belongs;
Sending an update instruction for the container to be updated to the edge node, so that the edge node deletes the container to be updated from the target container group and creates a new version container corresponding to the container to be updated according to the update instruction when the target container group to which the container to be updated belongs is checked to have the resource locking tag.
In an alternative embodiment, the method further comprises:
judging whether the edge node is in a resource tension state or not according to the resource information reported by the edge node;
wherein the lock notification is issued by the control node when the edge node is in a resource-strained state.
In an optional embodiment, the resource information includes: the amount of remaining resources of the edge node;
the judging whether the edge node is in a resource tension state according to the resource information reported by the edge node comprises the following steps:
judging whether the residual resource quantity meets the preset resource specification of the container to be updated or not according to the residual resource quantity reported by the edge node;
and if not, determining that the edge node is in a resource tension state.
In an optional embodiment, the resource information includes: region information of the edge node;
the judging whether the edge node is in a resource tension state according to the resource information reported by the edge node comprises the following steps:
determining a target area to which the edge node belongs according to the area information reported by the edge node, and acquiring the residual resource amount of each edge node belonging to the target area;
judging whether edge nodes with residual resource quantity meeting the preset resource specification of the container to be updated exist in the target area or not;
and if not, determining that the edge node is in a resource tension state.
In a second aspect, an embodiment of the present application provides a container updating method, which is applied to an edge node in a container cluster management system, and the method includes:
receiving a locking notification sent by a control node, wherein the locking notification comprises a container identifier of a container to be updated, and adding a resource locking label to a target container group to which the container to be updated belongs according to the locking notification;
receiving an update instruction aiming at the container to be updated and sent by the control node, and judging whether the target container group to which the container to be updated belongs has the resource locking label or not according to the update instruction;
And if the target container group has the resource locking label, deleting the container to be updated from the target container group, and creating a new version container corresponding to the container to be updated.
In an alternative embodiment, the lock notification is sent by the control node when the edge node where the container to be updated is located is in a resource-tight state; the method further comprises the following steps:
and if the target container group does not have the resource locking label, deleting the target container group, creating a new target container group, and creating a new version container corresponding to the container to be updated in the new target container group.
In an alternative embodiment, the method further comprises:
after the new version container is created, the resource lock tag of the target container group is deleted.
In an optional embodiment, the creating a new version container corresponding to the container to be updated includes:
and creating the new version container according to the parameter information of the container to be updated and the container mirror image information of the new version.
In a third aspect, an embodiment of the present application provides a container update method, which is applied to a container cluster management system, where the system includes a control node and an edge node that are communicatively connected to each other; the control node comprises a main node process and an edge resource controller component, and the edge node comprises a proxy node process and an edge resource reservation component;
The edge resource controller component sends a locking notification to the agent node process through the master node process, wherein the locking notification comprises a container identifier of a container to be updated;
the agent node process receives the locking notice and adds a resource locking label for a target container group to which the container to be updated belongs according to the container identifier in the locking notice;
the edge resource controller component sends an update instruction aiming at the container to be updated to the agent node process through the main node process;
and the agent node process receives the updating instruction, judges whether the target container group to which the container to be updated belongs has a resource locking label, if so, calls the edge resource reservation component, deletes the container to be updated from the target container group, and creates a new version container corresponding to the container to be updated.
In an alternative embodiment, the method further comprises:
the edge resource controller component obtains resource information reported by the edge node through the master node process, and judges whether the edge node is in a resource tension state or not according to the resource information;
Wherein the lock notification is issued by the edge resource controller component through the master node process when the edge node is in a resource tense state.
In an alternative embodiment, the method further comprises:
after the edge resource reservation component creates the new version container, sending a creation success notification to the agent node process;
and the proxy node process receives the creation success notification and deletes the resource locking label of the target container group.
In a fourth aspect, an embodiment of the present application provides a control node, including a processor and a machine-readable storage medium, where the machine-readable storage medium has stored thereon machine-executable instructions, and when being called, the machine-executable instructions cause the processor to implement the method of any one of the foregoing embodiments.
In a fifth aspect, an embodiment of the present application provides an edge node, including a processor and a machine-readable storage medium, where the machine-readable storage medium has stored thereon machine-executable instructions, and when being called, the machine-executable instructions cause the processor to implement the method newly described in any one of the foregoing embodiments.
In a sixth aspect, embodiments of the present application provide a machine-readable storage medium storing machine-executable instructions, which when executed, implement the method of any one of the foregoing embodiments.
In a seventh aspect, an embodiment of the present application provides a machine-readable storage medium, which stores machine-executable instructions, and when the machine-executable instructions are executed, the method described in any one of the foregoing implementation manners is implemented.
Compared with the prior art, the container updating method, the control node and the edge node provided by the embodiment of the application have the following beneficial effects:
according to the container updating method, the control node and the edge node provided by the embodiment of the application, the edge node deletes the container to be updated from the target container group instead of directly deleting the target container group when receiving the updating instruction by locking the resource of the target container group to which the container to be updated belongs. Because the resources used by the containers to be updated are borne in the target container group and the resources of the target container group are locked, the resources of the containers to be updated borne by the target container group can be prevented from being released, so that the resources of the containers to be updated can be utilized to create the corresponding new version container, and the containers can be updated even under the condition of insufficient resources.
In order to make the aforementioned objects, features and advantages of the present application comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 illustrates an architecture diagram of a container cluster management system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a container updating method according to a first embodiment of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a container updating method according to a second embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a distribution of edge nodes according to a second embodiment of the present application;
FIG. 5 is a flow chart illustrating a container update method according to a third embodiment of the present application;
FIG. 6 is a schematic flow chart diagram illustrating a container update method according to a fourth embodiment of the present disclosure;
fig. 7 is a block diagram illustrating a control node according to a fifth embodiment of the present application;
Fig. 8 is a schematic block diagram illustrating an edge node according to a sixth embodiment of the present application.
An icon: 10-a container cluster management system; 100-a control node; 110 — a master node process; 120-an edge resource controller component; 200. 300, 400-edge nodes; 201-group of containers; 210-proxy node process; 220-edge resource reservation component; 101. 202-a processor; 102. 203-machine-readable storage media; 103. 204-system bus.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It is to be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element. Furthermore, features in the embodiments of the present application may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a container cluster management system 10 according to an embodiment of the present disclosure. The container cluster management system 10 includes a control node 100 and at least one edge node, such as the edge nodes 200 and 300 shown in fig. 1, communicatively coupled to each other. The control node 100 and the edge node may be any devices having network communication functions and data processing functions, for example, servers, hosts, etc., which are not limited in this embodiment. In some examples, the control node 100 may be a data center server and the edge nodes may be servers that are closer to the user.
At least one container group is deployed on each edge node, at least one container can be operated in each container group, and each container corresponds to one service application and is used for providing services required by the service application for a user. The container group is packaged with storage resources, network resources, configuration information, container restart strategies and the like required by container operation.
The control node 100 is used to manage the edge nodes and the container groups and containers on the edge nodes. In detail, the control node 100 may be deployed with a master node process 110, and the edge node may be deployed with an agent node process, for example, the edge node 200 is deployed with an agent node process 210, and the communication between the control node 100 and the edge node 200 may be implemented through interaction between the master node process 110 and the agent node process 210. In a specific example, when a certain container in the container cluster needs to be updated, the master node process 110 of the control node 100 may determine an edge node where the container to be updated is located, and schedule the proxy node process of the edge node to perform an update operation on the container to be updated.
Illustratively, the container cluster management system 10 in the embodiment of the present application may be, for example, a kubernets system, which is an open source version of Google internal scheduling system Borg and is a Platform-as-a-Service (Platform-as-a-Service) Platform with wide application. Correspondingly, the master node process may be a master-server process running on the control node, the broker node process may be a kubelet process running on the edge node, and the container group may be a Pod, for example. It is understood that the container cluster management system 10 may be other similar systems, and the embodiment is not limited thereto.
First embodiment
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for updating a container according to this embodiment, where the method can be applied to the control node 100 in the container cluster management system 10 shown in fig. 1, and the following describes each step of the method in detail.
Step S210, sending a locking notification to an edge node, where the locking notification includes a container identifier of a container to be updated, and enabling the edge node to add a resource locking tag to a target container group to which the container to be updated belongs.
Step S220, sending an update instruction for the container to be updated to the edge node, so that the edge node deletes the container to be updated from the target container group according to the update instruction when it is checked that the target container group to which the container to be updated belongs has the resource locking tag, and creates a new version container corresponding to the container to be updated.
In step S210, when the container needs to be updated, the control node 100 may notify the edge node where the container to be updated belongs to perform resource locking on the target container group to which the container to be updated belongs.
There are various ways of determining the container to be updated. For example, the designation may be made by the user. For another example, the edge node may report the operation state information of the container on the edge node to the control node 100 periodically, and the control node 100 may monitor the container according to the operation state information of the container reported by each edge node, and when it is monitored that the mirror image information or other attribute information of any container changes, may determine the container as a container to be updated. For example, it may be determined that the container a is a container to be updated when it is monitored that the mirror information of the container a in the container group 201 shown in fig. 1 changes.
After determining the container a to be updated, the control node 100 may determine, according to the operation state information of the container reported by each edge node, an edge node where the container a to be updated is located, for example, the edge node 200 shown in fig. 1, and then send a lock notification to the edge node 200, where the lock notification includes a container identifier "a".
The edge node 200 receives the locking notification, and finds the container group to which the container indicated by the container identifier "a" belongs, that is, the container group 201, according to the container identifier "a" carried in the locking notification. The container group 201 may be regarded as the target container group described in this embodiment.
In one embodiment, the resource lock tag may be included in the lock notification, in which case the edge node 200 may add the resource lock tag in the lock notification to the container group 201 when determining that the container group 201 is the target container group. In another embodiment, the resource lock label may be recorded in the edge node 200, and when the edge node 200 determines that the container group 201 is the target container group, the edge node adds the resource lock label stored by the node to the container group 201.
The adding of the resource locking tag to the container group 201 refers to setting the resource locking tag as the attribute information of the container group 201. The resource locking tag may be any identifier that can be recognized by the edge node, for example, the identifier may be a character "keep," which is not limited in this embodiment.
After determining the container a to be updated, the control node 100 further sends an update instruction to the edge node 200 where the container a to be updated is located through step S220, where the update instruction may include an identifier of the container a to be updated, and the update instruction is used to instruct the edge node 200 to perform an update operation on the container a to be updated.
In the related art, when an edge node receives an update instruction of a control node for a certain container, the edge node deletes a container group to which the container belongs, reconstructs the container group, and creates a new version container in the reconstructed container group. Research shows that the container group carries the resources required by the operation of the container, and once the container group is deleted, the carried resources are released. Under the condition of insufficient resources, the released resources of the container group after deletion are preempted by other services, so that the container group running a new version container cannot be rebuilt, and further the updating of the container cannot be realized.
Based on the above analysis, in this embodiment, a resource locking tag is skillfully added to the container group 201 to which the container a to be updated belongs in step S210, so as to implement resource locking on the container group 201 to which the container a to be updated belongs, so that when the edge node 200 receives an update instruction for the container a to be updated, it is detected whether the container group 201 to which the container a to be updated belongs has the resource locking tag, if so, the container group 201 is retained, the container a to be updated is deleted from the container group 201, and a new version container a' corresponding to the container a to be updated is created.
Therefore, the resources of the container A to be updated can not be released in the updating process, the resources are prevented from being preempted by other services, and the new version container A' can be created by using the resources after the container A to be updated is deleted, so that the container updating is realized.
Second embodiment
Referring to fig. 3, fig. 3 is a flowchart illustrating a container updating method applied to a control node 100 according to the present embodiment, and a specific implementation flow of the method is similar to that of the method according to the first embodiment. The difference is that the present embodiment defines the timing at which the control node sends the lock notification.
In this case, the container updating method provided by the present embodiment includes the following steps.
Step S310, according to the resource information reported by the edge node, judging whether the edge node is in a resource tension state.
Step S320, if the edge node is in a resource-deficient state, sending the locking notification to the edge node, where the locking notification includes a container identifier of the container to be updated, so that the edge node adds a resource locking tag to a target container group to which the container to be updated belongs.
Step S330, sending an update instruction for the container to be updated to the edge node, so that the edge node deletes the container to be updated from the target container group and creates a new version container corresponding to the container to be updated according to the update instruction when it is checked that the target container group to which the container to be updated belongs has the resource locking tag.
With regard to the specific implementation flows of step S320 and step S330, reference may be made to the relevant description in the first embodiment.
Based on the analysis of the first embodiment, the case where a container on an edge node cannot be updated usually occurs when the resources of the edge node are insufficient. Therefore, the control node 100 may notify the edge node to perform resource locking on the target container group to which the container to be updated belongs when the resource of the edge node to which the container to be updated belongs is insufficient.
Therefore, under the condition of sufficient resources, the old version container can be destroyed by deleting the container group to which the container to be updated belongs, and then the new version container is created based on the newly-built container group, so that the environment of the obtained new version container is brand-new and clean, and errors are not easy to occur.
In this embodiment, an edge node is a node closer to a user, and a corresponding container is deployed on the edge node, so that a service can be quickly provided for the user.
It has been found through research that in practical applications, when updating containers on edge nodes, it is generally desirable that the updated containers can provide services to users at substantially the same speed. Therefore, when updating the container, the updated new version container needs to run on the edge node where the old version container is located, or run on the same edge node as the edge node where the old version container is located.
Taking the container a as an example, when monitoring that the container a needs to be updated, the control node 100 preferentially deploys the new version container a ' on the edge node 200 where the container a is located, and if the resources of the edge node 200 are insufficient, deploys the new version container a ' on the edge node 300 belonging to the same area as the edge node 200, so that the service speed of the new version container a ' is substantially consistent with that of the old version container a.
Based on the above analysis, there are various ways to determine whether the edge node where the container to be updated is located is in a resource tension state according to the resource information reported by the edge node.
In this embodiment, the resource information is reported periodically by the edge node, and may include a remaining resource amount and area information of the edge node, where the remaining resource amount may include, for example, a remaining Central Processing Unit (CPU) resource, a memory resource, and the like. The area information may include a geographic area to which the edge node belongs and an Autonomous System (AS), where the geographic area may be, for example, a city area such AS shenzhen and guangzhou, and the autonomous system may be divided according to different network service providers, for example, may be divided into a unicom autonomous system, a telecommunication autonomous system, and the like.
The container cluster management system 10 includes edge nodes distributed in a plurality of areas, and area information of each edge node is used to define an area to which the edge node belongs. For example, three edge nodes 200, 300 and 400 are shown in fig. 4 in communication with the control node 100, each operating with multiple containers, where the locale of the edge node 200 is "guangzhou" and the autonomous system is "telecom", the locale of the edge node 300 is "guangzhou" and the autonomous system is "telecom", and the locale of the edge node 400 is "shenzhen" and the autonomous system is "Unicom".
In the first way, the control node may send the lock notification when the edge node resource where the container to be updated is located is insufficient, and then step S310 may be implemented by the following procedure:
judging whether the residual resource quantity meets the preset resource specification of the container to be updated or not according to the residual resource quantity reported by the edge node;
if yes, determining that the edge node is not in a resource tension state;
and if not, determining that the edge node is in a resource tension state.
The preset resource specification refers to the amount of resources required for operating the container to be updated.
In the second way, the control node may send the lock notification when the resources of each edge node are insufficient in the same area to which the edge node where the container to be updated belongs. In this case, step S310 may be implemented by a flow as follows:
Determining a target area to which the edge node belongs according to the area information reported by the edge node, and acquiring the residual resource amount of each edge node belonging to the target area;
judging whether edge nodes with the residual resource quantity meeting the preset resource specification of the container to be updated exist in the target area or not;
and if so, determining that the edge node is not in a resource tension state.
And if not, determining that the edge node is in a resource tension state.
The preset resource specification refers to the amount of resources required for operating the container to be updated.
Referring to fig. 4, the flow of the second method is described in detail below by taking the container a to be updated as an example:
the control node 100 may determine that the area information of the edge node 200 where the container a to be updated is located includes "guangzhou" and "telecommunications", and may determine that the edge node belongs to a telecommunications autonomous system area in the guangzhou area according to the area information, and then may determine that the edge nodes whose area information includes "guangzhou" and "telecommunications" have 200 and 300 according to the resource information reported by each edge node, and then obtain respective remaining resource amounts of the edge nodes 200 and 300 from the resource information reported by each edge node, and respectively determine whether the respective remaining resource amounts of the edge nodes 200 and 300 reach a preset resource specification of the container a to be updated (for example, a resource amount required for operating the container a to be updated).
If the remaining resource amount of any one of the edge nodes 200 and 300 reaches the resource amount required for running the container a to be updated, it can be determined that the edge node 200 is not in a resource tension state. If the remaining resource amounts of the edge nodes 200 and 300 do not reach the resource amount required for running the container a to be updated, it is determined that the edge node 200 is in a resource tense state.
Third embodiment
Referring to fig. 5, fig. 5 is a container updating method provided by the present embodiment, which can be applied to an edge node, such as the edge node 200, in the container cluster management system 10 shown in fig. 1. The individual steps of the method are explained in detail below.
Step S510, receiving a locking notification sent by a control node, where the locking notification includes a container identifier of a container to be updated, and adding a resource locking tag to a target container group to which the container to be updated belongs according to the locking notification.
Step S520, receiving an update instruction for the container to be updated sent by the control node, and determining whether the target container group to which the container to be updated belongs has the resource locking tag according to the update instruction. If yes, go to step S530; if not, step S540 may be performed.
Step S530, deleting the container to be updated from the target container group, and creating a new version container corresponding to the container to be updated.
And step S540, deleting the target container group, creating a new target container group, and creating a new version container corresponding to the container to be updated in the new target container group.
In step S510, the edge node 200 may receive the lock notification through the proxy node process 210, recognize an identifier of the container to be updated carried in the lock notification, for example, recognize an identifier "a", and further determine, by searching, a container group 201 to which the container a to be updated belongs, and then add a resource lock tag to the container group 201, that is: the resource lock tag is set as attribute information of the container group 201. The resource locking identifier may be obtained from the locking notification, or may be pre-stored on the edge node 200, which is not limited in this embodiment.
With respect to step S520, there are various ways in which the control node sends the lock notification.
In an implementation manner of this embodiment, the lock notification may be sent by the control node to the edge node where the container to be updated is located after the container to be updated is determined. In this case, when the edge node 200 receives an update instruction for the container to be updated, the target container group to which the container to be updated belongs generally has a resource locking tag, and the edge node 200 may perform container update according to the flows shown in step S520 and step S530.
In another implementation manner in this embodiment, the lock notification may be sent by the control node when the edge node where the container to be updated is located is in a resource tension state. The specific manner of determining whether the edge node is in a resource-tensed state is similar to that in the second embodiment, and reference may be made to the related description in the second embodiment.
In this case, if the edge node 200 is in a resource-strained state, the edge node 200 will have a resource lock label, and the update operation may be performed on the container to be updated according to the flow shown in step S520 and step S530. If the edge node 200 is not in the resource-tight state, the edge node 200 will not have the resource locking label, and the container to be updated may be updated according to the flow of step S520 and step S540 at any time.
It should be noted that, in the present embodiment, the manner and the flow of the control node 100 sending the lock notification and the update instruction to the edge node are similar to those in the first embodiment and the second embodiment, and specific reference may be made to the detailed description of the above embodiments.
Through the design, the container to be updated can be updated under the condition of keeping the container group to which the container to be updated belongs. Because the resources of the container to be updated are borne in the container group to which the container to be updated belongs, the resources of the container to be updated cannot be released under the condition that the container group is not deleted, so that the problem that the container cannot be updated due to the fact that the resources of the container to be updated are preempted by other services after being released under the condition that the resources are insufficient is solved.
Further, in this embodiment, after creating the new version container, the edge node 200 may delete the resource lock tag of the target container group, so as to avoid locking the target container group for a long time. Therefore, under the condition of sufficient resources, the container to be updated can be destroyed by deleting the target container group, and the new version container is created in the newly-built target container group, so that the new version container runs in a brand-new and clean environment, and the running is not easy to make mistakes.
Fourth embodiment
In the container cluster management system 10, the container update method provided by the foregoing embodiment may have different implementations. One implementation provided by the present embodiment is explained below.
Referring to fig. 1 again, in the present embodiment, an Edge-resource-controller (Edge-resource-controller) component 120 may be disposed in the control node 100, and may be capable of interacting with the main node process 110 and invoking an interface of the main node process 110; an Edge-resource-reserving (Edge-resource-ordering) component 220 may be provided at the Edge node 200, which is capable of interacting with the proxy node process 210 and invoking an interface of the proxy node process 210.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating an operation flow of the container updating method on the container cluster management system 10, which may specifically include the following steps.
In step S610, the edge resource controller component 120 sends a lock notification to the proxy node process 210 through the master node process 110, where the lock notification includes the container identifier of the container to be updated.
In this embodiment, the proxy node process of each edge node reports the resource information of the node and the running state information of the container on the node to the master node process 110 periodically. The edge resource controller component 120 may obtain the operation state information of the container of each edge node from the master node process 110, and when it is monitored that container mirror image information or attribute information of any container is changed according to the obtained operation state information, may determine the container as a container to be updated.
When it is determined that the container is to be updated, the edge resource controller component 120 may call the interface of the master node process 110 to send the lock notification to the proxy node process 210, as per step S610.
Step S620, the agent node process 210 receives the locking notification, and adds a resource locking tag to the target container group to which the container to be updated belongs according to the container identifier in the locking notification.
In step S630, the edge resource controller component 120 sends an update instruction for the container to be updated to the proxy node process through the master node process.
Step S640, the agent node process 210 receives the update instruction, determines whether the target container group to which the container to be updated belongs has a resource locking tag, and if so, invokes the edge resource reservation component 220, deletes the container to be updated from the target container group, and creates a new version container corresponding to the container to be updated.
The agent node process 210 may transmit the parameter information of the container to be updated and the container image information of the new version as call parameters to the edge resource reservation component 220, and then call the edge resource reservation component 220. In the calling process, the edge resource reservation component 220 may send a SIGTEAM signal to the container to be updated according to the container identifier of the container to be updated in the update instruction to control the container to be updated to exit, delete the container to be updated from the target container group after the container to be updated exits, and create the container according to the received call parameter, where the created container is the new version container.
Optionally, the parameter information may include, for example, identification information, configuration file information, environment variable information, and the like of the container to be updated, which is not limited in this embodiment. Proxy node process 210 may invoke edge resource reservation component 220 in the form of Inter-process communication (IPC).
Through the addition of the edge resource controller component 120 and the edge resource reservation component 220, and the process shown in fig. 6, the edge resource controller component 120 invokes an interface of the master node process 110, controls the proxy node process 210 to lock the resource of the container group to which the container to be updated belongs, and determines whether the resource of the container group to which the container to be updated belongs is locked before the proxy node process 210 tries to delete the container group to which the container to be updated belongs according to the update instruction, if so, the container group is reserved, and the update of the container to be updated is realized under the condition that the container group is reserved. Therefore, the resources of the container to be updated are not released in the updating process, so that the resources are prevented from being preempted by other services, and a new version container can be created by using the resources after the container to be updated is deleted, so that the container is updated.
Further, referring to the foregoing description of the second embodiment, a case that a container on an edge node cannot be updated generally occurs when a resource of the edge node cannot be updated, and therefore, the container updating method provided in this embodiment may further include the following steps:
the edge resource controller component 120 obtains the resource information reported by the edge node 200 from the master node process 110, and determines whether the edge node 200 is in a resource tension state according to the resource information.
The edge resource controller component 120 may fetch the resource information from the host node process 110 using a hypertext transfer protocol (HTTP) snooping (Watch) approach. The manner and flow of the edge resource controller component 120 determining whether the edge node 200 is in a resource tension state based on the resource information are similar to the scheme provided in the second embodiment, and are not described herein again.
The above-described lock notification can be sent by the edge resource controller component 120 when the edge node 200 is in a resource-stressed state. Therefore, under the condition of sufficient resources, the old version container can still be destroyed by deleting the container group to which the container to be updated belongs, so that the environment of the subsequently created new version container is clean and brand new, and the operation is not easy to make mistakes.
The edge resource reservation component 220 may return a creation success notification to the proxy node process 210 after creating the new version container so that the proxy node process 210 may delete the resource lock label of the target container group. Therefore, the resource of the target container group can be prevented from being locked for a long time, and the environment of the updated container can be ensured to be clean and brand new under the condition of sufficient resources.
With regard to the description of each step of this embodiment, reference may be made to the detailed description of the relevant steps in the foregoing three embodiments.
Fifth embodiment
Referring to fig. 7, fig. 7 is a block diagram of a control node 100 according to the embodiment. The control node 100 includes a processor 101 and a machine-readable storage medium 102, the processor 101 and the machine-readable storage medium 102 being communicatively coupled via a system bus 103. The machine-readable storage medium 102 stores machine-executable instructions that when invoked may cause the processor 101 to implement the steps of the container update methods of the first and second embodiments of the present application.
It should be understood that the structure shown in fig. 7 is a schematic diagram of the control node 100, and that the control node 100 may also include more or less components than shown in fig. 7, or have a completely different configuration than shown in fig. 7. For example, the control node 100 may also include a communication component for communicating with edge nodes or other control nodes in the container cluster management system 10.
It should be noted that the control node 100 may perform the steps of the container updating method according to the first embodiment of the present application, and has the beneficial effects of the container updating methods according to the first embodiment and the second embodiment.
Sixth embodiment
Referring to fig. 8, an edge node 200 is shown as an example, which is a block diagram of an edge node. The edge node 200 includes a processor 202 and a machine-readable storage medium 203, the processor 202 and the machine-readable storage medium 203 may be communicatively coupled via a system bus 204. The machine-readable storage medium 203 stores machine-executable instructions that when invoked may cause the processor 202 to implement the steps of the container update method of the third embodiment of the present application.
It should be understood that the architecture shown in fig. 8 is merely a schematic diagram of edge node 200, and that edge node 200 may include more or fewer components than shown in fig. 8, or have a completely different configuration than shown in fig. 8. For example, the edge node 200 may also include a communication component for communicating with a control node or other edge nodes in the container cluster management system 10.
The architecture of other edge nodes in the container cluster management system 10 is similar to the edge node 200, and will not be described herein.
It should be noted that the edge node 200 may perform the steps of the container updating method according to the third embodiment of the present application, and has the beneficial effects of the container updating method according to the third embodiment.
To sum up, according to the container updating method, the control node, and the edge node provided in the embodiment of the present application, by performing resource locking on the target container group where the container to be updated is located, when receiving the update instruction, the edge node deletes the container to be updated from the target container group, instead of directly deleting the target container group. Because the resources used by the container to be updated are borne in the target container group and the resources of the target container group are locked, the resources of the container to be updated borne by the target container group can be prevented from being released, so that the resources of the container to be updated can be utilized to create a corresponding new version container, and even under the condition of insufficient resources, the container can be updated.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The embodiments described above are merely illustrative, and the flowcharts and block diagrams in the figures, for example, illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The foregoing description has been given for illustrative purposes only and is not intended to be limiting, and numerous modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (12)
1. A container updating method is applied to a control node in a container cluster management system, and the method comprises the following steps:
sending a locking notice to an edge node, wherein the locking notice comprises a container identifier of a container to be updated, and the edge node adds a resource locking label to a target container group to which the container to be updated belongs;
sending an update instruction for the container to be updated to the edge node, so that the edge node deletes the container to be updated from the target container group and creates a new version container corresponding to the container to be updated according to the update instruction when the target container group to which the container to be updated belongs is checked to have the resource locking tag;
judging whether the edge node is in a resource tension state or not according to the resource information reported by the edge node;
wherein the lock notification is issued by the control node when the edge node is in a resource tense state.
2. The method of claim 1, wherein the resource information comprises: the amount of remaining resources of the edge node;
the judging whether the edge node is in a resource tension state according to the resource information reported by the edge node comprises the following steps:
Judging whether the residual resource quantity meets the preset resource specification of the container to be updated or not according to the residual resource quantity reported by the edge node;
and if not, determining that the edge node is in a resource tension state.
3. The method of claim 1, wherein the resource information comprises: region information of the edge node;
the judging whether the edge node is in a resource tension state according to the resource information reported by the edge node comprises the following steps:
determining a target area to which the edge node belongs according to the area information reported by the edge node, and acquiring the residual resource amount of each edge node belonging to the target area;
judging whether edge nodes with residual resource quantity meeting the preset resource specification of the container to be updated exist in the target area or not;
and if not, determining that the edge node is in a resource tension state.
4. A container updating method applied to an edge node in a container cluster management system, the method comprising:
receiving a locking notification sent by a control node, wherein the locking notification comprises a container identifier of a container to be updated, and adding a resource locking label to a target container group to which the container to be updated belongs according to the locking notification;
Receiving an update instruction aiming at the container to be updated and sent by the control node, and judging whether the target container group to which the container to be updated belongs has the resource locking label or not according to the update instruction;
if the target container group has the resource locking label, deleting the container to be updated from the target container group, and creating a new version container corresponding to the container to be updated;
the locking notification is sent by the control node when the edge node where the container to be updated is located is in a resource tension state; the method further comprises the following steps:
and if the target container group does not have the resource locking label, deleting the target container group, creating a new target container group, and creating a new version container corresponding to the container to be updated in the new target container group.
5. The method of claim 4, further comprising:
after the new version container is created, the resource lock tag of the target container group is deleted.
6. The method of claim 4, wherein the creating a new version container corresponding to the container to be updated comprises:
And creating the new version container according to the parameter information of the container to be updated and the new version container mirror image information.
7. The container updating method is applied to a container cluster management system, the system comprises a control node and an edge node which are in communication connection with each other, the control node comprises a main node process and an edge resource controller component, and the edge node comprises a proxy node process and an edge resource reservation component; the method comprises the following steps:
the edge resource controller component sends a locking notification to the agent node process through the master node process, wherein the locking notification comprises a container identifier of a container to be updated;
the agent node process receives the locking notice and adds a resource locking label to a target container group to which the container to be updated belongs according to the container identifier in the locking notice;
the edge resource controller component sends an update instruction aiming at the container to be updated to the agent node process through the main node process;
the agent node process receives the updating instruction, judges whether the target container group to which the container to be updated belongs has a resource locking label, if so, calls the edge resource reservation component, deletes the container to be updated from the target container group, and creates a new version container corresponding to the container to be updated;
The edge resource controller component acquires resource information reported by the edge node from the master node process, and judges whether the edge node is in a resource tension state or not according to the resource information;
wherein the lock notification is issued by the edge resource controller component through the master node process when the edge node is in a resource-strained state.
8. The method of claim 7, further comprising:
after the edge resource reservation component creates the new version container, sending a creation success notification to the agent node process;
and the agent node process receives the creation success notification and deletes the resource locking label of the target container group.
9. A control node comprising a processor and a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked, cause the processor to implement the method of any one of claims 1 to 3.
10. An edge node comprising a processor and a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked, cause the processor to implement the method as claimed in any one of claims 4 to 6.
11. A machine-readable storage medium having stored thereon machine-executable instructions which, when executed, implement the method of any one of claims 1-3.
12. A machine-readable storage medium having stored thereon machine-executable instructions which, when executed, implement the method of any one of claims 4-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910858081.1A CN110569109B (en) | 2019-09-11 | 2019-09-11 | Container updating method, control node and edge node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910858081.1A CN110569109B (en) | 2019-09-11 | 2019-09-11 | Container updating method, control node and edge node |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110569109A CN110569109A (en) | 2019-12-13 |
CN110569109B true CN110569109B (en) | 2022-05-31 |
Family
ID=68779123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910858081.1A Active CN110569109B (en) | 2019-09-11 | 2019-09-11 | Container updating method, control node and edge node |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110569109B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111324360B (en) * | 2020-01-09 | 2022-04-01 | 华中科技大学 | Container mirror image construction method and system for edge calculation |
CN111290767B (en) * | 2020-01-20 | 2021-06-08 | 中国科学院计算技术研究所 | Container group updating method and system with service quick recovery function |
CN111552494B (en) * | 2020-04-24 | 2021-05-11 | 星环信息科技(上海)股份有限公司 | Method, device, system and medium for managing container group |
CN113741923A (en) * | 2020-05-27 | 2021-12-03 | 华为技术有限公司 | Application updating method, device, equipment and medium |
CN111917588B (en) * | 2020-08-10 | 2023-06-06 | 南方电网数字电网科技(广东)有限公司 | Edge device management method, device, edge gateway device and storage medium |
CN112181597B (en) * | 2020-10-12 | 2024-01-19 | 成都精灵云科技有限公司 | Dynamic updating method for container resource use limit |
US11693649B2 (en) | 2021-04-06 | 2023-07-04 | International Business Machines Corporation | Autonomous Kubernetes operator creation and management |
CN113986468A (en) * | 2021-11-04 | 2022-01-28 | 马上消费金融股份有限公司 | Container injection method and device |
CN114866790B (en) * | 2022-03-25 | 2024-02-27 | 上海哔哩哔哩科技有限公司 | Live stream scheduling method and device |
CN115145690B (en) * | 2022-06-30 | 2023-08-04 | 小米汽车科技有限公司 | Cluster resource expansion method and device and container cluster management system |
CN116431188B (en) * | 2023-04-24 | 2023-09-29 | 江苏博云科技股份有限公司 | Edge application SOTA upgrading method under cloud edge cooperative strategy |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106874125A (en) * | 2017-01-13 | 2017-06-20 | 北京元心科技有限公司 | Method and device for sharing system resources among multi-container systems |
CN107515776A (en) * | 2017-07-18 | 2017-12-26 | 深信服科技股份有限公司 | The uninterrupted upgrade method of business, node to be upgraded and readable storage medium storing program for executing |
WO2018164782A1 (en) * | 2017-03-10 | 2018-09-13 | Pure Storage, Inc. | Synchronously replicating datasets and other managed objects to cloud-based storage systems |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10241842B2 (en) * | 2016-09-29 | 2019-03-26 | Intel Corporation | Cloud container resource binding and tasking using keys |
CN109301936B (en) * | 2018-10-11 | 2022-03-08 | 云南电网有限责任公司红河供电局 | Intelligent substation operation and maintenance information monitoring system based on container scheduling framework |
-
2019
- 2019-09-11 CN CN201910858081.1A patent/CN110569109B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106874125A (en) * | 2017-01-13 | 2017-06-20 | 北京元心科技有限公司 | Method and device for sharing system resources among multi-container systems |
WO2018164782A1 (en) * | 2017-03-10 | 2018-09-13 | Pure Storage, Inc. | Synchronously replicating datasets and other managed objects to cloud-based storage systems |
CN107515776A (en) * | 2017-07-18 | 2017-12-26 | 深信服科技股份有限公司 | The uninterrupted upgrade method of business, node to be upgraded and readable storage medium storing program for executing |
Non-Patent Citations (1)
Title |
---|
基于Kubernetes的大数据流式计算Spark平台设计与实现;杜威科;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑(月刊)》;20180215(第02期);第I139-280页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110569109A (en) | 2019-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110569109B (en) | Container updating method, control node and edge node | |
EP3648401B1 (en) | Method, device, and computer readable storage medium for managing network slice | |
CN108737270B (en) | Resource management method and device for server cluster | |
CN111866191B (en) | Message event distribution method, distribution platform, system and server | |
EP3455728B1 (en) | Orchestrator for a virtual network platform as a service (vnpaas) | |
CN112789832B (en) | Dynamic slice priority handling | |
CN113037794B (en) | Method, device and system for computing resource allocation scheduling | |
CN111163173B (en) | Cluster configuration method and device, server and readable storage medium | |
CN111045745A (en) | Method and system for managing configuration information | |
CN116566984B (en) | Routing information creation method and device of k8s container cluster and electronic equipment | |
CN111277628B (en) | Server configuration method and device and service server | |
CN112732456A (en) | Micro-service calling method and device, electronic equipment and storage medium | |
FI120286B (en) | A method and device arrangement for managing a server-client environment | |
CN110557270A (en) | Network slice management method and device | |
GB2607871A (en) | Improvements in and relating to multi-access edge computing (MEC) | |
CN112181049B (en) | Cluster time synchronization method, device, system, equipment and readable storage medium | |
CN113783712A (en) | Default gateway management method, gateway manager, server and storage medium | |
CN114615268B (en) | Service network, monitoring node, container node and equipment based on Kubernetes cluster | |
CN112243243A (en) | Network slicing implementation method, entity and system | |
CN115225645A (en) | Service updating method, device, system and storage medium | |
CN114443059A (en) | Kubernets cluster deployment method, device and equipment | |
CN113093995A (en) | Cloud disk data migration method and system | |
KR20150112127A (en) | Local resource sharing method of machine to machine component and apparatus thereof | |
CN111404980B (en) | Data storage method and object storage system | |
CN111385422A (en) | Reserved telephone traffic management method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |