CN115981670A - Container cluster service deployment method, device, server and storage medium - Google Patents

Container cluster service deployment method, device, server and storage medium Download PDF

Info

Publication number
CN115981670A
CN115981670A CN202211577871.0A CN202211577871A CN115981670A CN 115981670 A CN115981670 A CN 115981670A CN 202211577871 A CN202211577871 A CN 202211577871A CN 115981670 A CN115981670 A CN 115981670A
Authority
CN
China
Prior art keywords
mirror image
target
target service
service
controller
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.)
Pending
Application number
CN202211577871.0A
Other languages
Chinese (zh)
Inventor
古明泉
敬军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Luoyang Zhongxinjia Artificial Intelligence Technology Innovation Research Institute Co ltd
Original Assignee
Luoyang Zhongxinjia Artificial Intelligence Technology Innovation Research Institute Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Luoyang Zhongxinjia Artificial Intelligence Technology Innovation Research Institute Co ltd filed Critical Luoyang Zhongxinjia Artificial Intelligence Technology Innovation Research Institute Co ltd
Priority to CN202211577871.0A priority Critical patent/CN115981670A/en
Publication of CN115981670A publication Critical patent/CN115981670A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a container cluster service deployment method, a device, a server and a storage medium, wherein the container cluster service deployment method comprises the following steps: acquiring controller information corresponding to at least one service controller; determining at least one target service controller with a mirror image to be updated and a target service node to which each target service controller belongs from the service controllers based on the controller information; and controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller according to the network condition of each target service node, so as to perform service deployment on the target service controller after the mirror image to be updated is pulled. The invention can effectively reduce the risk of network congestion, improve the deployment efficiency of service updating and obviously shorten the time of mirror image pulling.

Description

