CN111679888A - Deployment method and device of agent container - Google Patents

Deployment method and device of agent container Download PDF

Info

Publication number
CN111679888A
CN111679888A CN202010501424.1A CN202010501424A CN111679888A CN 111679888 A CN111679888 A CN 111679888A CN 202010501424 A CN202010501424 A CN 202010501424A CN 111679888 A CN111679888 A CN 111679888A
Authority
CN
China
Prior art keywords
container
agent
proxy
server
node server
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
CN202010501424.1A
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010501424.1A priority Critical patent/CN111679888A/en
Publication of CN111679888A publication Critical patent/CN111679888A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The embodiment of the invention provides a method and a device for deploying an agent container, wherein the method comprises the following steps: the node server generates a container management instance with a set proxy function based on a container generation instruction of the container management platform; the container generation instruction is triggered by the container management platform based on an agent generation instruction of an agent server; the agent generation instruction is used for indicating a container with a set agent function to be deployed in the node server; the node server generates a proxy container based on the container management instance; the life cycle of the agent container is managed by the container management platform; the node server acquires an application file corresponding to the set proxy function from the file server based on the container management instance, and configures the application file to the proxy container, so that the proxy container has the set proxy function. By adopting the method, the automatic deployment and the running state monitoring of the business process can be realized, the resource usage amount is saved, and the deployment cost is reduced.

Description

