Information visualization method, device, equipment and computer readable storage medium
By using information visualization methods to acquire and display Kubernetes resources deployed by Helm, the problem of time-consuming manual analysis by operations and maintenance personnel is solved, and the intuitive display of resource relationships is achieved, reducing the difficulty and cost of operations and maintenance.
Patent Information
- Application Number
- CN202310109749.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-02
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-02-02
AI Technical Summary
In existing technologies, analyzing cloud-native application resources deployed by Helm is time-consuming, labor-intensive, and difficult to maintain. Operation and maintenance personnel need to manually analyze detailed description files to determine resource correspondences.
This paper provides an information visualization method that obtains a detailed description file of the target application, establishes a collection of Kubernetes resources, and visualizes them, including the correspondence and association relationships of service resources, minimum sorting unit resources, container resources, process resources, and node resources.
It eliminates the need for manual analysis, reduces maintenance workload, shortens maintenance time, lowers maintenance difficulty and cost, and enables an intuitive and visual display of application resource relationships.
Smart Images

Figure CN116166378B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of cloud native technology, and relates to but is not limited to an information visualization method, device, equipment and computer readable storage medium. BACKGROUND
[0002] With the development of cloud native technology, a container management platform based on kubernetes (K8s for short) has become a de facto standard in the field of container orchestration due to its strong scalability, high availability and other characteristics. Helm, as the most popular package manager for K8s, can help users quickly deploy cloud native applications and quickly create various K8s resources. Each application deployed by helm includes multiple K8s corresponding computing nodes Node, minimum scheduling units Pod, an abstract collection of a group of Pods Service and other resources.
[0003] In related technologies, an operation and maintenance personnel can only directly obtain which resources are included in an application. When an application process needs to be analyzed, the operation and maintenance personnel needs to manually analyze a description file used to describe the application to determine which resources are actually corresponding to each deployed application, which has defects such as large workload, long time consumption, large operation and maintenance difficulty, and high operation and maintenance cost. SUMMARY
[0004] Therefore, an embodiment of the present application provides an information visualization method, device, equipment and computer readable storage medium.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] The embodiment of the present application provides an information visualization method, which comprises the following steps:
[0007] Obtaining a detailed description file of a target application, the target application being an application to be visualized deployed based on helm;
[0008] According to the detailed description file, obtaining a kubernetes resource set under the target application, the kubernetes resource set comprising service resources, minimum orchestration unit resources, container resources, process resources and node resources;
[0009] According to the target application, the service resources, the minimum orchestration unit resources, the container resources, the process resources and the node resources, establishing a structure relationship to be visualized, the structure relationship to be visualized comprising an application resource corresponding relationship and a resource association relationship;
[0010] According to the application resource corresponding relationship and the resource association relationship, visualizing and displaying the structure relationship to be visualized.
[0011] The embodiment of the present application provides an information visualization device, and the device comprises:
[0012] A first obtaining module is used for obtaining a detailed description file of a target application, the target application being an application to be visualized based on helm deployment;
[0013] A second obtaining module is used for obtaining a kubernetes resource set under the target application according to the detailed description file, the kubernetes resource set comprising service resources, minimum arrangement unit resources, container resources, process resources and node resources;
[0014] An establishing module is used for establishing a structure relationship to be visualized according to the target application, the service resources, the minimum arrangement unit resources, the container resources, the process resources and the node resources, the structure relationship to be visualized comprising an application resource correspondence relationship and a resource association relationship;
[0015] A visualization display module is used for visualizing and displaying the structure relationship to be visualized according to the application resource correspondence relationship and the resource association relationship.
[0016] The embodiment of the present application provides an electronic device, which comprises:
[0017] A processor; and
[0018] A memory for storing a computer program capable of running on the processor;
[0019] When the computer program is executed by the processor, the steps of the above information visualization method are realized.
[0020] The embodiment of the present application provides a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions are configured to execute the steps of the above information visualization method.
[0021] The information visualization method of this application embodiment first obtains a detailed description file of the target application from Helm, whereby the target application is an application to be visualized deployed based on Helm. Then, based on the detailed description file of the target application, it obtains the Kubernetes resource set under the target application, whereby the Kubernetes resource set includes service resources, minimum sorting unit resources, container resources, process resources, and node resources. Next, based on the target application, service resources, minimum sorting unit resources, container resources, process resources, and node resources, it establishes the structural relationship to be visualized, whereby the structural relationship to be visualized includes application resource correspondence relationship and resource association relationship. Finally, based on the application resource correspondence relationship and resource association relationship, the structural relationship to be visualized is displayed. In this way, the application resource correspondence relationship between the application and the resources contained in the application, as well as the resource association relationship between resources under the application, are visualized. No manual analysis is required, which can greatly reduce the workload of operation and maintenance personnel, and achieve the effects of shortening operation and maintenance time, reducing operation and maintenance difficulty, and reducing operation and maintenance costs. Attached Figure Description
[0022] In the accompanying drawings (which are not necessarily drawn to scale), similar reference numerals may describe similar parts in different views. The drawings illustrate, by way of example and not limitation, the various embodiments discussed herein.
[0023] Figure 1 This is a schematic diagram of the network architecture of the information visualization system provided in the embodiments of this application;
[0024] Figure 2 A schematic diagram illustrating an implementation flow of the information visualization method provided in this application embodiment;
[0025] Figure 3 A schematic diagram illustrating one implementation process of the step of obtaining the Kubernetes resource set under the target application in the information visualization method provided in the embodiments of this application;
[0026] Figure 4 A schematic diagram illustrating an implementation process of the step of establishing the structural relationship to be visualized in the information visualization method provided in this application embodiment;
[0027] Figure 5 A schematic diagram illustrating another implementation flow of the information visualization method provided in the embodiments of this application;
[0028] Figure 6 This application provides a schematic diagram of the composition structure of a system based on Helm and Kubernetes for the visualization of application architectures.
[0029] Figure 7An example application structure topology visualization display effect schematic diagram provided by the embodiment of the present application;
[0030] Figure 8 An example component structure schematic diagram of the information visualization device provided by the embodiment of the present application;
[0031] Figure 9 An example component structure schematic diagram of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be described in further detail below with reference to the drawings, and the described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by those skilled in the art without creative labor shall fall within the scope of protection of the present application.
[0033] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0034] In the following description, the terms "first\second\third" are only to distinguish similar objects, and do not represent a specific order of the objects, and it can be understood that "first\second\third" can be interchanged with a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0036] Before the embodiments of the present application are described in further detail, the terms and phrases involved in the embodiments of the present application are explained as follows.
[0037] Cloud native is a distributed cloud based on distributed deployment and unified operation and management, and is a set of cloud technology product systems based on technologies such as containers, microservices, Dev Ops (a general term for processes, methods and systems).
[0038] Kubernetes, abbreviated as K8s, is an open source container orchestration engine that supports automated deployment, large-scale scalability and application container management.
[0039] Helm is a command line client tool mainly used for creating, packaging, publishing and managing K8s application charts.
[0040] Chart, application description, is a collection of files used to describe Kubernetes resources.
[0041] A release is a deployment entity based on a chart. When a chart is run by Helm, a corresponding release will be generated, creating a real-running resource object in Kubernetes.
[0042] In related technologies, after deploying cloud-native applications based on Helm, operations and maintenance personnel can only obtain information about the resources included in all deployed applications, but cannot directly determine the actual resources consumed by each application. This requires operations and maintenance personnel to manually analyze and judge the detailed description files to determine the actual resources corresponding to each application, resulting in drawbacks such as large workload, long processing time, high operational difficulty, and high operational costs.
[0043] To address this problem, embodiments of this application provide a solution capable of visually displaying the relationship between applications and resources, and the relationship between resources themselves. The method provided by these embodiments will be described below in conjunction with the apparatus used to implement them. First, the information visualization system provided by these embodiments will be described. See [link to documentation]. Figure 1 , Figure 1 This is a schematic diagram of the network architecture of the information visualization system provided in the embodiments of this application, such as... Figure 1 As shown, the information visualization system includes at least one terminal device 100, a Helm device 200, a Kubernetes device 300, and a network 400. The terminal device 100 is connected to the Helm device 200 and the Kubernetes device 300 through the network 400, which can be a wide area network, a local area network, or a combination of both, using a wireless link to achieve data transmission.
[0044] In some embodiments, terminal device 100 may be a laptop, tablet, desktop computer, smartphone, dedicated messaging device, portable gaming device, smart speaker, smartwatch, etc., or any device capable of visual display. Kubernetes device 300 is a Kubernetes-based container management platform, and Helm device 200 is a Kubernetes package manager, enabling users to quickly deploy cloud-native applications and rapidly create various Kubernetes resources. Network 400 may be a wide area network (WAN), a local area network (LAN), or a combination of both. Terminal device 100, Helm device 200, and Kubernetes device 300 may be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.
[0045] In the application scenario of the information visualization system architecture, when a user needs to visually display one or more application corresponding resources, a terminal device 100 triggers a visualization operation, the terminal device 100 obtains a request message for visualization in response to the operation, when the helm device 200 and the kubernetes device 300 are not connected, a connection instruction is generated, and a connection relationship is established according to the preset interfaces of the helm device 200 and the kubernetes device 300 and the helm device 200 and the kubernetes device 300. The detailed description file of the target application to be visualized based on the helm deployment is obtained from the connected helm device 200; the kubernetes resource set under the target application is obtained from the connected kubernetes device 300 according to the detailed description file, the kubernetes resource set includes service Service resources, minimum arrangement unit Pod resources, container resources, process resources and node Node resources; the to-be-visualized structure relationship is established according to the target application, the service resources, the minimum arrangement unit resources, the container resources, the process resources and the node resources, the to-be-visualized structure relationship includes application resource corresponding relationship and resource association relationship; and the to-be-visualized structure relationship is visually displayed according to the application resource corresponding relationship and the resource association relationship.
[0046] The information visualization system provided by the embodiment of the application obtains the kubernetes resources under the target application from the helm device and the kubernetes device, and visually displays the application topology structure according to the application resource corresponding relationship between the application and the resources contained in the application, and the resource association relationship between the resources under the application and the resources, without manual analysis, which can greatly reduce the operation and maintenance workload of the operation and maintenance personnel, and achieve the effects of shortening operation and maintenance time, reducing operation and maintenance difficulty and reducing operation and maintenance cost.
[0047] The information visualization method provided by the embodiment of the application will be described below. In some embodiments, the information visualization method provided by the embodiment of the application can be implemented by the terminal device in the network architecture shown in Figure 1 The information visualization method provided by the embodiment of the application will be described below. In some embodiments, the information visualization method provided by the embodiment of the application can be implemented by the terminal device in the network architecture shown in Figure 2 An implementation flow diagram of the information visualization method provided by the embodiment of the application will be described below in combination with the steps shown in Figure 2 An implementation flow diagram of the information visualization method provided by the embodiment of the application will be described below in combination with the steps shown in
[0048] In step S201, a detailed description file of a target application is obtained.
[0049] The embodiment of the application can be executed by an information visualization device in a terminal device. The terminal device has a connection relationship with helm and kubernetes in advance. The information visualization device in the terminal device obtains a detailed description file of a target application from the helm, where the target application is an application to be visualized based on helm deployment.
[0050] In the embodiment of the application, the application identifier carried in the request message can be one, in which case the determined target application is one, and the information visualization device visualizes the topology structure of the one target application; the application identifier carried in the request message can also be multiple, in which case the determined target application is multiple, and the information visualization device simultaneously visualizes the topology structures of the multiple target applications. When the target application is one, one detailed description file is obtained from the helm, and when the target application is multiple, a corresponding number of detailed description files are obtained from the helm.
[0051] In step S202, a kubernetes resource set under the target application is obtained according to the detailed description file.
[0052] The kubernetes resource set under the target application includes a service (Service) resource, a minimum arrangement unit (Pod) resource, a container resource, a process resource, and a node (Node) resource.
[0053] In the embodiment of the application, the number of containers, processes, and nodes is greater than or equal to the number of Pods, the number of Pods is greater than or equal to the number of Services, and the number of Services is greater than or equal to the number of applications.
[0054] In some embodiments, the kubernetes resource set under the target application can be obtained by the following steps shown in FIG. 8: Figure 3
[0055] In step S2021, the detailed description file is parsed to obtain service resources and minimum arrangement unit resources corresponding to the target application.
[0056] After the information visualization device obtains the detailed description file of the target application, the file is parsed, and K8s resource descriptions therein are traversed, including but not limited to Service, Pod, Deployment, ReplicaSet, ReplicationController, DaemonSet, and StatefulSet. Among them, Service and Pod are resources that need to be highlighted, and other resources correspond to one or more Pod sets.
[0057] Step S2022, obtaining detailed information of the minimum orchestration unit resource from the kubernetes.
[0058] By parsing the application detailed description file, the Service and Pod list under the application are obtained. Then, the detailed information of the Pod resource is obtained from the K8s according to the Pod resource, and the detailed information describes other resources associated with the Pod.
[0059] Step S2023, parsing the detailed information of the minimum orchestration unit resource to obtain the container resource, process resource, and node resource corresponding to the minimum orchestration unit resource.
[0060] After the information visualization device obtains the detailed information of the Pod, the detailed information is parsed to determine the containers, processes, and Nodes corresponding to each Pod.
[0061] Step S2024, determining the service resource and the minimum orchestration unit resource corresponding to the target application, and the container resource, process resource, and node resource corresponding to the minimum orchestration unit resource as the kubernetes resource set under the target application.
[0062] Step S203, establishing a to-be-visualized structural relationship according to the target application, service resource, minimum orchestration unit resource, container resource, process resource, and node resource.
[0063] The to-be-visualized structural relationship herein includes an application resource correspondence relationship and a resource association relationship. The application resource correspondence relationship is a correspondence relationship between the target application and the key resources under the target application. Generally, the key resources refer to the service resource and the minimum orchestration unit resource. One target application can correspond to multiple service resources, and one service resource can correspond to multiple minimum orchestration unit resources. The resource association relationship is an association relationship between the minimum orchestration unit resource and the container resource, process resource, and node resource under the minimum orchestration unit resource. One minimum orchestration unit resource can correspond to multiple container resources, and each container occupies one process and node.
[0064] In some embodiments, when other resources under the K8s also need to be visualized and displayed, the other resources can also be added to the K8s resource set. When visualized and displayed, the correspondence relationship or the association relationship between the other resources and the Service, Pod, container, process, or Node in the K8s resource set is determined, and the application resource correspondence relationship or the resource association relationship is established, so that more resources can be visualized and displayed.
[0065] In some embodiments, the to-be-visualized structural relationship can be established through the following steps as shown in FIG. 10. Figure 4
[0066] Step S2031, obtaining detailed information of the service resource from the kubernetes.
[0067] The detailed information of the service resource includes service labels and service label selectors. The detailed information of the pod resource obtained in the step S2022 above further includes pod labels and pod label selectors.
[0068] A label is a set of name-value pairs attached to a K8s object such as a Service or a Pod, which is intended to identify the K8s object in a way meaningful to users without affecting the core logic of K8s. Labels can be used to organize or select a group of K8s objects, and can be added to a K8s object when it is selected or after it is created. Each K8s object can have multiple labels, and the keys of the labels of the same object must be unique. Using labels can efficiently query and listen to K8s objects.
[0069] A label selector is used to express the query condition or selection criteria of a label. K8s interface currently supports two types of label selectors: an equality-based label selector and a set-based label selector. When multiple selectors are specified, they are separated by commas, and the "and" logic is followed between the selectors, that is, all conditions must be met, and a null selector will not select any object.
[0070] Step S2032, establishing an application resource correspondence relationship according to the target application, service labels, service label selectors, minimum orchestration unit labels, and minimum orchestration unit label selectors.
[0071] In some embodiments, the application resource correspondence relationship can be established by the following steps: selecting a target service that meets the service selection condition from the service labels of the service resource corresponding to the target application according to the service label selector; selecting a target minimum orchestration unit that meets both the service selection condition and the minimum orchestration unit selection condition from the minimum orchestration unit labels of the minimum orchestration unit resource corresponding to the target application according to the service label selector and the minimum orchestration unit label selector; and connecting the target application, the target service, and the target minimum orchestration unit to obtain the application resource correspondence relationship.
[0072] Associating the target application with the Service corresponding to the application and the Pod corresponding to the application to obtain a correspondence relationship between the application and the resource.
[0073] Step S2033, establishing a resource association relationship according to the minimum orchestration unit resource, the container resource, the process resource, and the node resource.
[0074] The Pod is associated with the corresponding container, process and Node, and the association relationship between resources is obtained.
[0075] In step S2034, the application resource correspondence relationship and the resource association relationship are connected according to the minimum orchestration unit resource, and a to-be-visualized structure relationship is obtained.
[0076] In step S204, the to-be-visualized structure relationship is visualized and displayed according to the application resource correspondence relationship and the resource association relationship.
[0077] The information visualization method provided by the embodiment of the application first obtains a detailed description file of a target application from a helm, the target application being an application to be visualized deployed based on the helm; then, according to the detailed description file of the target application, a kubernetes resource set under the target application is obtained, the kubernetes resource set including service resources, minimum orchestration unit resources, container resources, process resources and node resources; then, according to the target application, the service resources, the minimum orchestration unit resources, the container resources, the process resources and the node resources, a to-be-visualized structure relationship is established, wherein the to-be-visualized structure relationship includes an application resource correspondence relationship and a resource association relationship; finally, the to-be-visualized structure relationship is visualized and displayed according to the application resource correspondence relationship and the resource association relationship. By obtaining the kubernetes resources under the target application and the detailed description file thereof, the application resource correspondence relationship between the application and the resources contained in the application, and the resource association relationship between the resources under the application are analyzed, so that the visualized display of the application resource correspondence relationship and the resource association relationship of the target application is realized, without manual analysis, which can greatly reduce the operation and maintenance workload of operation and maintenance personnel, and achieve the effects of shortening operation and maintenance time, reducing operation and maintenance difficulty and reducing operation and maintenance cost.
[0078] In Figure 2 On the basis of the embodiment shown in the figure, the embodiment of the application further provides an information visualization method, Figure 5 Another implementation process of the information visualization method provided by the embodiment of the application is shown in the figure. Figure 5 The method includes the following steps:
[0079] In step S501, a request message for visualization is received.
[0080] The embodiment of the application can be executed by an information visualization device in a terminal device. The terminal device and the helm and the kubernetes have a connection relationship established in advance. The information visualization device in the terminal device obtains a detailed description file of a target application from the helm.
[0081] In step S502, a connection instruction is generated according to the request message.
[0082] Here, the connection instruction is used to connect the interfaces of helm and kubernetes preset.
[0083] In step S503, the connection instruction is executed to establish a connection relationship with the helm and the kubernetes.
[0084] After receiving the visualization request message, the information visualization device connects the helm and the K8s based on the interfaces of the helm and the K8s preset, and obtains information to be visualized from the helm and the K8s.
[0085] In step S504, a detailed description file of the target application is obtained.
[0086] The target application here is an application to be visualized deployed based on the helm. In the embodiment of the application, the application identifier carried by the request message can be one, and the target application determined at this time is one, and the information visualization device visualizes the topology structure of the one target application; the application identifier carried by the request message can also be multiple, and the target application determined at this time is multiple, and the information visualization device simultaneously visualizes the topology structure of the multiple target applications.
[0087] In an implementation manner, the information visualization device can obtain the detailed description file according to the following steps: obtaining a deployed application from the helm; parsing the request message to obtain the application identifier carried by the request message; according to the application identifier, screening a target application to be visualized from the deployed application; and obtaining a detailed description file of the target application from the helm. When the target application is one, one detailed description file is obtained from the helm, and when the target application is multiple, a corresponding number of detailed description files are obtained from the helm.
[0088] In step S505, a kubernetes resource set under the target application is obtained according to the detailed description file.
[0089] The kubernetes resource set under the target application includes a service (Service) resource, a minimum arrangement unit (Pod) resource, a container resource, a process resource, and a node (Node) resource.
[0090] After the information visualization device obtains the detailed description file of the target application, the file is parsed, K8s resource descriptions therein are traversed, and a Service and a Pod list are determined. Then, detailed information of the Pod is obtained from the K8s, and the detailed information describes other resources associated with the Pod. The Pod detailed information is parsed to determine containers, processes, and Nodes corresponding to each Pod.
[0091] Step S506, according to the target application, service resource, minimum arrangement unit resource, container resource, process resource and node resource, the to-be-visualized structural relationship is established.
[0092] The to-be-visualized structural relationship includes an application resource correspondence relationship and a resource association relationship. The application resource correspondence relationship is a correspondence relationship between a target application and key resources under the target application. Generally, the key resources refer to service resources and minimum arrangement unit resources. One target application can correspond to multiple service resources, and one service resource can correspond to multiple minimum arrangement unit resources. The resource association relationship is an association relationship between a minimum arrangement unit resource and container resources, process resources and node resources under the minimum arrangement unit resource. One minimum arrangement unit resource can correspond to multiple container resources, and each container occupies one process and one node.
[0093] Step S507, according to the application resource correspondence relationship and the resource association relationship, the to-be-visualized structural relationship is visualized and displayed.
[0094] The method provided by the embodiment of the application can obtain kubernetes resources and detailed description files under a target application, analyze an application resource correspondence relationship between an application and resources contained in the application, and analyze a resource association relationship between resources under the application and the resources, so as to realize visualized display of the application resource correspondence relationship and the resource association relationship of the target application. The method does not need manual analysis, can greatly reduce the operation and maintenance workload of an operation and maintenance personnel, and achieves the effects of shortening operation and maintenance time, reducing operation and maintenance difficulty and reducing operation and maintenance cost.
[0095] In the following, an exemplary application of the embodiment of the application in an actual application scenario will be described.
[0096] With the development of cloud native technology, a kubernetes-based container management platform has become a de facto standard in the field of container orchestration due to its strong expansibility, high availability and other characteristics, and greatly simplifies the difficulty of the operation and maintenance process of container orchestration. Helm, as the most popular package manager of kubernetes, can help users quickly deploy cloud native applications and quickly create various kubernetes resources.
[0097] Helm is used to deploy applications through command lines. After executing the deployment command, Helm automatically creates various Kubernetes resources based on the description information in the chart. The subsequent management and maintenance of these resources need to be performed through Kubernetes. Currently, there are some visualization tools for Kubernetes, including open-source Kubernetes-dashboard, prometheus & grafana, and Kubernetes cluster management tools provided by various platforms. These tools or products have different focuses. Dashboard focuses on display and management, promethus focuses on monitoring, and platform Kubernetes focuses on the management of its own Kubernetes cluster.
[0098] Each application deployed by Helm contains multiple Kubernetes corresponding resources such as Service, Pod, Node, etc. Although some existing tools can display these resources, they are mostly simple lists and cannot reflect the association between these resources and applications, as well as the relationship between these resources.
[0099] To know which resources the deployed application actually corresponds to, the description file of the Helm chart needs to be analyzed. These files are a few tens, hundreds or even thousands of lines, which is unrealistic for manual analysis. Moreover, the description files of each application are different, which further increases the difficulty of analysis. After analyzing the description file, resource matching needs to be performed according to various filtering conditions in the description file. The analysis of one application will consume a lot of time and energy.
[0100] The visualization system provided by the embodiments of the present application can be developed using Go language. By connecting Helm and Kubernetes interfaces, application information is obtained, resources are parsed, and the structural relationship between applications and resources and between resources is established. The structural relationship is displayed through a visual UI, so that users can intuitively see the corresponding resources of each Helm application and the structural topology between resources.
[0101] Figure 6 The composition structure diagram of the application structure visualization implementation system based on Helm and Kubernetes provided by the embodiments of the present application is shown in FIG. 1. Figure 6 As shown in FIG. 1, the visualization system 60 as a whole contains two modules: a control end module 61 and a front end module 62.
[0102] Among them, the control end module 61 is responsible for interacting with helm and kubernetes, obtaining helm deployment application data, kubernetes resource information; and then analyzing the relationship between the application and the kubernetes resource through the application data file, and the relationship between the resources. The front end module is responsible for obtaining the real application structure topology from the control end module and performing visual display.
[0103] The visual system provided by the embodiment of the application can be developed by using Go language. The Go language itself supports helm deployment. After successful deployment, the front end and control end modules are automatically run under the kubernetes cluster. The application structure topology visualization steps are as follows:
[0104] 1) Connect helm to obtain the list of deployed applications;
[0105] 2) Connect kubernetes for subsequent resource detailed information acquisition;
[0106] 3) Obtain the detailed description file of the application, and traverse the Kubernetes resource description in the file, including: Service, Pod, Deployment, ReplicaSet, ReplicationController, DaemonSet, StatefulSet. Among them, Service and Pod are resources that need to be focused on display, and other resources correspond to one or more Pod sets. By analyzing the detailed description file of the application, the list of Service and Pod under the application can be obtained.
[0107] 4) Based on the Service and Pod list obtained in step 3, through the kubernetes connection established in step 2, the detailed information of Service and Pod is obtained, and the corresponding relationship between Service and Pod is established through the corresponding labels and selectors.
[0108] 5) Through the detailed information of Pod obtained by connecting kubernetes, the container, process and Node information in the Pod are identified, and the association relationship between Pod, container, process and Node is established.
[0109] 6) After the association relationship of all resources under the application is established, the front end obtains the corresponding structure topology through the interface to perform display.
[0110] Figure 7 The example application structure topology visualization provided by the embodiment of the application is shown in the following schematic diagram: Figure 7As shown, in the visualization diagram, the detailed structure topology of the application, the corresponding Service, Pod, container, process, Node information, and the structural relationship between these resources can be intuitively seen.
[0111] The application structure topology visualization method provided by the embodiments of the present application first identifies the kubernetes resources corresponding to the helm application by analyzing the helm chart detailed description file; then obtains the structural relationship between the kubernetes resources under the application through information matching between the kubernetes resources; and finally displays the complete structure topology of the application through a visualization interface, thereby solving the problems of difficult analysis of application resources and long time consumption.
[0112] Based on the foregoing embodiments, the embodiments of the present application provide an information visualization device, each module included in the device and each unit included in each module can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0113] The embodiments of the present application further provide an information visualization device applied to a terminal device, Figure 8 A schematic diagram of a component structure of the information visualization device provided by the embodiments of the present application is shown in Figure 8 As shown, the information visualization device 800 includes:
[0114] A first obtaining module 801 is configured to obtain a detailed description file of a target application, the target application being a helm-based application to be visualized;
[0115] A second obtaining module 802 is configured to obtain a kubernetes resource set under the target application according to the detailed description file, the kubernetes resource set including service resources, minimum orchestration unit resources, container resources, process resources, and node resources;
[0116] An establishing module 803 is configured to establish a structure relationship to be visualized according to the target application, the service resources, the minimum orchestration unit resources, the container resources, the process resources, and the node resources, the structure relationship to be visualized including an application resource correspondence relationship and a resource association relationship;
[0117] The visualization display module 804 is configured to perform visualization display on the structure relationship to be visualized according to the application resource correspondence relationship and the resource association relationship.
[0118] In some embodiments, the information visualization apparatus 800 further includes:
[0119] The receiving module is configured to receive a request message for visualization before obtaining a detailed description file of a target application.
[0120] The generating module is configured to generate a connection instruction according to the request message, the connection instruction being used to connect an interface preset by helm and kubernetes.
[0121] The connecting module is configured to execute the connection instruction to establish a connection relationship with the helm and the kubernetes.
[0122] In some embodiments, the first obtaining module 801 is further configured to:
[0123] Obtain deployed applications from the helm.
[0124] Filter a target application to be visualized from the deployed applications according to an application identifier carried in the request message.
[0125] Obtain a detailed description file of the target application from the helm.
[0126] In some embodiments, the second obtaining module 802 is further configured to:
[0127] Parse the detailed description file to obtain service resources and minimum orchestration unit resources corresponding to the target application.
[0128] Obtain detailed information of the minimum orchestration unit resources from the kubernetes.
[0129] Parse the detailed information of the minimum orchestration unit resources to obtain container resources, process resources and node resources corresponding to the minimum orchestration unit resources.
[0130] Determine the service resources and the minimum orchestration unit resources corresponding to the target application, and the container resources, the process resources and the node resources corresponding to the minimum orchestration unit resources, as a kubernetes resource set under the target application.
[0131] In some embodiments, the establishing module 803 is further configured to:
[0132] obtain detailed information of the service resource from the kubernetes, the detailed information of the service resource including a service label and a service label selector, and the detailed information of the minimum orchestration unit resource including a minimum orchestration unit label and a minimum orchestration unit label selector;
[0133] establish an application resource correspondence relationship according to the target application, the service label, the service label selector, the minimum orchestration unit label, and the minimum orchestration unit label selector;
[0134] establish a resource association relationship according to the minimum orchestration unit resource, the container resource, the process resource, and the node resource;
[0135] connect the application resource correspondence relationship and the resource association relationship according to the minimum orchestration unit resource, to obtain a to-be-visualized structure relationship.
[0136] In some embodiments, the establishing module 803 is further configured to:
[0137] select a target service that meets a service selection condition from service labels of a service resource corresponding to the target application according to the service label selector;
[0138] select a target minimum orchestration unit that meets both a service selection condition and a minimum orchestration unit selection condition from minimum orchestration unit labels of a minimum orchestration unit resource corresponding to the target application according to the service label selector and the minimum orchestration unit label selector;
[0139] connect the target application, the target service, and the target minimum orchestration unit to obtain an application resource correspondence relationship.
[0140] It should be noted that the above description of the information visualization device embodiment is similar to the above method description, and has the same beneficial effects as the method embodiment. For technical details not disclosed in the information visualization device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0141] It should be noted that, in the embodiments of this application, if the above methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0142] Accordingly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps in the information visualization method provided in the above embodiments.
[0143] This application provides an electronic device. Figure 9 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Figure 9 The exemplary structure of the electronic device 900 shown can be used to deduce other exemplary structures of the electronic device 900. Therefore, the structure described herein should not be regarded as a limitation. For example, some components described below may be omitted, or components not described below may be added to suit the specific needs of certain applications.
[0144] Figure 9 The illustrated electronic device 900 includes: a processor 901, at least one communication bus 902, a user interface 903, at least one external communication interface 904, and a memory 905. The communication bus 902 is configured to enable communication between these components. The user interface 903 may include a display screen, and the external communication interface 904 may include standard wired and wireless interfaces. The processor 901 is configured to execute a program stored in the memory for an information visualization method, to implement the steps in the information visualization method provided in the above embodiments.
[0145] The descriptions of the above embodiments of the electronic devices and storage media are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the embodiments of the electronic devices and storage media of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0146] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0147] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0148] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0149] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0150] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0151] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program performs the steps of the above-mentioned method embodiments when executed; and the foregoing storage medium includes various storage media that can store program codes, such as mobile storage devices, ROMs, magnetic discs or optical discs.
[0152] Alternatively, the integrated units of the present application can be stored in a computer readable storage medium if they are realized in the form of software function modules and sold or used as independent products. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a plurality of instructions for causing an apparatus to perform all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes various storage media that can store program codes, such as mobile storage devices, ROMs, magnetic discs or optical discs.
[0153] The above is only an embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of information visualization, characterized by, The method comprises: obtaining a detailed description file of a target application, the target application being an application to be visualized based on helm deployment; obtaining a kubernetes resource set under the target application according to the detailed description file, the kubernetes resource set comprising service resources, minimum orchestration unit resources, container resources, process resources and node resources; establishing a structure relationship to be visualized according to the target application, the service resources, the minimum orchestration unit resources, the container resources, the process resources and the node resources, the structure relationship to be visualized comprising an application resource correspondence relationship and a resource association relationship; visualizing the structure relationship to be visualized according to the application resource correspondence relationship and the resource association relationship; wherein the establishing of the structure relationship to be visualized according to the target application, the service resources, the minimum orchestration unit resources, the container resources, the process resources and the node resources comprises: obtaining detailed information of the service resources from the kubernetes, the detailed information of the service resources comprising service labels and service label selectors, and detailed information of the minimum orchestration unit resources comprising minimum orchestration unit labels and minimum orchestration unit label selectors; establishing an application resource correspondence relationship according to the target application, the service labels, the service label selectors, the minimum orchestration unit labels and the minimum orchestration unit label selectors; establishing a resource association relationship according to the minimum orchestration unit resources, the container resources, the process resources and the node resources; connecting the application resource correspondence relationship and the resource association relationship according to the minimum orchestration unit resources to obtain the structure relationship to be visualized.
2. The method of claim 1, wherein, Before the obtaining of the detailed description file of the target application, the method further comprises: receiving a request message for visualization; generating a connection instruction according to the request message, the connection instruction being used for connecting interfaces of helm and kubernetes preset; executing the connection instruction to establish a connection relationship with the helm and the kubernetes.
3. The method of claim 2, wherein, The obtaining of the detailed description file of the target application comprises: obtaining deployed applications from the helm; screening a target application to be visualized from the deployed applications according to an application identifier carried by the request message; obtaining the detailed description file of the target application from the helm.
4. The method of claim 1, wherein, The obtaining of the kubernetes resource set under the target application according to the detailed description file comprises: parsing the detailed description file to obtain service resources and minimum orchestration unit resources corresponding to the target application; obtaining detailed information of the minimum orchestration unit resources from the kubernetes; parsing the detailed information of the minimum orchestration unit resources to obtain container resources, process resources and node resources corresponding to the minimum orchestration unit resources; determining the service resources and the minimum orchestration unit resources corresponding to the target application, and the container resources, the process resources and the node resources corresponding to the minimum orchestration unit resources, as the kubernetes resource set under the target application.
5. The method of claim 1, wherein, The application resource correspondence relationship is established according to the target application, the service label, the service label selector, the minimum arrangement unit label and the minimum arrangement unit label selector. According to the service label selector, a target service meeting a service selection condition is selected from service labels of service resources corresponding to the target application. According to the service label selector and the minimum arrangement unit label selector, a target minimum arrangement unit meeting both the service selection condition and a minimum arrangement unit selection condition is selected from minimum arrangement unit labels of minimum arrangement unit resources corresponding to the target application. The target application, the target service and the target minimum arrangement unit are connected to obtain the application resource correspondence relationship.
6. An information visualization device, characterized by The device comprises: A first obtaining module is configured to obtain a detailed description file of a target application, the target application being an application to be visualized based on helm deployment. A second obtaining module is configured to obtain a kubernetes resource set under the target application according to the detailed description file, the kubernetes resource set comprising service resources, minimum arrangement unit resources, container resources, process resources and node resources. An establishing module is configured to establish a structure relationship to be visualized according to the target application, the service resources, the minimum arrangement unit resources, the container resources, the process resources and the node resources, the structure relationship to be visualized comprising an application resource correspondence relationship and a resource association relationship. A visualized display module is configured to visually display the structure relationship to be visualized according to the application resource correspondence relationship and the resource association relationship. The establishing module is further configured to obtain detailed information of the service resources from the kubernetes, the detailed information of the service resources comprising service labels and a service label selector, and detailed information of the minimum arrangement unit resources comprising minimum arrangement unit labels and a minimum arrangement unit label selector; to establish the application resource correspondence relationship according to the target application, the service labels, the service label selector, the minimum arrangement unit labels and the minimum arrangement unit label selector; to establish the resource association relationship according to the minimum arrangement unit resources, the container resources, the process resources and the node resources; and to connect the application resource correspondence relationship and the resource association relationship according to the minimum arrangement unit resources to obtain the structure relationship to be visualized.
7. The apparatus of claim 6, wherein, The device further comprises: A receiving module is configured to receive a request message for visualization before obtaining the detailed description file of the target application. A generating module is configured to generate a connection instruction according to the request message, the connection instruction being used to connect a preset interface of helm and kubernetes. A connecting module is configured to execute the connection instruction to establish a connection relationship with the helm and the kubernetes.
8. An electronic device, comprising: comprise: a processor; and a memory for storing a computer program executable on the processor; wherein the computer program is executed by the processor to implement the steps of the information visualization method according to any one of claims 1 to 5. 9. A computer-readable storage medium, characterized in that, Computer executable instructions are stored, which are configured to execute the steps of the information visualization method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Container orchestration engine resource management method and device, readable medium and electronic equipment
CN112417051A
Log monitoring management system and method for container cloud
CN113468111A