Container cluster service deployment method, device, server and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a container cluster service deployment method, apparatus, server, and storage medium.
Background
At present, when a container cluster updates a service, if a mirror image version of the service changes, all service nodes in the container cluster need to pull a mirror image again, and when the service initiates an update request, a container engine where the nodes are located pulls the mirror image from a container warehouse. Pulling the mirror in the service update process consumes time and network traffic, and particularly, when the number of services is large and the number of copies is large, deployment efficiency is reduced, and network congestion is likely to be caused in the mirror pulling process.
Disclosure of Invention
In view of this, the present invention provides a container cluster service deployment method, device, server and storage medium, which can effectively reduce the risk of network congestion, improve the deployment efficiency of service update, and significantly reduce the time for pulling a mirror image.
In a first aspect, an embodiment of the present invention provides a container cluster service deployment method, where a management container and multiple service nodes are deployed in a container cluster, and the service nodes are used to run a service controller, and the method is applied to the management container, and the method includes: acquiring controller information corresponding to at least one service controller; determining at least one target service controller with a mirror image to be updated and a target service node to which each target service controller belongs from the service controllers based on the controller information; and controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller according to the network condition of each target service node, so as to perform service deployment on the target service controller after the mirror image to be updated is pulled.
In an embodiment, the step of obtaining controller information corresponding to at least one of the service controllers includes: sending an information acquisition request to an interface management layer of the container cluster, so that the interface management layer feeds back controller information corresponding to at least one service controller according to the information acquisition request; wherein the controller information includes mirror image information and node information; and receiving the controller information fed back by the interface management layer.
In one embodiment, the step of determining, from the service controllers, that there is at least one target service controller of the mirror to be updated and a target service node to which each target service controller belongs based on the controller information includes: for each service controller, determining the service node to which the service controller belongs according to the node identifier in the node information, and inquiring a target mirror image version and target mirror image creation time according to the mirror image identifier in the mirror image information; judging whether the service controller has a mirror image to be updated or not according to the target mirror image version and the target mirror image creation time; if yes, the service controller is determined as a target service controller, and a service node to which the service controller belongs is determined as a target service node.
In an embodiment, the step of determining whether the service controller has an image to be updated according to the target image version and the target image creation time includes: acquiring a current mirror image version and current mirror image creation time corresponding to the service controller; and if the target mirror image version is larger than the current mirror image version and the target mirror image creation time is later than the current mirror image creation time, determining that the service controller has a mirror image to be updated.
In an embodiment, the step of controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller according to a network status of each target service node includes: for each target service node, sending the node identifier of the target service node to a node monitoring system, so that the node monitoring system queries the network flow of the target service node; receiving the network flow fed back by the node monitoring system, and determining the network condition of the target service node according to the network flow; and if the network condition is that a plurality of target service nodes with good network condition exist, controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller.
In one embodiment, the method further comprises: and if the network condition of the target service node is poor, sending the node identifier of the target service node to the node monitoring system according to a preset period until the network condition of the target service node is good.
In one embodiment, after the step of controlling at least one of the target service nodes to pull the mirror image to be updated corresponding to the target service controller, the method further includes: after each target service node finishes pulling the mirror image to be updated, sending the target service node, the target mirror image version corresponding to the mirror image to be updated and a pulling duration to an instruction association terminal; or after each target service node finishes the pulling of the mirror image to be updated, generating a mirror image pulling log based on the target service node, the target mirror image version corresponding to the mirror image to be updated and the pulling time length, and storing the mirror image pulling log to a specified storage area.
In a second aspect, an embodiment of the present invention further provides a device for deploying a container cluster service, where a management container and a plurality of service nodes are deployed in the container cluster, the service nodes are used to operate a service controller, and the device is applied to the management container, and the device includes: the information acquisition module is used for acquiring controller information corresponding to at least one service controller; the target determining module is used for determining at least one target service controller with a mirror image to be updated and a target service node to which each target service controller belongs from the service controllers based on the controller information; and the mirror image pulling module is used for respectively controlling each target service node to pull the mirror image to be updated corresponding to each target service controller according to the network condition of each target service node so as to perform service deployment aiming at least one target service controller after the pulling of the mirror image to be updated is finished.
In a third aspect, an embodiment of the present invention further provides a server, including a processor and a memory, where the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the methods provided in the first aspect.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement any one of the methods provided in the first aspect.
The embodiment of the invention provides a method, a device, a server and a storage medium for deploying container cluster services, wherein a management container and a plurality of service nodes are deployed in a container cluster, and the service nodes are used for operating service controllers. According to the method, the management container is deployed in the container cluster, the management container can determine the target service controller needing mirror image updating and the target service node of the target service controller on the basis of the controller information, further informs the target service node to pull the mirror image to be updated, and deploys the service after all the target service nodes finish the pulling of the mirror image to be updated.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a container cluster service deployment method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a container cluster service deployment architecture according to an embodiment of the present invention;
fig. 3 is a schematic diagram of mirror information according to an embodiment of the present invention;
fig. 4 is a schematic diagram of node information according to an embodiment of the present invention;
fig. 5 is a schematic diagram of another node information provided in the embodiment of the present invention;
FIG. 6 is a diagram illustrating another example of mirrored information provided by an embodiment of the present invention;
fig. 7 is a schematic diagram of a mirror image sample provided in an embodiment of the present invention;
fig. 8 is a schematic diagram of a node network traffic provided in an embodiment of the present invention;
FIG. 9 is a diagram illustrating an operation instruction according to an embodiment of the present invention;
fig. 10 is a schematic flowchart of another container cluster service deployment method according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a container cluster service deployment apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the embodiments, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, the existing service deployment method is easy to cause network congestion, and has the problems of low deployment efficiency, long mirror image pulling time and the like. Based on the above, the implementation of the invention provides a container cluster service deployment method, a device, a server and a storage medium, which can effectively reduce the risk of network congestion, improve the deployment efficiency of service update and remarkably shorten the time of mirror image pulling.
To facilitate understanding of the present embodiment, first, a detailed description is given to a container cluster service deployment method disclosed in the embodiment of the present invention, where a management container and a plurality of service nodes are deployed in a container cluster, and the service nodes are used for operating a service controller, where the method is applied to the management container, referring to a flowchart of a container cluster service deployment method shown in fig. 1, the method mainly includes the following steps S102 to S106:
step S102, obtaining controller information corresponding to at least one service controller. The service controller operates in a service node, the controller information includes mirror image information and node information, the mirror image information at least includes a mirror image identifier (such as a container mirror image tag number), and the node information at least includes a node identifier (such as an Identity Document (ID) or a node name) and a node IP (Internet Protocol Address). In one embodiment, the controller information may be obtained through an Interface management layer, which may be an API server or a container clustering API (Application Programming Interface).
And step S104, determining at least one target service controller with the mirror image to be updated and a target service node to which each target service controller belongs from the service controllers based on the controller information. The target service controller is a service controller of the latest version for the used mirror image. In an embodiment, the service node to which each service controller belongs may be determined according to the node identifier, or the target image version and the target image creation time may be queried according to the image identifier, and whether the service controller has an image to be updated is determined based on the target image version and the target image creation time, and if so, the service controller may be determined as the target service controller, and further, the target service node to which the target service controller belongs may be determined.
Step S106, according to the network condition of each target service node, controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller, so as to perform service deployment for the target service controller after the mirror image to be updated is pulled. The network conditions include good network conditions and poor network conditions. In an embodiment, a target service node with good network condition may be controlled to pull a mirror image to be updated corresponding to a target service controller running therein, if the number of the target service nodes with good network condition is multiple, a single or multiple target service nodes may be selected to pull the mirror image to be updated corresponding to the target service controller running therein at the same time, and after all the target service nodes finish pulling the mirror image to be updated, an administrator is notified to perform service deployment.
According to the container cluster service deployment method provided by the embodiment of the invention, the management container is deployed in the container cluster, the management container can determine the target service controller needing mirror image updating and the target service node thereof on the basis of the controller information, further inform the target service node to pull the mirror image to be updated, and perform service deployment after all the target service nodes finish the pulling of the mirror image to be updated.
For convenience of understanding, an embodiment of the present invention provides a container cluster service deployment architecture, and referring to a schematic diagram of a container cluster service deployment architecture shown in fig. 2, fig. 2 illustrates that an APIserver, a management pod (i.e., the above management container), a service node, and a pod are deployed in a container cluster. On the basis of the above steps: (1) The management pod acquires controller information of the service controller from the APIserver; (2) The management pod acquires and analyzes the mirror image state of the mirror image warehouse in the current service controller from the mirror image warehouse (also called as a container warehouse), and the mirror image state is used for representing whether the current service controller has a mirror image to be updated or not; (3) The management pod acquires the network condition of the service node where the service controller is located from an external monitoring platform (also called as a node monitoring system); (4) the management pod informs the service node to pull the mirror image to be updated; (5) And the service node pulls the mirror image to be updated from the external management platform.
On the basis of the foregoing embodiment, in order to facilitate understanding of step S102 described above, in an embodiment of the present invention, an implementation is provided for acquiring controller information corresponding to at least one service controller, where the management pod may send an information acquisition request to an interface management layer of the container cluster, so that the interface management layer feeds back the controller information corresponding to the at least one service controller for the information acquisition request, and the management pod receives the controller information fed back by the interface management layer. In specific implementation, the management pod sends an information acquisition request to the apicerver to request all service controller names, so as to analyze which service nodes the service controller target operates on, the tag number of the used container image, the current image creation time and the like. Wherein, part of the controller information is obtained by filtering the returned result of the APIserver. The embodiment of the invention can separate the management pod from the service controller by requesting the controller information from the APIserver, and does not have any invasion to the service code and the architecture.
In one embodiment, the controller information spec includes mirror information of contacts and actual node information (which may also be referred to as pod information), for example, referring to a schematic diagram of mirror information shown in fig. 3 and a schematic diagram of node information shown in fig. 4, fig. 3 illustrates that the mirror information may include "image:192.168.5.122/robot-quality-report; test _ v1.0.1.X ", the node information may include" message: regenerative "robot-port-deployment-f 9b88d74c" has leisure treated ". It should be noted that the mirror information and the node information described above are merely examples.
On the basis of the foregoing embodiment, to facilitate understanding of step S104, an embodiment of the present invention provides an implementation manner for determining, based on the controller information, that there are at least one target service controller of the mirror to be updated and a target service node to which each target service controller belongs from the service controllers, and specifically refer to steps 1 to 3 as follows:
step 1, for each service controller, determining the service node to which the service controller belongs according to the node identifier in the node information, and inquiring a target mirror image version and target mirror image creation time according to the mirror image identifier in the mirror image information. In one embodiment, all service nodes operated by the service controller may be obtained through a node identifier (such as a pod name), for example, another node information diagram shown in fig. 5, and fig. 5 illustrates that when the node identifier is "robot-report-deployment-f9b88d74c", it may be determined that the service node to which the service controller belongs is "k8sjq-test-pre-node16". In one embodiment, the management pod may request the container repository for querying the target image version and the target image creation time corresponding to the image identifier.
And 2, judging whether the service controller has a mirror image to be updated according to the target mirror image version and the target mirror image creation time. In an embodiment, whether the service controller has an image to be updated may be determined according to the following steps 2.1 to 2.2:
and 2.1, acquiring a current mirror image version and current mirror image creation time corresponding to the service controller. In another embodiment, a container engine on a service node where the service controller is located may be used to query, according to an image identifier, an image creation time of an image currently used by the service controller, for example, see another schematic diagram of image information shown in fig. 6, where fig. 6 illustrates that the current image creation time corresponding to the image identifier after the container engine queries is "Created:2021-04-14T10:04:36.021237024Z ".
And 2.2, if the target mirror image version is larger than the current mirror image version and the target mirror image creation time is later than the current mirror image creation time, determining that the service controller has a mirror image to be updated. The target image version may be recorded as a target image tag number, and the current image version may be recorded as a current image tag number. In specific implementation, when the target mirror image tag number of the mirror image is greater than the current mirror image tag number currently used by the service controller, and the target mirror image creation time is later than the target mirror image creation time currently used by the service controller, it may be determined that the mirror image of the service controller has the latest version, and the management pod obtains the latest mirror image version. Exemplarily, referring to a schematic diagram of a mirror image sample shown in fig. 7, fig. 7 illustrates a mirror image tag number and a mirror image creation time, and may further display a push time of the mirror image.
And 3, if so, determining the service controller as a target service controller, and determining a service node to which the service controller belongs as a target service node.
On the basis of the foregoing embodiment, to facilitate understanding of step S106, an embodiment of the present invention provides an implementation that controls at least one target service node to pull a mirror image to be updated corresponding to a target service controller according to a network condition of each target service node, where reference is made to the following steps a to d:
step a, for each target service node, sending the node identifier of the target service node to a node monitoring system, so that the node monitoring system queries the network traffic of the target service node. Wherein, the node monitoring system can adopt a conventional monitoring system zabbix or prometheus. In one embodiment, the node monitoring system may be requested to query the current network traffic of the target service node, such as a node network traffic diagram shown in fig. 8, where fig. 8 is for reference only and is not actual data. In specific implementation, the network traffic of the target service node may be queried in the form of an API interface, and the query condition is the IP address of the target service node.
And b, receiving the network flow fed back by the node monitoring system, and determining the network condition of the target service node according to the network flow. In one embodiment, if the network traffic is below a specified usage threshold, it may be determined that the network is in good condition; otherwise, if the network traffic is above the specified utilization threshold, a poor network condition may be determined. Wherein the specified usage threshold may be adjusted based on actual conditions. For example, if the usage threshold is 80%, it may be determined that the network condition is good when the usage is lower than 80%, and it may be determined that the network condition is bad when the usage is higher than 80%.
And c, if the network condition is that a plurality of target service nodes with good network condition exist, controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller. In one embodiment, after determining the target service node with good network conditions, the management pod transmits the target image version to the container engine of the target service node with good network conditions, and the container engine initiates a request for pulling the latest image to the container warehouse. Optionally, if there are multiple target service nodes with good network conditions, the management pod may control operation of one or multiple target service nodes according to the network conditions of the target service nodes, and finally all the service nodes complete pulling of the latest mirror image version.
In a specific implementation, the mirror image pull manner is an operation instruction (such as a pull command) of the container engine, such as a schematic diagram of an operation instruction shown in fig. 9, the container engine only needs a mirror image address to pull the mirror image of the target mirror image version, the container engine pulls the basic function built in the function bit container engine, and the operation instruction is issued to the container engine by the management pod and executed by the container engine/the background.
And d, if the network condition of the target service node is poor, sending the node identifier of the target service node to a node monitoring system according to a preset period until the network condition of the target service node is good. In one embodiment, in case of a bad network condition, the management pod will suspend for a period of time and then repeatedly initiate the request, and continuously monitor the network condition of the target service node until the network condition is good. In specific implementation, the restart initiation request is an analysis time period, the requirement on timeliness of the task is not high, and when the current network state is monitored to be poor, judgment is continued in the next period until the network condition is good. Optionally, if the network conditions are consistent and the network conditions are not good, the mirror image will not be pulled, so as to avoid causing network stress.
In one embodiment, after each target service node finishes pulling the mirror image to be updated, the target service node, the target mirror image version corresponding to the mirror image to be updated and the pulling duration are sent to the instruction association terminal. In another embodiment, after each target service node finishes the pulling of the mirror image to be updated, a mirror image pulling log is generated based on the target service node, the target mirror image version corresponding to the mirror image to be updated and the pulling time length, and the mirror image pulling log is stored in the specified storage area. In practical application, after all the service nodes finish the pulling of the latest mirror image, the information of the operated service nodes, the latest mirror image version number, the consumed time and the like is transmitted to an administrator or stored in a log so as to express that the pulling of the current latest version mirror image is finished to the administrator, and the service updating can be started. At this time, the administrator starts to update the service, and since the node already contains the latest mirror version, the pull time is extreme or zero. The whole process is finished, and the subsequent whole process enters a circulating state.
To facilitate understanding of the foregoing embodiments, an application example of a container cluster service deployment method is provided in the embodiments of the present invention, referring to a flow diagram of another container cluster service deployment method shown in fig. 10, where the method mainly includes the following steps S1002 to S1010:
step S1002, a management pod is deployed in the service name middle where the container cluster belongs.
Step S1004, the management POD requests the container warehouse for a query of the target image version and the target image creation time.
Step S1006, analyzes the network status of the target service node to which the target service controller belongs.
Step S1008, the target service node with good network condition is controlled to pull the mirror image of the target mirror image version.
In step S1010, the management pod returns the mirror pull result, and step S1004 is executed.
In summary, the container cluster service deployment method provided in the embodiments of the present invention can reduce the risk of network traffic congestion, improve the deployment efficiency of service update, and reduce the mirror image pull time to an extreme value or a zero value.
As to the container cluster service deployment method provided in the foregoing embodiment, an embodiment of the present invention provides a container cluster service deployment apparatus, where a management container and multiple service nodes are deployed in a container cluster, a service node is used to operate a service controller, and the apparatus is applied to the management container, and referring to a schematic structural diagram of the container cluster service deployment apparatus shown in fig. 11, the apparatus may include the following components:
an information obtaining module 1102, configured to obtain controller information corresponding to at least one service controller;
a target determining module 1104, configured to determine, based on the controller information, at least one target service controller having a mirror image to be updated and a target service node to which each target service controller belongs from the service controllers;
and the mirror image pulling module 1104 is configured to respectively control each target service node to pull the mirror image to be updated corresponding to each target service controller according to the network status of each target service node, so as to perform service deployment for at least one target service controller after the pulling of the mirror image to be updated is completed.
The container cluster service deployment device provided by the embodiment of the invention can effectively reduce the risk of network congestion, improve the deployment efficiency of service update and remarkably shorten the time of mirror image pulling by deploying the management container in the container cluster, wherein the management container can determine the target service controller needing mirror image update and the target service node thereof on the basis of the controller information, further inform the target service node to pull the mirror image to be updated, and perform service deployment after all the target service nodes finish the pulling of the mirror image to be updated.
In one embodiment, the information obtaining module 1102 is further configured to: sending an information acquisition request to an interface management layer of the container cluster so that the interface management layer feeds back controller information corresponding to at least one service controller according to the information acquisition request; the controller information comprises mirror image information and node information; and receiving the controller information fed back by the interface management layer.
In one embodiment, the targeting module 1104 is further configured to: for each service controller, determining a service node to which the service controller belongs according to a node identifier in the node information, and inquiring a target mirror image version and target mirror image creation time according to a mirror image identifier in the mirror image information; judging whether the service controller has a mirror image to be updated or not according to the target mirror image version and the target mirror image creation time; if yes, the service controller is determined as a target service controller, and a service node to which the service controller belongs is determined as a target service node.
In one embodiment, the targeting module 1104 is further configured to: acquiring a current mirror image version and current mirror image creation time corresponding to the service controller; and if the target mirror image version is larger than the current mirror image version and the target mirror image creation time is later than the current mirror image creation time, determining that the service controller has a mirror image to be updated.
In one embodiment, the mirror pull module 1104 is further configured to: for each target service node, sending the node identifier of the target service node to a node monitoring system, so that the node monitoring system queries the network flow of the target service node; receiving network flow fed back by the node monitoring system, and determining the network condition of the target service node according to the network flow; and if the network condition is that a plurality of target service nodes with good network condition exist, controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller.
In one embodiment, the mirror pull module 1104 is further configured to: and if the network condition of the target service node is poor, sending the node identifier of the target service node to a node monitoring system according to a preset period until the network condition of the target service node is good.
In one embodiment, the apparatus further includes a notification module configured to: after each target service node finishes pulling the mirror image to be updated, the target service node, the target mirror image version corresponding to the mirror image to be updated and the pulling duration are sent to the instruction association terminal; or after each target service node finishes the pulling of the mirror image to be updated, generating a mirror image pulling log based on the target service node, the target mirror image version corresponding to the mirror image to be updated and the pulling time length, and storing the mirror image pulling log to the specified storage area.
The device provided by the embodiment of the present invention has the same implementation principle and the same technical effects as those of the foregoing method embodiments, and for the sake of brief description, reference may be made to corresponding contents in the foregoing method embodiments for the parts of the device embodiments that are not mentioned.
The embodiment of the invention provides a server, which particularly comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the above described embodiments.
Fig. 12 is a schematic structural diagram of a server according to an embodiment of the present invention, where the server 100 includes: a processor 120, a memory 121, a bus 122 and a communication interface 123, wherein the processor 120, the communication interface 123 and the memory 121 are connected through the bus 122; the processor 120 is used to execute executable modules, such as computer programs, stored in the memory 121.
The Memory 121 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 123 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like may be used.
The bus 122 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 12, but that does not indicate only one bus or one type of bus.
The memory 121 is configured to store a program, and the processor 120 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 120, or implemented by the processor 120.
The processor 120 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 120. The Processor 120 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 121, and the processor 120 reads the information in the memory 121 and completes the steps of the method in combination with the hardware thereof.
The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the foregoing method embodiment, which is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes 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 invention. 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.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the following descriptions are only illustrative and not restrictive, and that the scope of the present invention is not limited to the above embodiments: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A container cluster service deployment method is characterized in that a management container and a plurality of service nodes are deployed in the container cluster, the service nodes are used for operating a service controller, and the method is applied to the management container, and the method comprises the following steps:
acquiring controller information corresponding to at least one service controller;
determining at least one target service controller with a mirror image to be updated and a target service node to which each target service controller belongs from the service controllers based on the controller information;
and controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller according to the network condition of each target service node, so as to perform service deployment on the target service controller after the mirror image to be updated is pulled.
2. The method according to claim 1, wherein the step of obtaining controller information corresponding to at least one of the service controllers comprises:
sending an information acquisition request to an interface management layer of the container cluster, so that the interface management layer feeds back controller information corresponding to at least one service controller according to the information acquisition request; wherein the controller information includes mirror image information and node information;
and receiving the controller information fed back by the interface management layer.
3. The method according to claim 2, wherein the step of determining, from the service controllers, that there is at least one target service controller to be mirrored and a target service node to which each target service controller belongs based on the controller information comprises:
for each service controller, determining the service node to which the service controller belongs according to the node identifier in the node information, and inquiring a target mirror image version and target mirror image creation time according to the mirror image identifier in the mirror image information;
judging whether the service controller has a mirror image to be updated according to the target mirror image version and the target mirror image creation time;
if yes, the service controller is determined as a target service controller, and a service node to which the service controller belongs is determined as a target service node.
4. The method according to claim 3, wherein the step of determining whether the service controller has an image to be updated according to the target image version and the target image creation time includes:
acquiring a current mirror image version and current mirror image creation time corresponding to the service controller;
and if the target mirror image version is larger than the current mirror image version and the target mirror image creation time is later than the current mirror image creation time, determining that the service controller has a mirror image to be updated.
5. The method according to claim 2, wherein the step of controlling at least one of the target service nodes to pull the mirror image to be updated corresponding to the target service controller according to a network condition of each of the target service nodes comprises:
for each target service node, sending the node identifier of the target service node to a node monitoring system, so that the node monitoring system queries the network flow of the target service node;
receiving the network flow fed back by the node monitoring system, and determining the network condition of the target service node according to the network flow;
and if the network condition is that a plurality of target service nodes with good network condition exist, controlling at least one target service node to pull the mirror image to be updated corresponding to the target service controller.
6. The method of claim 5, further comprising:
and if the network condition of the target service node is poor, sending the node identifier of the target service node to the node monitoring system according to a preset period until the network condition of the target service node is good.
7. The method according to claim 1, wherein after the step of controlling at least one of the target service nodes to pull the mirror to be updated corresponding to the target service controller, the method further comprises:
after each target service node finishes pulling the mirror image to be updated, the target service node, the target mirror image version corresponding to the mirror image to be updated and the pulling duration are sent to an instruction association terminal;
or after each target service node finishes pulling the mirror image to be updated, generating a mirror image pulling log based on the target service node, the target mirror image version corresponding to the mirror image to be updated and the pulling time length, and storing the mirror image pulling log to a specified storage area.
8. A container cluster service deployment apparatus, where a management container and multiple service nodes are deployed in the container cluster, where the service nodes are used to run a service controller, and the apparatus is applied to the management container, and the apparatus includes:
the information acquisition module is used for acquiring controller information corresponding to at least one service controller;
the target determining module is used for determining at least one target service controller with a mirror image to be updated and a target service node to which each target service controller belongs from the service controllers based on the controller information;
and the mirror image pulling module is used for respectively controlling each target service node to pull the mirror image to be updated corresponding to each target service controller according to the network condition of each target service node so as to perform service deployment aiming at least one target service controller after the pulling of the mirror image to be updated is finished.
9. A server comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 7.
10. A computer-readable storage medium having computer-executable instructions stored thereon which, when invoked and executed by a processor, cause the processor to implement the method of any of claims 1 to 7.
CN202211577871.0A 2022-12-09 2022-12-09 Container cluster service deployment method, device, server and storage medium Pending CN115981670A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211577871.0A CN115981670A (en) 2022-12-09 2022-12-09 Container cluster service deployment method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211577871.0A CN115981670A (en) 2022-12-09 2022-12-09 Container cluster service deployment method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN115981670A true CN115981670A (en) 2023-04-18

