Information query system and method
By designing an information query system, using recording, query and monitoring devices, the difficulty of determining responsibility caused by temporary IP of application instances and changes in the ownership rights of the application instance in the K8s public shared cluster environment is solved, and real-time query and tracking of the IP and ownership information of the application instances is realized.
Patent Information
- Application Number
- CN202411771692.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-18
AI Technical Summary
In the K8s public shared cluster environment, the IP address of the application instance is temporary, which leads to difficulties in locating the home pod, especially when the IP's home ownership changes, and it becomes difficult to fix the problem.
An information query system is designed, including a recording device, a query device and a monitoring device. The recording device stores the IP address information and home information of the application instance. The query device inquires corresponding information from the recording device in response to the query request. The monitoring device monitors the status changes of the application instance, and updates the information in the recording device in real time.
Real-time query of the historical IP address information and home information of the application instance, and can be tracked even if the IP address or home information changes, making it easier to fix the problem.
Smart Images

Figure CN119854264A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information query system and method. Background Art
[0002] The IP allocation in the traditional virtual machine and physical machine environment is relatively fixed. When the network team encounters a problem, they can easily locate the machine through the IP and find the owner through the machine.
[0003] In the K8s public shared cluster environment, the IP of the application instance (Pod) is temporary. When the Pod is killed or rebuilt, the original IP will be recycled. At the same time, the same IP may belong to Pods deployed by different business lines at different time points. In addition, when the problem IP is discovered and the Pod needs to be located, the ownership of the IP may have changed, which makes it difficult to identify and fix the problem. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides an information query system and method.
[0005] In a first aspect, the present application provides an information query system, including: a recording device, a query device, and a monitoring device arranged in a physical cluster;
[0006] The recording device is used to store IP address information and attribution information corresponding to each application instance in the physical cluster, wherein the IP address information and the attribution information are stored in the recording device when the state of the application instance in the physical cluster changes;
[0007] The query device is used to query the IP address information and / or attribution information corresponding to the query request from the recording device in response to the query request for the application instance in the physical cluster;
[0008] The monitoring device is used to monitor a trigger event triggered when the state of the application instance changes, and in response to the trigger event, extract the ownership information of the application instance from the instance tag corresponding to the application instance, and obtain the IP address information allocated by the physical cluster to the application instance, and store the ownership information and the IP address information corresponding to the application instance in the recording device.
[0009] Optionally, the monitoring device is further configured to determine that the triggering event is monitored when the event of creating the application instance is monitored;
[0010] Alternatively, the monitoring device is further configured to determine that the triggering event is monitored when an event of updating the application instance is monitored;
[0011] Alternatively, the monitoring device is further configured to determine that the triggering event is monitored when an event of deleting the application instance is monitored.
[0012] Optionally, the monitoring device is further configured to add an instance offline mark to the instance tag corresponding to the application instance when an event of deleting the application instance is monitored.
[0013] Optionally, the information query system further comprises: a sending device;
[0014] The sending device is further used to obtain the attribution information of the application instance to be sent to the physical cluster, and store the attribution information in the instance tag corresponding to the application instance.
[0015] Optionally, the recording device is further used to delete the IP address information and the attribution information whose storage time exceeds a preset threshold at every preset time period.
[0016] In a second aspect, the present application provides an information query method, comprising:
[0017] The monitoring device monitors a trigger event triggered when the state of the application instance changes, and in response to the trigger event, extracts the ownership information of the application instance from the instance tag corresponding to the application instance, obtains the IP address information allocated by the physical cluster to the application instance, and stores the ownership information and the IP address information corresponding to the application instance in the recording device;
[0018] The recording device stores IP address information and attribution information corresponding to each application instance in the physical cluster, wherein the IP address information and the attribution information are stored in the recording device when the state of the application instance in the physical cluster changes;
[0019] The query device, in response to a query request for an application instance in the physical cluster, queries the recording device for IP address information and / or attribution information corresponding to the query request.
[0020] Optionally, the method further comprises:
[0021] The monitoring device determines that the triggering event is monitored when monitoring the event of creating the application instance;
[0022] Alternatively, the monitoring device determines that the triggering event is monitored when monitoring an event of updating the application instance;
[0023] Alternatively, the monitoring device determines that the triggering event is monitored when monitoring an event of deleting the application instance.
[0024] Optionally, the method further comprises:
[0025] When the monitoring device monitors the event of deleting the application instance, it adds an instance offline mark to the instance tag corresponding to the application instance.
[0026] Optionally, the method further comprises:
[0027] The sending device obtains the attribution information of the application instance to be sent to the physical cluster, and stores the attribution information in the instance tag corresponding to the application instance.
[0028] Optionally, the method further comprises:
[0029] The recording device deletes the IP address information and the attribution information whose storage time exceeds a preset threshold at every preset time period.
[0030] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0031] When an embodiment of the present application receives a query request for an application instance in a physical cluster, it can automatically query the recording device for IP address information and / or attribution information that matches the query request, and the IP address information and attribution information are stored when the status of the application instance in the physical cluster changes, thereby realizing real-time query of the IP address information and / or attribution information of the application instance throughout its history. Even if the IP address information or attribution information changes, it can be tracked, which is convenient for determining the responsibility and repairing the problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0033] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0034] Figure 1 A structural diagram of an information query system provided in an embodiment of the present application;
[0035] Figure 2 An interaction flow chart of various devices in an information query system provided in an embodiment of the present application;
[0036] Figure 3 A flowchart of an information query method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0038] Since the IP of the application instance (Pod) is temporary in the K8s public shared cluster environment, the original IP will be recycled as the Pod is killed or rebuilt. At the same time, the same IP may belong to Pods deployed by different business lines at different time points. In addition, when the problem IP is discovered and the time when the Pod to which it belongs needs to be located, the ownership of the IP may have changed, which brings a lot of difficulty to the problem of assigning responsibility for repair. To this end, the embodiments of the present application provide an information query system and method.
[0039] The present application embodiment provides an information query system, such as Figure 1 As shown, it includes: a recording device 11 and a query device 12, wherein the recording device 11 and the query device 12 can be set independently of the physical cluster, and can be set on the same electronic device or on different electronic devices; the information query system also includes: a listening device 13 set in the physical cluster, and the listening device 13 can be set independently of the physical cluster, and can be set on the same electronic device or on a different electronic device as the recording device and the query device;
[0040] The recording device 11 is used to store the IP address information and the attribution information corresponding to each application instance in the physical cluster. The IP address information and the attribution information are stored in the recording device 11 when the state of the application instance in the physical cluster changes. That is, each time the state of the application instance in the physical cluster changes, the IP address information and the attribution information of the application instance are stored in the recording device 11 to ensure that all the IP address information and the attribution information of the application instance in history are recorded in the recording device 11;
[0041] In the embodiment of the present application, an application instance (Pod) may refer to a minimum deployment unit in a Kubernetes (an open source container orchestration system, i.e., K8s, whose main function is to automatically deploy, scale, and manage containerized applications) physical cluster that can create and manage a group of related containers. They share storage resources and can communicate with each other through localhost.
[0042] The recording device can persistently store the Pod's IP address information, operating status, and ownership information, so that even after the Pod goes offline, the IP used can be queried.
[0043] The query device 12 is used to respond to a query request for an application instance in the physical cluster and query the IP address information and / or attribution information corresponding to the query request from the recording device.
[0044] In the embodiment of the present application, the query device 12 can view information through multiple dimensions, for example: query through IP, query through a certain time period, query through the owner, etc.
[0045] The IP address information is the Pod IP, which is allocated by the K8s CNI plug-in. The corresponding IP can only be allocated after the Pod is scheduled to the K8s cluster.
[0046] The monitoring device 13 is used to monitor the trigger event triggered when the state of the application instance changes, and in response to the trigger event, extract the ownership information of the application instance from the instance tag corresponding to the application instance, and obtain the IP address information allocated by the physical cluster to the application instance, and store the ownership information and the IP address information corresponding to the application instance in the recording device 11.
[0047] When an embodiment of the present application receives a query request for an application instance in a physical cluster, it can automatically query the recording device for IP address information and / or attribution information that matches the query request, and the IP address information and attribution information are stored when the status of the application instance in the physical cluster changes, thereby realizing real-time query of the IP address information and / or attribution information of the application instance throughout its history. Even if the IP address information or attribution information changes, it can be tracked, which is convenient for determining the responsibility and repairing the problem.
[0048] In an implementation manner of the present application, the monitoring device 13 is further configured to determine that the triggering event is monitored when the event of creating the application instance is monitored.
[0049] In another implementation manner of the present application, the monitoring device 13 is further configured to determine that the triggering event is monitored when an event of updating the application instance is monitored.
[0050] In another implementation manner of the present application, the monitoring device 13 is further configured to determine that the triggering event is monitored when an event of deleting the application instance is monitored.
[0051] In an embodiment of the present application, the monitoring device 13 can monitor the creation / update / deletion events of the Pod on each K8s cluster, and then extract the instance label (Label) information in the Pod and record the obtained IP address information in the recording device.
[0052] In Kubernetes, Pod Labels are key-value pairs used to identify and organize Pods. They can be used to select and manipulate a group of Pods with the same label, such as in a deployment or service selector.
[0053] Through Pod Label, rich information can be injected into the Pod, and the Pod information is finally persisted in the recording device, which can track the IP allocation record.
[0054] In another embodiment of the present application, the monitoring device 13 is further configured to add an instance offline mark to the instance tag corresponding to the application instance when an event of deleting the application instance is monitored.
[0055] In another embodiment of the present application, the information query system further includes: a sending device 14, which can be set independently of the physical cluster, and can be set on the same electronic device or on different electronic devices as the recording device, the query device and the monitoring device;
[0056] The sending device 14 is further used to obtain the attribution information of the application instance to be sent to the physical cluster, and store the attribution information in the instance tag corresponding to the application instance.
[0057] The sending device 14 stores the attribution information, such as project information, personnel information, etc. When the relevant personnel under the relevant project create an application, the final Pod Label will be filled with the corresponding attribution information, such as project: A, personnel: B, etc., and then sent to the K8s cluster.
[0058] In another embodiment of the present application, the recording device 11 is further used to delete the IP address information and the attribution information whose storage time exceeds a preset threshold every preset time period.
[0059] The recording device 11 in the embodiment of the present application can regularly clean up data that is too old to prevent excessive information from being recorded, which affects query efficiency.
[0060] Based on the above-mentioned embodiment, a flowchart of information interaction between devices in an information query system in actual application can be as follows: Figure 2 shown.
[0061] Figure 2 In the process, the delivery device prepares to deliver the Pod and records the Pod ownership information in the Pod Label;
[0062] The delivery device delivers the Pod with the injected Label to the K8s cluster.
[0063] The monitoring device of the K8s cluster monitors Pod events and extracts information such as ownership from the Pod label. At this time, the Pod is also assigned an IP. The relevant information is prepared to be recorded in the recording device. When it is a deletion event, the Pod is marked as not offline.
[0064] Send the extracted Pod information, such as IP, running status, project, etc., to the recording device, which will record it persistently after receiving it;
[0065] The query device searches by IP, ownership information, etc.
[0066] In another embodiment of the present application, an information query method is also provided. Figure 3 As shown, including:
[0067] Step S101, the monitoring device monitors a trigger event triggered when the state of the application instance changes, and in response to the trigger event, extracts the ownership information of the application instance from the instance tag corresponding to the application instance, obtains the IP address information assigned by the physical cluster to the application instance, and stores the ownership information and the IP address information corresponding to the application instance in the recording device;
[0068] In an embodiment of the present application, when an event of creating the application instance is listened to, it is determined that the trigger event is listened to; when an event of updating the application instance is listened to, it is determined that the trigger event is listened to; when an event of deleting the application instance is listened to, it is determined that the trigger event is listened to, and when an event of deleting the application instance is listened to, an instance offline mark is added to the instance tag corresponding to the application instance.
[0069] Step S102, the recording device stores IP address information and attribution information corresponding to each application instance in the physical cluster, wherein the IP address information and the attribution information are stored in the recording device when the state of the application instance in the physical cluster changes;
[0070] In the embodiment of the present application, the recording device can delete the IP address information and the attribution information whose storage time exceeds a preset threshold every preset time period.
[0071] Step S103 : In response to a query request for an application instance in the physical cluster, the query device queries the recording device for IP address information and / or attribution information corresponding to the query request.
[0072] When an embodiment of the present application receives a query request for an application instance in a physical cluster, it can automatically query the recording device for IP address information and / or attribution information that matches the query request, and the IP address information and attribution information are stored when the status of the application instance in the physical cluster changes, thereby realizing real-time query of the IP address information and / or attribution information of the application instance throughout its history. Even if the IP address information or attribution information changes, it can be tracked, which is convenient for determining the responsibility and repairing the problem.
[0073] In another embodiment of the present application, the method further includes:
[0074] The sending device obtains the attribution information of the application instance to be sent to the physical cluster, and stores the attribution information in the instance tag corresponding to the application instance.
[0075] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0076] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. An information query system, characterized in that: include: Recording devices, query devices, and monitoring devices installed in the physical cluster; The monitoring device is used to monitor a trigger event triggered when the state of the application instance changes, and in response to the trigger event, extract the ownership information of the application instance from the instance tag corresponding to the application instance, and obtain the IP address information allocated by the physical cluster to the application instance, and store the ownership information and the IP address information corresponding to the application instance in the recording device; The recording device is used to store IP address information and attribution information corresponding to each application instance in the physical cluster, wherein the IP address information and the attribution information are stored in the recording device when the state of the application instance in the physical cluster changes; The query device is used to respond to a query request for an application instance in the physical cluster and query the IP address information and / or attribution information corresponding to the query request from the recording device.
2. The information query system according to claim 1, characterized in that: The monitoring device is further configured to determine that the triggering event is monitored when the event of creating the application instance is monitored; Alternatively, the monitoring device is further configured to determine that the triggering event is monitored when an event of updating the application instance is monitored; Alternatively, the monitoring device is further configured to determine that the triggering event is monitored when an event of deleting the application instance is monitored.
3. The information query system according to claim 1, characterized in that: The monitoring device is further configured to add an instance offline mark to the instance tag corresponding to the application instance when monitoring an event of deleting the application instance.
4. The information query system according to claim 1, characterized in that: The information query system further includes: a sending device; The sending device is further used to obtain the attribution information of the application instance to be sent to the physical cluster, and store the attribution information in the instance tag corresponding to the application instance.
5. The information query system according to claim 1, characterized in that: The recording device is further used to delete the IP address information and the attribution information whose storage time exceeds a preset threshold at every preset time period.
6. An information query method, characterized in that: include: The monitoring device monitors a trigger event triggered when the state of the application instance changes, and in response to the trigger event, extracts the ownership information of the application instance from the instance tag corresponding to the application instance, obtains the IP address information allocated by the physical cluster to the application instance, and stores the ownership information and the IP address information corresponding to the application instance in the recording device; The recording device stores IP address information and attribution information corresponding to each application instance in the physical cluster, wherein the IP address information and the attribution information are stored in the recording device when the state of the application instance in the physical cluster changes; The query device, in response to a query request for an application instance in the physical cluster, queries the recording device for IP address information and / or attribution information corresponding to the query request.
7. The information query method according to claim 6, characterized in that: The method further comprises: The monitoring device determines that the triggering event is monitored when monitoring the event of creating the application instance; Alternatively, the monitoring device determines that the triggering event is monitored when monitoring an event of updating the application instance; Alternatively, the monitoring device determines that the triggering event is monitored when monitoring an event of deleting the application instance.
8. The information query method according to claim 6, characterized in that: The method further comprises: When the monitoring device monitors the event of deleting the application instance, it adds an instance offline mark to the instance tag corresponding to the application instance.
9. The information query method according to claim 6, characterized in that: The method further comprises: The sending device obtains the attribution information of the application instance to be sent to the physical cluster, and stores the attribution information in the instance tag corresponding to the application instance.
10. The information query method according to claim 6, characterized in that: The method further comprises: The recording device deletes the IP address information and the attribution information whose storage time exceeds a preset threshold at every preset time period.