Deployment method and device of agent container
Technical Field
The present application relates to the field of financial technology (Fintech) network technologies, and in particular, to a method and an apparatus for deploying an agent container.
Background
In recent years, with the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but higher requirements are also put on the technologies due to the requirements of the financial industry on safety and real-time performance. The realization of the computer technology requires installing a corresponding business process in the computer; e.g., a logging process, a monitoring process, etc., so that the computer can process traffic normally.
In the prior art, a service agent process in a node server directly installs a binary executable file of the service agent process on a host through an SSH (Secure Shell, Secure Shell protocol) \\ SCP (short for SSH copy); however, when installing or updating the service agent process in a cluster with hundreds of hosts, the method needs to install or update the service agent process for each node server, which is large in workload and consumes huge manpower and material resources; the number of the service agent processes in the node server is large, and when the cluster is expanded, the installation of the service agent processes is easy to be omitted on the expanded node server, so that data loss is caused. Or, directly embedding the binary executable file of the service agent process into the operating system image of the node server, and initially installing the binary executable file along with the host. However, in this way, when the service agent process needs to be updated, the operating system of the node server needs to be repackaged, and the system is reloaded through the stock server, which consumes server resources and still has a large workload.
Disclosure of Invention
The embodiment of the invention provides a deployment method and a deployment device of an agent container, which are used for realizing automatic deployment and running state monitoring of a business process, saving the resource usage and reducing the deployment cost.
In a first aspect, an embodiment of the present invention provides a method for deploying a proxy container, where the method includes:
the node server generates a container management instance with a set proxy function based on a container generation instruction of the container management platform; the container generation instruction is triggered by the container management platform based on an agent generation instruction of an agent server; the agent generation instruction is used for instructing the node server to deploy a container with the set agent function; the node server generates a proxy container based on the container management instance; the life cycle of the proxy container is managed by the container management platform; and the node server acquires an application file corresponding to the set proxy function from a file server based on the container management instance, and configures the application file to the proxy container, so that the proxy container has the set proxy function.
By adopting the method, the agent server generates an agent generation instruction and sends the agent generation instruction to the container management platform, the container management platform is triggered by the agent generation instruction to obtain a container generation instruction, and then the container generation instruction is distributed to each node server, so that each node server generates a container management instance with a set agent function. In this way, the container management instances in the respective node servers are made identical. Further, each node server generates a proxy container according to the container management instance, acquires an application file corresponding to a set proxy function from the file server, and configures the application file into the proxy container, so that the proxy container has the proxy function. Therefore, the automatic deployment of the agent process in each node server is realized through the agent server, the container management platform, the file server and each node server. And the container management platform can monitor the agent container and the operation state of the service process of the agent container, and manage the life cycle of the agent container. The automatic deployment and the running state monitoring of the business process are realized, the resource usage amount is saved, and the deployment cost is reduced.
In one possible design, the node server generates a proxy container based on the container management instance, including: and the node server acquires a container mirror image file from a mirror image server based on the container management instance and generates the proxy container.
By adopting the method, the node server can acquire the container mirror image file from the mirror image server based on the container management instance; that is, container images of agent containers having different set proxy functions may be stored in the image server such that the agent containers having different set proxy functions share one container image, and agent containers in different node servers and the same node server share one container image. Therefore, the running environments of all the agent containers in the cluster are the same, the running environments of the agent containers are unified, and the problem that the agent process cannot be compatible with the node server environment due to different versions or configurations possibly existing in each node server is solved; storing application files of agent containers with different set agent functions in a file server, so that the agent containers with different set agent functions have the application files corresponding to different agent functions, and further realizing that the agent containers have different agent functions; therefore, the situation that resources are occupied because the container mirror image file of each agent container with the set agent function is coupled with the application file and the complete agent container file of each agent container with the set agent function is provided with the container mirror image file is eliminated.
In one possible design, before generating the container management instance with the set-up agent function, the method further includes: the node server receives the container generation instruction sent by a custom controller of the container management platform; the node server obtains a container mirror image file from a mirror image server based on the container management instance, and generates the proxy container, including: the container management instance of the node server acquires the container image file from the image server through a container engine Dockerd; and the container engine Dockerd of the node server generates the proxy container through the container image file.
By adopting the method, the custom controller in the container platform generates the container generation instruction according to the agent generation instruction, and the container generation instruction is generated uniformly through the custom controller, so that the container generation instruction can be suitable for node servers of different versions and operating systems, and the node servers of different operating environments can obtain the same container management instance according to the container generation instruction. The container management instance obtains the container image file from the image server through the container engine Dockerd, and further the container engine Dockerd can generate the proxy container according to the container image file without setting a container image file for each proxy container, so that the cost of resource occupation can be reduced.
In one possible design, the node server generates a proxy container based on the container management instance, including: the node server generates an agent container with an agent management process based on the container management instance; the node server obtains the application file corresponding to the set proxy function from a file server based on the container management instance, and the method comprises the following steps: the node server generates an agent container with an agent management process based on the container management instance, and acquires the application file from the file server through the agent management process; configuring the application file to the proxy container, including: and generating an agent process running in the agent container through the application file.
By adopting the method, the node server generates the proxy container with the proxy management process based on the container management instance, so that the application file can be acquired from the file server through the proxy management process, and then the application file is configured into the proxy container to generate the proxy process running in the proxy container. Thus, the automatic deployment of the agent containers with different agent functions is realized.
In one possible design, after configuring the application file to the proxy container, the method further includes:
the node server receives an agent updating instruction, wherein the agent updating instruction is sent by the agent server; the node server acquires an update file corresponding to the agent update instruction from the file server through the agent management process; and the node server closes the agent process through the agent management process and generates an updated agent process according to the update file.
By adopting the method, the proxy server sends the proxy updating instruction to the node server, so that the proxy management process in the node server acquires the updating file from the file server, further closes the current proxy process, and generates the updated proxy process according to the acquired updating file. In this manner, an automated full update agent process may be implemented in a cluster comprising at least one node server. Compared with the prior art, the method has the advantages that the updating speed is increased and the labor and time costs are saved through manual one-by-one updating.
In one possible design, further comprising: the node server receives an agent deleting instruction; the agent deleting instruction is sent by the agent server through the container management platform; and the node server deletes the agent container indicated by the agent deletion instruction through the container management platform.
By adopting the method, the agent server side can send the agent deleting instruction to the container management platform, so that the container management platform distributes the agent deleting instruction to at least one node server in the cluster, and the at least one node server deletes the agent container corresponding to the agent deleting instruction. Alternatively, the container management platform may monitor a condition such as an abnormal operating state of the proxy container of at least one node server, and send a proxy deletion instruction to the corresponding node server if the proxy container needs to be deleted. Therefore, automatic unloading of the agent process in the cluster is realized, and labor and time cost are saved.
In one possible design, the container image file is integrated through a proxy generic framework and a container generic framework.
By adopting the method, the universal framework of the agent and the universal framework of the container are integrated in the container mirror image file, so that the agent containers with different agent functions share one set of universal framework, and thus, only one set of container mirror image file of the universal framework needs to be stored in the mirror image server, so that when the agent container is generated by each subsequent node server, the container mirror image file is obtained, and the resource occupation is reduced.
In a second aspect, an embodiment of the present invention provides a method for deploying a proxy container, where the method includes:
the container management platform receives an agent generation instruction sent by an agent server; the container management platform sends a container generation instruction to a node server based on the agent generation instruction; the container generation instruction is used for instructing the node server to generate a proxy container; the proxy container is used for acquiring the corresponding application file from the file server based on the container generation instruction and configuring the application file to the proxy container.
By adopting the method, the container management platform receives the agent generation instruction sent by the agent server, generates the container generation instruction according to the agent generation instruction, and distributes the container generation instruction to each node server, so that each node server generates the agent container, and further the agent container acquires the corresponding application file from the file server according to the container generation instruction and configures the application file to the agent container. In this way, even if the operating systems, configurations, and the like of the node servers in the server cluster are different, the container generation instruction sent by the container management platform can be received, the corresponding proxy container can be generated according to the container generation instruction, and further, the proxy containers with different proxy functions can be generated according to the acquired application file. And realizing the automatic deployment of the agent container with the agent function in the server cluster. Saving manpower and time cost.
In one possible design, the container management platform sends a container generation instruction to a node server based on the agent generation instruction, where the container generation instruction includes: and the container management platform sends the container generation instruction to a container management platform interface through a custom controller based on the agent generation instruction, so that the node server receives the container generation instruction sent by the container management platform interface.
By adopting the method, the container management platform sends the container generation instruction to the container management platform interface through the custom controller based on the agent generation instruction. Therefore, the custom controller can define the container generation instruction as a format which can be received by the corresponding node servers of different operating systems or configurations and the like; the obstacle that corresponding node servers of different operating systems or configurations and the like all install the same proxy container is eliminated.
In one possible design, further comprising: the container management platform receives an agent deleting instruction; the proxy deleting instruction is sent by the proxy server; and the container management platform sends the agent deleting instruction to the node server, so that the node server deletes the agent container indicated by the agent deleting instruction.
By adopting the method, the container management platform receives the agent deleting instruction sent by the agent server and sends the agent deleting instruction to the at least one node server, so that the at least one node server automatically deletes the corresponding agent container according to the agent deleting instruction, and the labor cost and the time cost are reduced.
In a third aspect, an embodiment of the present invention provides a deployment apparatus for a proxy container, where the apparatus includes:
the processing module is used for generating a container management instance with a set proxy function based on a container generation instruction of the container management platform; the container generation instruction is triggered by the container management platform based on an agent generation instruction of an agent server; the agent generation instruction is used for instructing the node server to deploy a container with the set agent function;
the processing module is further configured to generate a proxy container based on the container management instance; the life cycle of the proxy container is managed by the container management platform;
and the acquisition module is used for acquiring the application file corresponding to the set proxy function from a file server based on the container management instance and configuring the application file to the proxy container, so that the proxy container has the set proxy function.
In a fourth aspect, an embodiment of the present invention provides an apparatus for deploying a proxy container, where the apparatus includes:
the receiving and sending module is used for receiving an agent generation instruction sent by the agent server;
the receiving and sending module is further used for sending a container generation instruction to the node server based on the agent generation instruction; the container generation instruction is used for instructing the node server to generate a proxy container; the proxy container is used for acquiring the corresponding application file from the file server based on the container generation instruction and configuring the application file to the proxy container.
In a fifth aspect, an embodiment of the present invention further provides a computing device, including: a memory for storing a computer program; a processor for calling the computer program stored in the memory and executing the method as described in the various possible designs of the first aspect, the second aspect according to the obtained program.
In a sixth aspect, the present invention further provides a computer-readable non-volatile storage medium, which includes a computer-readable program, and when the computer-readable program is read and executed by a computer, the computer is caused to execute the method described in the first and second aspects.
These and other implementations of the invention will be more readily understood from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a deployment method of a proxy container according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a node server according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a deployment method of a proxy container according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a container image file according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a deployment method of a proxy container according to an embodiment of the present invention;
fig. 6 is a flowchart illustrating a deployment method of a proxy container according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating a deployment method of a proxy container according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a deployment apparatus for a proxy container according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a deployment apparatus for a proxy container according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. 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.
As shown in the drawing, an architecture schematic diagram of a deployment method of an agent container provided in the embodiment of the present invention is shown in fig. 1, where an agent server 101 sends an agent generation instruction to a container management platform 102; the container management platform 102 receives an agent generation instruction and generates a container generation instruction according to the agent generation instruction, the container management platform 102 distributes the container generation instruction to a server cluster 105, and the server cluster 105 is composed of at least one node server 106; after receiving the container generation instruction, the node server 106 generates a container management instance according to the container generation instruction, acquires a container image file from the image server 104 according to the container management instance, and generates a proxy container according to the container image file, further, the node server 106 acquires an application file corresponding to the set proxy function from the file server 103 according to the container management instance, and configures the application file to the proxy container, thereby obtaining the proxy container with the set proxy function. The embodiment of the invention provides a schematic architecture diagram of a node server; as shown in fig. 2, after the container management instance is generated in the node server 106, a proxy container including a proxy management process is generated according to the acquired container image file, and a proxy process is generated according to the acquired application file corresponding to the set proxy function, so as to obtain a proxy container having the set proxy function. Thus, after the container management instance is generated in the node server 106, the proxy container including the proxy management process is generated according to the acquired container image file, and the proxy management process in the proxy container acquires the application file corresponding to the set proxy function from the file server 103 according to the container management instance in the node server 106, and generates the proxy process in the proxy container according to the application file.
Based on this, an embodiment of the present application provides a flow of a deployment method of a proxy container, as shown in fig. 3, including:
301, the node server generates a container management instance with a set proxy function based on a container generation instruction of the container management platform; the container generation instruction is triggered by the container management platform based on an agent generation instruction of an agent server; the agent generation instruction is used for instructing the node server to deploy a container with the set agent function;
here, the node server may be a node server in a server cluster that performs various tasks. For example, banking accounting and settlement services, which can process large amounts of data through a server cluster performing accounting and settlement tasks; thus, each node server in the server cluster needs to set a proxy container with accounting proxy function and a proxy container with settlement proxy function. The server cluster can be provided with an agent server for receiving a trigger instruction of a user to generate an agent generation instruction and converting the agent generation instruction into a form which can be received by a container management platform; the user can configure the relevant parameters of the proxy container at the proxy server side, so that the proxy generating instruction contains the relevant parameters, and further performs corresponding function limitation, function opening, proxy type determination and the like on the generated proxy container; e.g., relevant parameters that restrict the proxy container's access to host files. The container management platform can generate a container generation instruction according to the agent generation instruction, and distribute the container generation instruction to each node server in the server cluster, so that the node servers of different operating systems and different configurations can receive the container generation instruction, and the node servers generate a container management instance according to the container generation instruction, wherein the container management instance is used for deploying a container with a set agent function. As in the above example, the container management instance is used to deploy the agent container with accounting proxy function and set the agent container with settlement proxy function. In addition, when the conditions of high service operation pressure, service expansion and the like occur in the cluster and a node server needs to be added, a new node server is added into the cluster, and a container management instance is deployed in the new node server by the container management platform, so that the container management instance in the new node server can generate a proxy container by itself. When the service operation in the cluster does not need excessive node servers, or the node servers have faults and the like, and the node servers need to be removed, the container management example closes the proxy containers on the node servers. The closing of the agent container by the container management instance may be implemented by receiving an instruction of the container management platform, or presetting a corresponding program in the container management instance, and the implementation manner is not limited specifically herein.
Step 302, the node server generates a proxy container based on the container management instance; the life cycle of the proxy container is managed by the container management platform;
here, in the above example again, the life cycle of the agent container having the accounting proxy function and the agent container having the settlement proxy function is managed by the container management platform. For example, after the agent container with the accounting proxy function completes accounting work, the container management platform can turn off the agent container with the accounting proxy function in each node server in order to save server resources.
Step 303, the node server obtains an application file corresponding to the set proxy function from a file server based on the container management instance, and configures the application file to the proxy container, so that the proxy container has the set proxy function.
Here, in another example, generation of the agent container having the billing agent function requires acquiring an application file corresponding to the billing agent function; the generation of the proxy container having the settlement proxy function requires acquiring an application file corresponding to the settlement proxy function. The file server may provide application files corresponding to various proxy functions.
By adopting the method, the agent server generates an agent generation instruction and sends the agent generation instruction to the container management platform, the container management platform is triggered by the agent generation instruction to obtain a container generation instruction, and then the container generation instruction is distributed to each node server, so that each node server generates a container management instance with a set agent function. In this way, the container management instances in the respective node servers are made identical. Further, each node server generates a proxy container according to the container management instance, acquires an application file corresponding to a set proxy function from the file server, and configures the application file into the proxy container, so that the proxy container has the proxy function. Therefore, the automatic deployment of the agent process in each node server is realized through the agent server, the container management platform, the file server and each node server. And the container management platform can monitor the agent container and the operation state of the service process of the agent container, and manage the life cycle of the agent container. The automatic deployment and the running state monitoring of the business process are realized, the resource usage amount is saved, and the deployment cost is reduced.
The embodiment of the present application further provides a deployment method of a proxy container, that is, a node server generates a proxy container based on the container management instance, including: and the node server acquires a container mirror image file from a mirror image server based on the container management instance and generates the proxy container.
Here, an embodiment of the present invention provides a schematic structural diagram of a container image file; as shown in fig. 4, the structure of the container image file may be configured as an executable program, a configuration file, a tool \ class library, and a file system, for example, the executable program may be Agent BIN, the configuration file may be Agent conef, the tool \ class library may be Python \ java, and the file system may be Alpine Linux 3.11.2. The structure and hierarchy of the container image file are only an example and are not limited.
The embodiment of the present application provides another method for deploying an agent container, where before generating a container management instance having a set agent function, the method further includes: the node server receives the container generation instruction sent by a custom controller of the container management platform; the node server obtains a container mirror image file from a mirror image server based on the container management instance, and generates the proxy container, including: the container management instance of the node server acquires the container image file from the image server through a container engine Dockerd; and the container engine Dockerd of the node server generates the proxy container through the container image file.
Here, a custom controller may be installed in the container management platform, so that the container generation instruction is transmitted through the custom controller. The node server comprises a container engine Dockerd, and after the container management instance is generated, the container engine Dockerd is triggered to acquire a container image file. The trigger action may be generated by a component deployed on the node server by the container management platform, so that the proxy containers generated by the container engine Dockerd of each node server according to the container image file have the same operating environment.
The embodiment of the present application provides another method for deploying a proxy container, where a node server generates a proxy container based on the container management instance, and the method includes: the node server generates an agent container with an agent management process based on the container management instance; the node server obtains the application file corresponding to the set proxy function from a file server based on the container management instance, and the method comprises the following steps: the node server generates an agent container with an agent management process based on the container management instance, and acquires the application file from the file server through the agent management process; configuring the application file to the proxy container, including: and generating an agent process running in the agent container through the application file.
Here, as shown in fig. 2, the proxy container generated by the node server based on the container management instance includes a proxy management process, and the proxy management process acquires an application file including a corresponding proxy function file from the file server and configures the application file into the proxy container, so that the corresponding proxy process is generated in the proxy container. The agent management process may manage the operation of the agent process, for example, when the agent process is abnormal, the agent management process may actively turn off the abnormal agent process and pull up the normal corresponding agent process to ensure that the task of the node server is performed normally.
The embodiment of the present application provides an update method of a proxy process, where after configuring the application file to the proxy container, the method further includes: the node server receives an agent updating instruction, wherein the agent updating instruction is sent by the agent server; the node server acquires an update file corresponding to the agent update instruction from the file server through the agent management process; and the node server closes the agent process through the agent management process and generates an updated agent process according to the update file.
Here, after the agent container is deployed, when the agent process in the agent container has bug fixing, parameter configuration change, upgrading, and the like. The updated application file may be stored in the file server in place of the original application file. Therefore, the proxy server generates the proxy updating instruction to the proxy management process of the node server, the proxy management process can acquire the updating file corresponding to the proxy updating instruction, namely the updated application file, and close the current proxy process, and the updated proxy process is generated according to the acquired updated application file.
The embodiment of the application provides a method for deleting a proxy container, which comprises the following steps: the node server receives an agent deleting instruction; the agent deleting instruction is sent by the agent server through the container management platform; and the node server deletes the agent container indicated by the agent deletion instruction through the container management platform.
Here, the container management platform may be used to monitor the operating states of the agent container and the agent process, and to set rules for the generation and closing of the agent container and the agent process. When the running state of the agent container or the agent process is abnormal, the container management platform generates an agent deleting instruction to close the agent container or the agent process. Or, the container management platform sets rules as follows: the occupied resource of the agent container or the agent process must not exceed one percent of the CPU resource of the node server; if the resource usage is exceeded, the container management platform generates an agent deleting instruction to close the agent container or the agent process. Here, the agent deletion instruction of the container management platform may also be triggered by the agent server, and the agent deletion instruction of the agent server may also be triggered by the user. Here, the trigger source of the proxy deletion instruction is not particularly limited.
The embodiment of the application provides an integration method of a container image file, namely, the container image file is integrated through a proxy general framework and a container general framework.
Based on this, an embodiment of the present application provides a flow of a deployment method of a proxy container, as shown in fig. 5, including:
step 501, a container management platform receives an agent generation instruction sent by an agent server;
step 502, the container management platform sends a container generation instruction to a node server based on the agent generation instruction; the container generation instruction is used for instructing the node server to generate a proxy container; the proxy container is used for acquiring the corresponding application file from the file server based on the container generation instruction and configuring the application file to the proxy container.
Here, with the above method, the container management platform receives an agent generation instruction sent by the agent server, generates a container generation instruction according to the agent generation instruction, and distributes the container generation instruction to each node server, so that each node server generates an agent container, and further, the agent container acquires a corresponding application file from the file server according to the container generation instruction, and configures the application file to the agent container. In this way, even if the operating systems, configurations, and the like of the node servers in the server cluster are different, the container generation instruction sent by the container management platform can be received, the corresponding proxy container can be generated according to the container generation instruction, and further, the proxy containers with different proxy functions can be generated according to the acquired application file. And realizing the automatic deployment of the agent container with the agent function in the server cluster. Saving manpower and time cost.
The embodiment of the application provides a flow of a deployment method of an agent container, wherein the container management platform sends a container generation instruction to a node server based on the agent generation instruction, and the method comprises the following steps: and the container management platform sends the container generation instruction to a container management platform interface through a custom controller based on the agent generation instruction, so that the node server receives the container generation instruction sent by the container management platform interface.
The user-defined controller receives the agent generation instruction, generates a container generation instruction and sends the container generation instruction to the container management platform interface; and enabling the container management platform interface to send the container generation instruction to the component, wherein the container management platform is deployed on the node server.
Based on the above flow, an embodiment of the present application provides a flow of another deployment method for a proxy container, where for example, the container management platform may be a platform where a Kubernetes application is located, a component of the container management platform, which is deployed on a node server, is a Kubelet, the custom Controller may be a Daemon Controller, an interface of the container management platform may be a Kube-api server, and an instance of the container management may be Daemon Pod. As shown in fig. 6, includes:
step 601, the user triggers the proxy server through the user entrance.
Step 602, the proxy server generates a proxy generation instruction according to the trigger instruction of the user and the local configuration rule.
And step 603, the proxy server sends the proxy generation instruction to Kubernets, and the Kubernets generate a container generation instruction through a DaemonController and send the container generation instruction to each node server through a Kube-apiserver.
Step 604, each node server receives the container generation instruction through a Kubelet to obtain a Daemon Pod, the Kubelet sends a container Runtime Interface to a container engine Dockerd, and the container engine Dockerd is triggered to obtain a container image file.
Step 605, each node server generates an Agent container according to the acquired container image file and according to a container general frame and an Agent general frame in the container image file, where the Agent general frame includes an Agent manager (Agent management process).
Step 606, the Agent manager obtains the application file of the Agent process corresponding to the Agent generation instruction from the file server.
Step 607, the Agent manager configures the acquired application file of the corresponding Agent process into an Agent container, and acquires the Agent container with the setting function.
Based on the flow of fig. 6, an embodiment of the present application provides a flow of a method for updating a proxy, as shown in fig. 7, including:
step 701, if the user confirms that the agent process needs to be upgraded, storing the upgraded update file in the file server, and triggering the agent server to generate an agent update instruction.
Step 702, after the agent server generates an agent update instruction, the agent update instruction is sent to the node server.
And step 703, after the Agent manager corresponding to the Agent update instruction in the node server receives the Agent update instruction, acquiring the update file from the file server.
Step 704, Agent manager closes the current Agent process.
Step 705, the Agent manager configures the update file into an Agent container to generate an updated Agent process.
It should be noted that the above-mentioned flow sequence is not exclusive, and step 703 of the flow shown in fig. 7 may be executed after step 704.
In addition, the application also provides a container mirror image file integration method; that is, a warehouse management system, e.g., Gitlab, is provided. The source file of the container image file is stored in the Gitlab. An operating system, such as Jenkins, is provided. A polling code update task is defined in Jenkins. A persistent integration system, e.g., Docker composite, is provided. And after receiving the code update notified by the polling code update task, integrating the source file codes of the updated container image files in the Gitlab to generate the container image files comprising the container general frame and the agent general frame.
The application also provides a method for testing and publishing the agent container, namely, a test cluster is a cluster simulating a production environment, and the method comprises the following steps: the system comprises an agent server, a file server, a mirror image server, each node server and a container management platform. And testing whether the integrated container image file can be normally applied or not by the automatic regression testing mode, and respectively sending the container image file and the application file to the image server and the file server of the production environment after determining that the container image file and the application file can be normally applied so as to carry out production application.
The present application also provides a method for monitoring a system, that is, a monitoring system can be set to monitor key indexes of an agent container, an agent process, a node server, and the like, for example: CPU, memory, network throughput, bandwidth occupation, disk I \ O, disk usage, proxy process state, etc. The monitoring system may include a time-series database, an alarm system, an interface display, etc., for example, the time-series database, the alarm system, the interface display may be Prometheus (for collecting monitoring data, acting as a time-series database), alert manager (for managing alarms, configuring alarm policies), and Grafana (for providing an interface through which data is displayed), respectively.
Based on the same concept, an embodiment of the present invention provides a deployment apparatus for a proxy container, and fig. 8 is a schematic diagram of the deployment apparatus for a proxy container provided in the embodiment of the present application, as shown in fig. 8, including:
a processing module 801, configured to generate a container management instance having a set proxy function based on a container generation instruction of a container management platform; the container generation instruction is triggered by the container management platform based on an agent generation instruction of an agent server; the agent generation instruction is used for instructing the node server to deploy a container with the set agent function;
the processing module 801 is further configured to generate a proxy container based on the container management instance; the life cycle of the proxy container is managed by the container management platform;
an obtaining module 802, configured to obtain, based on the container management instance, an application file corresponding to the set proxy function from a file server, and configure the application file to the proxy container, so that the proxy container has the set proxy function.
In one possible design, the processing module 801 is specifically configured to: and acquiring a container mirror image file from a mirror image server based on the container management example, and generating the proxy container.
In one possible design, the processing module 801 is further configured to: receiving the container generation instruction sent by a custom controller of the container management platform; the node server obtains a container mirror image file from a mirror image server based on the container management instance, and generates the proxy container, including: the container management instance of the node server acquires the container image file from the image server through a container engine Dockerd; and the container engine Dockerd of the node server generates the proxy container through the container image file.
In one possible design, the processing module 801 is specifically configured to: the node server generates an agent container with an agent management process based on the container management instance; the node server obtains the application file corresponding to the set proxy function from a file server based on the container management instance, and the method comprises the following steps: the node server generates an agent container with an agent management process based on the container management instance, and acquires the application file from the file server through the agent management process; configuring the application file to the proxy container, including: and generating an agent process running in the agent container through the application file.
In one possible design, the processing module 801 is further configured to: receiving an agent updating instruction, wherein the agent updating instruction is sent by the agent server; the node server acquires an update file corresponding to the agent update instruction from the file server through the agent management process; and the node server closes the agent process through the agent management process and generates an updated agent process according to the update file.
In one possible design, the processing module 801 is further configured to: receiving an agent deleting instruction; the agent deleting instruction is sent by the agent server through the container management platform; and the node server deletes the agent container indicated by the agent deletion instruction through the container management platform.
In one possible design, the container image file is integrated through a proxy generic framework and a container generic framework.
Based on the same concept, an embodiment of the present invention provides a deployment apparatus for a proxy container, and fig. 9 is a schematic diagram of the deployment apparatus for a proxy container provided in the embodiment of the present application, as shown in fig. 9, including:
a transceiver module 901, configured to receive an agent generation instruction sent by an agent server;
the transceiver module 901 is further configured to send a container generation instruction to the node server based on the agent generation instruction; the container generation instruction is used for instructing the node server to generate a proxy container; the proxy container is used for acquiring the corresponding application file from the file server based on the container generation instruction and configuring the application file to the proxy container.
In one possible design, the transceiver module 901 is specifically configured to: and sending the container generation instruction to a container management platform interface through a custom controller based on the agent generation instruction, so that the node server receives the container generation instruction sent by the container management platform interface.
In one possible design, the transceiver module 901 is further configured to: receiving an agent deleting instruction; the proxy deleting instruction is sent by the proxy server; and the container management platform sends the agent deleting instruction to the node server, so that the node server deletes the agent container indicated by the agent deleting instruction.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (14)