Family

ID=85973064

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211577871.0A Pending CN115981670A (en) 2022-12-09 2022-12-09 Container cluster service deployment method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN115981670A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117033325A (en) * 2023-10-08 2023-11-10 恒生电子股份有限公司 Mirror image file preheating and pulling method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117033325A (en) * 2023-10-08 2023-11-10 恒生电子股份有限公司 Mirror image file preheating and pulling method and device
CN117033325B (en) * 2023-10-08 2023-12-26 恒生电子股份有限公司 Mirror image file preheating and pulling method and device

Similar Documents

Publication Publication Date Title
CN110896404B (en) Data processing method and device and computing node
CN108566290B (en) Service configuration management method, system, storage medium and server
US11573725B2 (en) Object migration method, device, and system
EP3873066A1 (en) Method for managing resource state information, and resource downloading system
US11102289B2 (en) Method for managing resource state information and system for downloading resource
CN110618889A (en) Service availability detection method and device, computer equipment and storage medium
CN115981670A (en) Container cluster service deployment method, device, server and storage medium
US20220284020A1 (en) Data processing method, apparatus, and system
CN109951551B (en) Container mirror image management system and method
CN115168031A (en) Fog calculation system, method, electronic equipment and storage medium
CN112965817B (en) Resource management method and device and electronic equipment
CN111625264B (en) Method, device, equipment and medium for upgrading multi-level management system
CN113608838A (en) Deployment method and device of application image file, computer equipment and storage medium
CN111159233B (en) Distributed caching method, system, computer equipment and storage medium
CN110955460B (en) Service process starting method and device, electronic equipment and storage medium
CN115766715B (en) Super-fusion cluster monitoring method and system
CN109962941B (en) Communication method, device and server
CN116781719A (en) Container mirror image preheating method, electronic equipment and storage medium
CN112685102B (en) Gateway plug-in hot loading method, device, equipment and medium
CN110286732B (en) Method, device and equipment for automatically recovering power failure of high-availability cluster and storage medium
JP2000259590A (en) Module linking method and computer system utilizing the same
CN110572303B (en) Method and device for automatically discovering nodes
CN110213314B (en) Method, device and server for determining storage node
CN116107654A (en) Program starting method and device, electronic equipment and storage medium
CN112988328A (en) Method and device for downloading mirror image file of container group and electronic equipment

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