A container network visualization management method and system
By introducing visual management methods and systems into container networks, the problem of inability to intuitively display container relationships and lack of network topology display in the prior art is solved, and high observability and visibility of container networks are achieved.
Patent Information
- Application Number
- CN202111647726.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-12-30
AI Technical Summary
Existing container network solutions cannot visually display the relationship between containers, cannot intervene in the network of a single container, and lack the display of network topology.
Provides a management method and system for visualizing container networks, by receiving and executing actions, monitoring and updating container attribute information, collecting network link information, and drawing this information into a relationship diagram and displaying it to users.
It realizes the intuitive display of the container network, improves the observability and visibility of the container network, supports selective operations on the container, and enables exception judgment.
Smart Images

Figure CN114490497B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of container management, and in particular to a container network visualized management method and system. Background Art
[0002] In the process of departmental projects migrating to containers, more and more projects need to be migrated to containerized platforms. Containerized services need to rely on container networks to provide services. The current container network solutions only solve the problem of connectivity, and do not pay attention to the topological structure and maintenance convenience of the container network. Based on this background, this system is designed to solve the problem that the container network has no graphical display, the operation status of the container network cannot be intuitively seen, and individual special containers cannot be intervened.
[0003] In the process of implementing the present invention, the applicant discovered that there are at least the following problems in the prior art:
[0004] Existing container network solutions do not show the relationship between containers, the relationship between containers and external networks, and the relationship between external networks and containers, and cannot intervene in the network of a single container. Summary of the invention
[0005] The embodiments of the present invention provide a method and system for visually managing a container network, which can intuitively display the relationship between containers.
[0006] To achieve the above-mentioned purpose, on the one hand, an embodiment of the present invention provides a method for managing a container network visualization, including:
[0007] Receiving an action to be performed on a kubernetes cluster and a specified client agent name for performing the action, and sending a command in the action to be performed to the agent for performing the action, wherein the command is used to control a network of a container in the kubernetes cluster; wherein the action includes at least one command;
[0008] The agent executing the action communicates with the kubernetes cluster where the agent is located, executes the command in the action in the kubernetes cluster where the agent is located through the agent, and notifies the control center of the result obtained by the agent executing the command in the action; wherein the agent is set on a container in the kubernetes cluster and a container is provided with a unique agent;
[0009] The control center determines at least one target agent that monitors attribute information changes of the container where the agent is located and collects network link information of the container where the agent is located according to the results obtained by executing the commands in the actions of each agent;
[0010] Each target agent determined by the control center monitors the changes of the attribute information of the container where it is located and updates the attribute information of the container where it is located in a timely manner. The attribute information of the container includes: the IP address of the container;
[0011] Each target agnet determined by the control center collects network link information of the container in which it is located; the network link information of the container includes: the IP address that establishes a link with the container to access the container, and the IP addresses of other containers that the container is linked to access;
[0012] With respect to the attribute information of each container in each Kubernetes cluster and the network connection information of each container, the IP addresses of all containers in each Kubernetes cluster are drawn into the same relationship graph, and the access relationship from the IP address of one container to the IP address of another container is represented in the relationship graph by a connection with an indicated direction; the relationship graph is displayed to the user.
[0013] On the other hand, an embodiment of the present invention provides a management system for container network visualization, including:
[0014] An action acquisition unit, used to receive an action to be performed on a kubernetes cluster and a specified client agent name for performing the action, and send a command in the action to be performed to the agent for performing the action, wherein the command is used to control the network of the container in the kubernetes cluster; wherein the action includes at least one command;
[0015] The client agent is used to communicate with the Kubernetes cluster where the agent is located, execute the commands in the action in the Kubernetes cluster where the agent is located, and notify the control center of the results of executing the commands in the action; wherein the agent is set on the container in the Kubernetes cluster and one container is equipped with a unique agent;
[0016] The control center is used to determine at least one target agent for monitoring attribute information changes of the container where the agent is located and collecting network link information of the container where the agent is located according to the results obtained by executing the commands in the actions of each agent;
[0017] Each target agent determined by the control center is used to monitor the changes of the attribute information of the container in which it is located and to update the attribute information of the container in time. The attribute information of the container includes: the IP address of the container; and
[0018] Collect network link information of each container; the network link information of the container includes: the IP address of the container that is linked to the container to access the container, and the IP addresses of other containers that the container is linked to access;
[0019] The display unit is used for drawing the IP addresses of all containers in each Kubernetes cluster into the same relationship graph according to the attribute information of each container in each Kubernetes cluster and the network link information of each container, and representing the access relationship from the IP address of one container to the IP address of another container in the relationship graph through a connection with an indicated direction; and displaying the relationship graph to the user.
[0020] The above technical solution has the following beneficial effects: it can intuitively display the relationship between containers. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a flow chart of a method for visualizing a container network according to an embodiment of the present invention;
[0023] Figure 2 This is a structural diagram of a container network visualization management system according to an embodiment of the present invention;
[0024] Figure 3 The present invention is a flowchart of another method for managing a container network visualization according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] like Figure 1 As shown, in combination with an embodiment of the present invention, a method for managing a container network visualization is provided, including:
[0027] S101: receiving an action to be performed on a kubernetes cluster and a specified client agent name for performing the action, and sending a command in the action to be performed to the agent for performing the action, wherein the command is used to control a network of a container in the kubernetes cluster; wherein the action includes at least one command;
[0028] S102: the agent executing the action communicates with the kubernetes cluster where the agent is located, executes the command in the action in the kubernetes cluster where the agent is located through the agent, and notifies the control center of the result obtained by the agent executing the command in the action; wherein the agent is set on a container in the kubernetes cluster and a container is provided with a unique agent;
[0029] S103: The control center determines at least one target agent that monitors attribute information changes of the container where the agent is located and collects network link information of the container where the agent is located according to the results obtained by executing the commands in the actions of each agent;
[0030] S104: each target agent determined by the control center monitors the change of the attribute information of the container where it is located and updates the attribute information of the container where it is located in a timely manner, wherein the attribute information of the container includes: the IP address of the container;
[0031] S105: Each target agnet determined by the control center collects network link information of the container in which it is located; the network link information of the container includes: an IP address that establishes a link with the container to access the container, and IP addresses of other containers that the container is linked to access;
[0032] S106: With respect to the attribute information of each container in each Kubernetes cluster and the network connection information of each container, the IP addresses of all containers in each Kubernetes cluster are drawn into the same relationship graph, and the access relationship from the IP address of one container to the IP address of another container is represented in the relationship graph by a connection with an indicated direction; the relationship graph is displayed to the user.
[0033] Preferably, the network link information of the container also includes: the bandwidth consumed by each container IP address accessing the container;
[0034] The method for managing container network visualization further includes:
[0035] S107: Identify in the relationship graph whether the IP address of one container is successfully linked to the IP address of another container, and display in the relationship graph the bandwidth consumed by the IP address of one container accessing the IP address of another container.
[0036] Preferably, after each target agent determined by the control center monitors the change of the attribute information of the container where it is located and updates the attribute information of the container in time, it also includes:
[0037] S108: Obtain and save the attribute information of each container collected by the target agent through the first time series database component deployed in the kubernetes cluster; wherein the attribute information of the container also includes: the running status of the container; obtain and save the attribute information of each container in the kubernetes cluster collected by the first time series database component through the second time series database component deployed outside the kubernetes cluster; the relationship diagram is drawn based on the attribute information of each container obtained by the second time series database component.
[0038] Preferably, a client kubelet is provided on the node in the Kubernetes cluster;
[0039] The method further comprises:
[0040] S109: After the agent completes executing the command in the action, the agent requests the client kubelet to report the result of executing the command to the kubernetes cluster, and the result of executing the command is used by the kubernetes cluster to take corresponding measures accordingly.
[0041] Preferably, it also includes:
[0042] S110: The client kubelet performs a health check on the container in its Kubernetes cluster. If the check fails, the container is restarted and the health check on the container is deleted.
[0043] In combination with an embodiment of the present invention, a container network visualization management system is provided, including:
[0044] An action acquisition unit 21 is used to receive an action to be performed on a kubernetes cluster and a specified client agent name for performing the action, and send a command in the action to be performed to the agent for performing the action, wherein the command is used to control the network of the container in the kubernetes cluster; wherein the action includes at least one command;
[0045] The client agent 22 is used to communicate with the Kubernetes cluster where the agent is located, execute the commands in the action in the Kubernetes cluster where the agent is located, and notify the control center of the results obtained by executing the commands in the action; wherein the agent is set on the container in the Kubernetes cluster and one container is provided with a unique agent;
[0046] The control center 23 is used to determine at least one target agent that monitors attribute information changes of the container where the agent is located and collects network link information of the container where the agent is located according to the results obtained by executing the commands in the actions;
[0047] Each target agent 22 determined by the control center is used to monitor the changes of the attribute information of the container in which it is located and to update the attribute information of the container in time. The attribute information of the container includes: the IP address of the container; and
[0048] Collect network link information of each container; the network link information of the container includes: the IP address of the container that is linked to the container to access the container, and the IP addresses of other containers that the container is linked to access;
[0049] The display unit 24 is used to draw the IP addresses of all containers in each Kubernetes cluster into the same relationship graph based on the attribute information of each container in each Kubernetes cluster and the network link information of each container, and to represent the access relationship from the IP address of one container to the IP address of another container in the relationship graph through a connection with an indicated direction; and to display the relationship graph to the user.
[0050] Preferably, the network link information of the container also includes: the bandwidth consumed by each container IP address accessing the container;
[0051] The display unit 24 is further used to identify in the relationship diagram whether the IP address of one container is successfully linked to the IP address of another container, and to display in the relationship diagram the bandwidth consumed by the IP address of one container accessing the IP address of another container.
[0052] Preferably, it also includes:
[0053] The first time series database component 25 deployed in the kubernetes cluster is used to obtain and save the attribute information of each container collected by the target agent after each target agent determined by the control center monitors the attribute information changes of the respective containers and updates the attribute information of the respective containers in a timely manner; wherein the attribute information of the container also includes: the running status of the container;
[0054] The second time series database component 26 deployed outside the kubernetes cluster is used to obtain and save the attribute information of each container in the kubernetes cluster collected by the first time series database component; the relationship diagram is drawn based on the attribute information of each container obtained by the second time series database component.
[0055] Preferably, a client kubelet 27 is provided on the node in the Kubernetes cluster;
[0056] The client agent 22 is also used to request the client kubelet to report the result of executing the command to the kubernetes cluster after the command in the action is executed in the kubernetes cluster;
[0057] The client kubelet 27 is used to receive a request sent by the agent to report the result of executing a command to the kubernetes cluster, and the result of executing the command is used by the kubernetes cluster to take corresponding measures accordingly.
[0058] Preferably, the client kubelet 27 is also used to perform a health check on the container in the kubernetes cluster where it is located, restart the container when the check fails, and delete the health check on the container.
[0059] The above technical solution of the embodiment of the present invention is described in detail below in conjunction with specific application examples. For technical details not introduced during the implementation process, please refer to the relevant description in the previous text.
[0060] The beneficial effects achieved by the present invention are as follows:
[0061] 1. Intuitively display the status of the container network, greatly improving the observability and visibility of the container network.
[0062] 2. Abnormality judgment can be performed on complex container networks.
[0063] 3. Ability to selectively operate containers.
[0064] The key words and technical abbreviations involved in the present invention are explained as follows:
[0065] Kubernetes: A container orchestration management tool.
[0066] Pod: The smallest scheduling unit of Kubernetes, containing one or more containers.
[0067] Container: A container image is a lightweight, independent executable package of software that contains everything needed to run it: code, runtime, system tools, system libraries, settings, etc. A container is the running state of a program in a container image.
[0068] Prometheus: A time series database that can collect data from a kubernetes cluster and another prometheus.
[0069] Container cloud computing kubernetes orchestration
[0070] The present invention is a method and system for managing container network visualization. The system includes multiple components, each of which is responsible for a part of the function. The container network is visualized, and the relationship between containers, the relationship between containers and external networks, and the relationship between external networks and containers are graphically displayed; users are supported to operate containers.
[0071] The technical problems to be solved by the present invention include:
[0072] 1. Solve the problem that container networks cannot be displayed intuitively;
[0073] 2. The problem of being unable to intervene in the container network;
[0074] 3. The network topology cannot be displayed.
[0075] like Figure 3 As shown:
[0076] 1. Control Center: The control center is the core control unit of this system, and all operations of this system are communicated by the control center. User communication is the communication between the user data center and the agent. When the user operation module wants to perform some actions on the container, the action operation (the action operation is the action) will be sent to the control center. The control center receives the action to be performed on the kubernetes cluster and the name of the client agent specified to perform the action, and sends the command in the action to be performed to the agent that performs the action. The command is used to control the network of the container in the kubernetes cluster; wherein, the action includes at least one command.
[0077] According to the action specified by the user (i.e., action) and the client agent to be operated, the control center initiates the command in the action to be operated to the agent to be operated, and the action includes at least one command; Figure 1 As shown in step 1, the agent executes the corresponding commands according to the commands initiated by the control center.
[0078] The commands executed by the Agent include:
[0079] 1.1 Delete an IP address in the agent, which is used to access the container where the agent is located;
[0080] 1.2 Prohibit the IP address of a container from accessing the external network outside the container where the agent is located;
[0081] 1.3 Prohibit a certain IP address (IP address refers to any address except the container IP address) from accessing the local network;
[0082] 1.4 It is forbidden to assign IP addresses;
[0083] 1.5 Configure the network bandwidth limit used by the IP address (the container's IP address).
[0084] Next, the control center determines at least one target agent that monitors changes in the attribute information of the container where the agent is located and collects network link information of the container where the agent is located according to the results obtained by executing the commands in the actions of each agent.
[0085] 2. Agent client:
[0086] The agent client is the core execution unit of this system. The agent that executes the action communicates with the Kubernetes cluster where the agent is located. The agent executes the commands in the action in the Kubernetes cluster where the agent is located (executes the action issued by the control center) and feeds back to the control center whether the execution result is successful.
[0087] Each target agent determined by the control center monitors the changes in the attribute information of the container in which it is located and updates the attribute information of the container in time. The attribute information of the container includes: the IP address of the container. That is, the agent client will monitor the changes of the local container (referring to the container where the agent client is located, and there is only one agent in a container) and obtain the attribute information of the container. The attributes include the number of CPUs used, the amount of memory, the running status of the container, the IP address, etc.
[0088] Each target agnet determined by the control center collects the network link information of the container where it is located; the network link information of the container includes: the IP address that establishes a link with the container to access the container, and the IP addresses of other containers that the container is linked to access. In other words, the agnet client will calculate how much bandwidth the IP address (the IP address of the container where the agnet is located) consumes, and count which IP addresses have established links, etc. (This section is the agent collecting the network link information of the container).
[0089] The agent client communicates with the kubernetes cluster (a kubernetes cluster can contain multiple containers) (mainly with the kubernetes kubelet) such as Figure 3 As shown in step 2.
[0090] For example, if the agent client wants to delete an IP address, it will ask the kubelet to report to the kubernetes cluster that the IP address is no longer available and notify the kubernetes cluster to schedule the container and pod to which the IP address belongs to other places. For example, if the agent client finds that the usage exceeds the limit, the action is the same as above.
[0091] The agent is set in a container and a container is provided with a unique agent, and the container is set in a kubernetes cluster.
[0092] 3. Kubernetes container management and orchestration platform
[0093] This component is open source and is a container management and orchestration platform. Kubernetes will assign IP addresses to containers, and further, assign IP addresses to pods; pods are the smallest scheduling unit of Kubernetes. A pod can contain more than one container; many containers will share an IP address.
[0094] like Figure 1 As shown in step 3, the promehteus component (the second time series database component, deployed outside the kubernetes cluster) will be configured to collect container information of the kubernetes cluster, such as the running status of the container. In this system, the main focus is on the IP address of the container and the running status of the container, whether it is running or not. kubernetes is a set of software, and the smallest unit managed by this software is pod. A pod contains more than one container, which is logically an indirect management container of kubernetes.
[0095] Kubernetes has a component called kubelet, which is located on the node. After the agent completes the execution of the command in the action, the agent requests the client kubelet to report the results of the command execution to the Kubernetes cluster, and the results of the command execution are used by the Kubernetes cluster to take corresponding measures.
[0096] Kubelet actually operates the container. Kubelet receives instructions to operate the container from Kubernetes or Kubelet itself performs a health check on the container. If the check fails, the container will be restarted and deleted (the health check on the container will be deleted).
[0097] 4. Prometheus data collection component
[0098] As shown in step 4:
[0099] Prometheus is an open source data collection component that can be configured to dynamically collect Prometheus container information. In this step, there are two Prometheus, one of which is deployed in the Kubernetes cluster (i.e., the first time series database component) to collect information about the Kubernetes cluster and containers. The other is deployed outside the Kubernetes cluster (i.e., the second time series database component) and is used in conjunction with the first Prometheus in the cluster to push container data outside the Kubernetes cluster. That is:
[0100] The attribute information of each container collected by the target agent is obtained and saved through a first time series database component deployed in a kubernetes cluster; wherein the attribute information of the container also includes: the running status of the container; the attribute information of each container in the kubernetes cluster collected by the first time series database component is obtained and saved through a second time series database component deployed outside the kubernetes cluster; the relationship diagram is drawn based on the attribute information of each container obtained by the second time series database component.
[0101] 5. Data Storage Center
[0102] As shown in step 5:
[0103] The control center receives feedback from the agent on the results of executing commands and writes the data to the data storage center for users to obtain the results of command execution.
[0104] Receive the network link information of the container collected by the agent and report it to the control center.
[0105] Information on the web link includes:
[0106] 1) Which IP addresses are linked to the container? The IP here refers to the service of my container. Which IP addresses are accessing me?
[0107] 2) Which IP addresses are the containers connected to? That is, who is the IP address of my container connected to? The reason is that in the TCP / IP protocol, a connection consists of four parts: source IP address, source port, destination IP address, and destination port. The container needs to provide services to others and also needs to access others.
[0108] 3) What is the current network bandwidth consumed?
[0109] As shown in step 6:
[0110] Prometheus stores the acquired container data in the data storage center, letting users know which containers there are and their attribute data. Combined with the control center's operation command results on the container (agnet and the control center are bidirectional), it returns a comprehensive result to the user.
[0111] 6. Display module (display unit)
[0112] With respect to the attribute information of each container in each kubernetes cluster and the network connection information of each container, the IP addresses of all containers in each kubernetes cluster are drawn into the same relationship graph, and the access relationship from the IP address of one container to the IP address of another container is represented by a connection with an indicated direction in the relationship graph; the relationship graph is displayed to the user. In the relationship graph, it is indicated whether the IP address of one container is successfully linked to the IP address of another container, and the bandwidth consumed by the IP address of one container accessing the IP address of another container is displayed in the relationship graph.
[0113] Specifically, Figure 3 As shown in step 7, the display module is a module that ultimately displays the container network topology. It obtains container information and container link information from the data storage center, and draws a point-to-point (points represent container IPs) (containers can be containers in different Kubernetes clusters) relationship diagram. In this way, you can intuitively see the information from one IP address to another IP address, forming a directional line graph, and displaying the bandwidth consumption between IPs (how much data is sent and received from IP1 to IP2), and the connectivity between IPs (whether IP1 is successfully connected to IP2).
[0114] 7. User operation module
[0115] Based on the display module graphics and the data from the data storage center, the user can decide to operate those containers that are considered abnormal and send commands to the control center.
[0116] The beneficial effects achieved by the present invention are as follows:
[0117] 1. Intuitively display the status of the container network, greatly improving the observability and visibility of the container network.
[0118] 2. Abnormality judgment can be performed on complex container networks.
[0119] 3. Ability to selectively operate containers.
[0120] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.
[0121] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
[0122] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.
[0123] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".
[0124] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.
[0125] The various illustrative logic blocks or units described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.
[0126] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in hardware, a software module executed by a processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.
[0127] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and blue-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.
[0128] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for visualizing container network management, characterized in that: include: Receiving an action to be performed on a kubernetes cluster and a specified client agent name for performing the action, and sending a command in the action to be performed to the agent for performing the action, wherein the command is used to control a network of a container in the kubernetes cluster; wherein the action includes at least one command; The agent executing the action communicates with the kubernetes cluster where the agent is located, executes the command in the action in the kubernetes cluster where the agent is located through the agent, and notifies the control center of the result obtained by the agent executing the command in the action; wherein the agent is set on a container in the kubernetes cluster and a container is provided with a unique agent; The control center determines at least one target agent that monitors attribute information changes of the container where the agent is located and collects network link information of the container where the agent is located according to the results obtained by executing the commands in the actions of each agent; Each target agent determined by the control center monitors the changes of the attribute information of the container where it is located and updates the attribute information of the container where it is located in a timely manner. The attribute information of the container includes: the IP address of the container; Each target agnet determined by the control center collects network link information of the container in which it is located; the network link information of the container includes: the IP address that establishes a link with the container to access the container, and the IP addresses of other containers that the container is linked to access; With respect to the attribute information of each container in each Kubernetes cluster and the network connection information of each container, the IP addresses of all containers in each Kubernetes cluster are drawn into the same relationship graph, and the access relationship from the IP address of one container to the IP address of another container is represented in the relationship graph by a connection with an indicated direction; the relationship graph is displayed to the user.
2. The method for managing container network visualization according to claim 1, characterized in that: The network link information of the container also includes: the bandwidth consumed by each container IP address accessing the container; The method for managing container network visualization further includes: In the relationship graph, it is indicated whether the IP address of one container is successfully linked to the IP address of another container, and the bandwidth consumed by the IP address of one container accessing the IP address of another container is displayed in the relationship graph.
3. The method for managing container network visualization according to claim 1, characterized in that: After each target agent determined by the control center monitors the attribute information change of the container where it is located and updates the attribute information of the container in time, it also includes: The attribute information of each container collected by the target agent is obtained and saved through a first time series database component deployed in a kubernetes cluster; wherein the attribute information of the container also includes: the running status of the container; the attribute information of each container in the kubernetes cluster collected by the first time series database component is obtained and saved through a second time series database component deployed outside the kubernetes cluster; the relationship diagram is drawn based on the attribute information of each container obtained by the second time series database component.
4. The method for managing container network visualization according to claim 1, characterized in that: A client kubelet is provided on a node in the Kubernetes cluster; the method further comprises: After the agent completes executing the command in the action, the agent requests the client kubelet to report the result of executing the command to the kubernetes cluster, and the result of executing the command is used by the kubernetes cluster to take corresponding measures accordingly.
5. The method for managing container network visualization according to claim 4, characterized in that: Also includes: The client kubelet performs health checks on the containers in its Kubernetes cluster. If the check fails, the container is restarted and the health check on the container is deleted.
6. A container network visualization management system, characterized in that: include: An action acquisition unit, used to receive an action to be performed on a kubernetes cluster and a specified client agent name for performing the action, and send a command in the action to be performed to the agent for performing the action, wherein the command is used to control the network of the container in the kubernetes cluster; wherein the action includes at least one command; The client agent is used to communicate with the Kubernetes cluster where the agent is located, execute the commands in the action in the Kubernetes cluster where the agent is located, and notify the control center of the results of executing the commands in the action; wherein the agent is set on the container in the Kubernetes cluster and one container is equipped with a unique agent; The control center is used to determine at least one target agent for monitoring attribute information changes of the container where the agent is located and collecting network link information of the container where the agent is located according to the results obtained by executing the commands in the actions of each agent; Each target agent determined by the control center is used to monitor the changes of the attribute information of the container in which it is located and to update the attribute information of the container in time. The attribute information of the container includes: the IP address of the container; and Collect network link information of each container; the network link information of the container includes: the IP address of the container that is linked to the container to access the container, and the IP addresses of other containers that the container is linked to access; The display unit is used for drawing the IP addresses of all containers in each Kubernetes cluster into the same relationship graph according to the attribute information of each container in each Kubernetes cluster and the network link information of each container, and representing the access relationship from the IP address of one container to the IP address of another container in the relationship graph through a connection with an indicated direction; and displaying the relationship graph to the user.
7. The container network visualization management system according to claim 6, characterized in that: The network link information of the container also includes: the bandwidth consumed by each container IP address accessing the container; The display unit is further used to identify in the relationship diagram whether the IP address of one container is successfully linked to the IP address of another container, and to display in the relationship diagram the bandwidth consumed by the IP address of one container accessing the IP address of another container.
8. The container network visualization management system according to claim 6, characterized in that: Also includes: The first time series database component deployed in the kubernetes cluster is used to obtain and save the attribute information of each container collected by the target agent after each target agent determined by the control center monitors the attribute information changes of the respective containers and updates the attribute information of the respective containers in a timely manner; wherein the attribute information of the container also includes: the running status of the container; The second time series database component deployed outside the kubernetes cluster is used to obtain and save the attribute information of each container in the kubernetes cluster collected by the first time series database component; the relationship diagram is drawn based on the attribute information of each container obtained by the second time series database component.
9. The container network visualization management system according to claim 6, characterized in that: A client kubelet is provided on the node in the Kubernetes cluster; The client agent is also used to request the client kubelet to report the results of executing the command to the kubernetes cluster after the command in the action is executed in the kubernetes cluster; The client kubelet is used to receive a request sent by the agent to report the result of executing a command to the kubernetes cluster, and the result of executing the command is used by the kubernetes cluster to take corresponding measures accordingly.
10. The container network visualization management system according to claim 9, characterized in that: The client kubelet is also used to perform health checks on containers in the kubernetes cluster where it is located, restart the container when the check fails, and delete the health check on the container.
Citation Information
Patent Citations
IP monitoring and recycling system and method based on network namespace management and control
CN111163189A
Container cluster management method, device and system
CN111324571A