1. A method for deploying a proxy container, the method comprising:
the node server generates a container management instance with a set proxy function based on a container generation instruction of the container management platform; the container generation instruction is triggered by the container management platform based on an agent generation instruction of an agent server; the agent generation instruction is used for instructing the node server to deploy a container with the set agent function;
the node server generates a proxy container based on the container management instance; the life cycle of the proxy container is managed by the container management platform;
and the node server acquires an application file corresponding to the set proxy function from a file server based on the container management instance, and configures the application file to the proxy container, so that the proxy container has the set proxy function.
2. The method of claim 1, wherein a node server generates a proxy container based on the container management instance, comprising:
and the node server acquires a container mirror image file from a mirror image server based on the container management instance and generates the proxy container.
3. The method of claim 2, wherein prior to generating the container management instance with the set proxy function, further comprising:
the node server receives the container generation instruction sent by a custom controller of the container management platform;
the node server obtains a container mirror image file from a mirror image server based on the container management instance, and generates the proxy container, including:
the container management instance of the node server acquires the container image file from the image server through a container engine Dockerd;
and the container engine Dockerd of the node server generates the proxy container through the container image file.
4. The method of claim 1, wherein a node server generates a proxy container based on the container management instance, comprising:
the node server generates an agent container with an agent management process based on the container management instance;
the node server obtains the application file corresponding to the set proxy function from a file server based on the container management instance, and the method comprises the following steps:
the node server generates an agent container with an agent management process based on the container management instance, and acquires the application file from the file server through the agent management process;
configuring the application file to the proxy container, including:
and generating an agent process running in the agent container through the application file.
5. The method of claim 4, wherein after configuring the application file to the proxy container, further comprising:
the node server receives an agent updating instruction, wherein the agent updating instruction is sent by the agent server;
the node server acquires an update file corresponding to the agent update instruction from the file server through the agent management process;
and the node server closes the agent process through the agent management process and generates an updated agent process according to the update file.
6. The method of any of claims 1-5, further comprising:
the node server receives an agent deleting instruction; the agent deleting instruction is sent by the agent server through the container management platform;
and the node server deletes the agent container indicated by the agent deletion instruction through the container management platform.
7. The method of claim 6, wherein the container image file is integrated through a proxy generic framework and a container generic framework.
8. A method for deploying a proxy container, the method comprising:
the container management platform receives an agent generation instruction sent by an agent server;
the container management platform sends a container generation instruction to a node server based on the agent generation instruction; the container generation instruction is used for instructing the node server to generate a proxy container; the proxy container is used for acquiring the corresponding application file from the file server based on the container generation instruction and configuring the application file to the proxy container.
9. The method of claim 8, wherein the container management platform sends container generation instructions to a node server based on the agent generation instructions, comprising:
and the container management platform sends the container generation instruction to a container management platform interface through a custom controller based on the agent generation instruction, so that the node server receives the container generation instruction sent by the container management platform interface.
10. The method of any of claims 8 and 9, further comprising:
the container management platform receives an agent deleting instruction; the proxy deleting instruction is sent by the proxy server;
and the container management platform sends the agent deleting instruction to the node server, so that the node server deletes the agent container indicated by the agent deleting instruction.
11. An agent container deployment apparatus, the apparatus comprising:
the processing module is used for generating a container management instance with a set proxy function based on a container generation instruction of the container management platform; the container generation instruction is triggered by the container management platform based on an agent generation instruction of an agent server; the agent generation instruction is used for instructing the node server to deploy a container with the set agent function;
the processing module is further configured to generate a proxy container based on the container management instance; the life cycle of the proxy container is managed by the container management platform;
and the acquisition module is used for acquiring the application file corresponding to the set proxy function from a file server based on the container management instance and configuring the application file to the proxy container, so that the proxy container has the set proxy function.
12. An agent container deployment apparatus, the apparatus comprising:
the receiving and sending module is used for receiving an agent generation instruction sent by the agent server;
the receiving and sending module is further used for sending a container generation instruction to the node server based on the agent generation instruction; the container generation instruction is used for instructing the node server to generate a proxy container; the proxy container is used for acquiring the corresponding application file from the file server based on the container generation instruction and configuring the application file to the proxy container.
13. A computer-readable storage medium, characterized in that the storage medium stores a program which, when run on a computer, causes the computer to carry out the method of any one of claims 1 to 7 or 8-10.
14. A computer device, comprising:
a memory for storing a computer program;
a processor for calling a computer program stored in said memory to execute the method of any of claims 1 to 7 or 8 to 10 in accordance with the obtained program.
CN202010501424.1A 2020-06-04 2020-06-04 Deployment method and device of agent container Pending CN111679888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010501424.1A CN111679888A (en) 2020-06-04 2020-06-04 Deployment method and device of agent container

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010501424.1A CN111679888A (en) 2020-06-04 2020-06-04 Deployment method and device of agent container

Publications (1)

Publication Number Publication Date
CN111679888A true CN111679888A (en) 2020-09-18

Family

ID=72434900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010501424.1A Pending CN111679888A (en) 2020-06-04 2020-06-04 Deployment method and device of agent container

Country Status (1)

Country Link
CN (1) CN111679888A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153049A (en) * 2020-09-24 2020-12-29 绿盟科技集团股份有限公司 Intrusion detection method and device
CN112328372A (en) * 2020-11-27 2021-02-05 新华智云科技有限公司 Kubernetes node self-healing method and system
CN113138834A (en) * 2021-03-19 2021-07-20 中国电子科技集团公司第二十九研究所 Cloud simulation platform lightweight deployment method based on Docker technology
CN115150291A (en) * 2022-07-05 2022-10-04 中国银行股份有限公司 Operation and maintenance system and method based on event driving

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153049A (en) * 2020-09-24 2020-12-29 绿盟科技集团股份有限公司 Intrusion detection method and device
CN112153049B (en) * 2020-09-24 2023-01-17 绿盟科技集团股份有限公司 Intrusion detection method, device, electronic equipment and computer readable medium
CN112328372A (en) * 2020-11-27 2021-02-05 新华智云科技有限公司 Kubernetes node self-healing method and system
CN113138834A (en) * 2021-03-19 2021-07-20 中国电子科技集团公司第二十九研究所 Cloud simulation platform lightweight deployment method based on Docker technology
CN115150291A (en) * 2022-07-05 2022-10-04 中国银行股份有限公司 Operation and maintenance system and method based on event driving

Similar Documents

Publication Publication Date Title
US11121921B2 (en) Dynamic auto-configuration of multi-tenant PaaS components
CN111679888A (en) Deployment method and device of agent container
US9253265B2 (en) Hot pluggable extensions for access management system
CN110196731B (en) Operation and maintenance system, method and storage medium
WO2019062304A1 (en) Method, device and system for managing computing resources of block chain node
EP3821337B1 (en) Methods and apparatus for safe and smart distribution of software patches
CN112269640B (en) Method for realizing life cycle management of container cloud component
US11762763B2 (en) Orchestration for automated performance testing
CN104021078B (en) Software supervision device and method
WO2021022713A1 (en) Distributed module update method, device, and storage medium
KR20100027104A (en) Method, system and computer program for configuring firewalls
CN111045854A (en) Method, apparatus and computer program product for managing service containers
CN115061717A (en) Application management method, application subscription method and related equipment
CN112860282A (en) Upgrading method and device of cluster plug-in and server
CN114527996A (en) Multi-service deployment method and device, electronic equipment and storage medium
CN115016820A (en) Application program updating method, device, equipment and storage medium
CN111712795A (en) Method, apparatus, computer program product and readable medium for evaluating application deployment
CN111897565A (en) Data processing method, device and equipment based on Internet of things
CN113590178B (en) API instance management method and device, storage medium and electronic equipment
CN113515293B (en) Method and system for managing DevOps toolchain
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN112905306A (en) Multi-cluster container management method and device, electronic equipment and storage medium
CN114189439A (en) Automatic capacity expansion method and device
CN112817827A (en) Operation and maintenance method, device, server, equipment, system and medium
CN104657168A (en) Client side and method for upgrading client side

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